Windows下安装metasploit-framework所遇到的问题

首先说明,msf最好还是安装在linux下,安装在windows下的话问题实在太多了。

1. Metasploit-framework v6.2.19 Setup Wizard ended prematurely

截图如下:

 

 

 

出现这个的原因其实很简单:权限不够。

所以,只需要切换成administrator,或者以管理员权限运行cmd,在cmd中执行安装文件即可。

2. msfdb init失败

报错如下:

复制代码
<internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': 126: The specified module could not be found.   - C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg_ext.so (LoadError)
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:49:in `block in <module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:32:in `rescue in block in <module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:26:in `block in <module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:42:in `<module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:6:in `<top (required)>'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/metasploit-framework/bin/../embedded/framework/msfdb:15:in `<main>'
<internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': 126: The specified module could not be found.   - C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg_ext.so (LoadError)
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:49:in `block in <module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/dll_directory.rb:67:in `initialize'
        from C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `new'
        from C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/ruby_installer/runtime/singleton.rb:12:in `add_dll_directory'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:28:in `block in <module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:42:in `<module:PG>'
        from C:/metasploit-framework/embedded/lib/ruby/gems/3.0.0/gems/pg-1.4.3/lib/pg.rb:6:in `<top (required)>'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/metasploit-framework/bin/../embedded/framework/msfdb:15:in `<main>'
<internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- pg (LoadError)
        from <internal:C:/metasploit-framework/embedded/lib/ruby/site_ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/metasploit-framework/bin/../embedded/framework/msfdb:15:in `<main>'
复制代码

出现这种报错就是因为第1个错误,也就是msf的相关文件没有安装完全。

同时,这个错误反应在msfconsole中就是使用db_status等命令时提示:No database driver installed

 

 

3.msfdb init出现以下错误:

 

 别看数据库在启动,但是永远也启动不了。目前这个错误原因还不是很清楚,也没找到直接的解决方法。

只想到了一个替代方案:安装一个postgresql,然后让msf连接到这个安装的postgresql上。

但是后续还有很多麻烦的地方。所以,msf的数据库问题我就放弃了,还是乖乖用kali上的msf吧。

 

posted @   泓溪  阅读(2454)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示