更新Metasploit最新版本:
#cd /opt/metasploit/
#rm -rf msf3
#git clone --depth=1 git://github.com/rapid7/metasploit-framework msf3
执行msfupdate出错如下:
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/opt/metasploit/ruby/bin/ruby extconf.rb 
checking for pg_config... yes
Using config values from /opt/metasploit/postgresql/bin/pg_config
checking for libpq-fe.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
   --with-opt-dir
   --without-opt-dir
   --with-opt-include
   --without-opt-include=${opt-dir}/include
   --with-opt-lib
   --without-opt-lib=${opt-dir}/lib
   --with-make-prog
   --without-make-prog
   --srcdir=.
   --curdir
   --ruby=/opt/metasploit/ruby/bin/ruby
   --with-pg
   --without-pg
   --with-pg-dir
   --without-pg-dir
   --with-pg-include
   --without-pg-include=${pg-dir}/include
   --with-pg-lib
   --without-pg-lib=${pg-dir}/lib
   --with-pg-config
   --without-pg-config
   --with-pg_config
   --without-pg_config
/opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
   from /opt/metasploit/ruby/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
   from extconf.rb:43:in `<main>'

Gem files will remain installed in /opt/metasploit/ruby/lib/ruby/gems/1.9.1/gems/pg-0.15.0 for inspection.
Results logged to /opt/metasploit/ruby/lib/ruby/gems/1.9.1/gems/pg-0.15.0/ext/gem_make.out
An error occured while installing pg (0.15.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.0'` succeeds before bundling.
执行msfconsole出错如下:

Could not find pg-0.15.0 in any of the sources

Run `bundle install` to install missing gems.
执行bundle install出错如下:

An error occured while installing pg (0.15.0), and Bundler cannot continue.

Make sure that `gem install pg -v '0.15.0'` succeeds before bundling.
搜索国外论坛总结下完整的BackTrack 5 R3 Metasploit更新方法, 以备后用:
#cd /opt/metasploit/
#rm -rf msf3
#git clone --depth=1 git://github.com/rapid7/metasploit-framework msf3
修改文件:
32位:/opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux/rbconfig.rb
64位:/opt/metasploit/ruby/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb
找到CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static"
改为CONFIG["LIBRUBYARG_STATIC"] = "-Wl,-R -Wl,$(libdir) -L$(libdir) "
然后执行(一定要在/opt/metasploit/msf3目录下执行):
#cd /opt/metasploit/msf3
#./msfupdate
执行上面命令后会自动检查安装更新msf3所依赖的ruby模块,更新Metasploit一直出错在pg-0.15.0的问题迎刃而解@@

附更新后数据库错误问题解决办法:

msf > search ms13
[!] Database not connected or cache not built, using slow search msf > db_rebuild_cache
[*] Purging and rebuilding the module cache in the background...

BackTrack 5 R3 Metasploit更新方法及msfupdae,msconsole出错解决办法的更多相关文章

  1. [转]Linux df 命令不更新磁盘数据空间使用情况的解决办法

    当你已经找出并remove掉Linux系统中的大容量文件时,然后使用df -h查看使用情况依旧不变时.可尝试如下方法解决 1.找出那个进程占用了哪些已删除的文件 # 查看哪些被文件还在被哪个进程占用 ...

  2. tk.mybatis通用插件updateByPrimaryKeySelective无法自动更新ON UPDATE CURRENT_TIMESTAMP列的解决办法

    tk.mybatis是一个很好用的通用插件,把CRUD这些基本的数据操作全都用动态SQL语句自动生成了,mapper和xml里十分清爽,但是昨天发现有一个小坑,记录在此: 有一张表,结构如下(已经简化 ...

  3. pymysql_mysql密码重置方法,连接局域网数据库的解决办法

    https://blog.csdn.net/qq_37176126/article/details/72824106   pymysql模块的操作 https://blog.csdn.net/skh2 ...

  4. youtube-dl更新出错解决办法

    youtube-dl更新命令: youtube-dl -U 更新报错:无法识别当前版本 ERROR: can't find the current version. Please try again ...

  5. AFNetworking 3.0中调用[AFHTTPSessionManager manager]方法导致内存泄漏的解决办法

    在使用AFNetworking3.0框架,使用Instruments检查Leaks时,检测到1000多个内存泄漏的地方,定位到 [AFHTTPSessionManager manager] 语句中,几 ...

  6. UnitOfWork 更新实体出错解决办法

    用UnitOfWork进行实体更新的时候,再查询实体一次,再去更新的时候会报如下错误: Attaching an entity of type 'TinyFrame.Data.DomainModel. ...

  7. SVN更新的时候报断言失败解决办法

    解决办法:没啥好方法,重新检出代码就好使了.

  8. xml 方式更新和获取 配置文件 appSettings 节点 解决办法

    最近在搞一个小程序,会用到动态修改配置文件来进行处理,在百度上找了很多办法,但是始终达不到我预想的效果,先列出程序运行环境和开发工具版本: 开发工具:VS2010 .Net 运行环境:4.0 有两种方 ...

  9. Visual Studio 2010 更新NuGet Package Manager出错解决办法

    在Visual Studio 2010的扩展管理器中发现NuGet Package Manger有最新版本更新提示,选择更新安装提示以下错误信息: 2013/4/25 1:11:48 - Micros ...

随机推荐

  1. 《C++ Primer》之面向对象编程(一)

    面向对象编程基于三个基本概念:数据抽象.继承和动态绑定.//动态绑定使编译器能够在运行时决定是使用基类中定义的函数还是派生类中定义的函数. 面向对象编程的关键思想是多态性(polymorphism). ...

  2. Apache Shiro 认证过程

    3.1.1    示例 Shiro验证Subjects 的过程中,可以分解成三个不同的步骤: 1. 收集Subjects 提交的Principals(身份)和Credentials(凭证): 2. 提 ...

  3. C++之文件输入输出

    在这里遇见不少的问题,其中的路径问题就是在windows中,\\转义字符才能准确的表示路径 #include <iostream> #include <fstream> #in ...

  4. hdu 2503 a/b + c/d

    Problem Description 给你2个分数,求他们的和,并要求和为最简形式.   Input 输入首先包含一个正整数T(T<=1000),表示有T组测试数据,然后是T行数据,每行包含四 ...

  5. ECOS-认证地址

    ECOS系统授权认证,需要和Shopex认证中心互联.当服务器DNS无效时.需要绑定host强行解析服务器强行解析以下vim /etc/hosts 122.144.135.142 service.sh ...

  6. 修改一个Label上字体的大小(富文本)

    假如修改上面的Label上价格30000的大小,那么需要用到富文本 上代码 // 字符串30000 NSString * priceNumber = @"30000"; [pric ...

  7. 使用Visual C++编程

    1.Visual C++的主要组件 Visual C++支持遵循C++11语言标准的C++语句,C++11语言标准是在ISO/IEC 14882:2011文档中定义的.Visual C++还没有实现该 ...

  8. Ansible6:Playbook简单使用【转】

    ansbile-playbook是一系列ansible命令的集合,利用yaml 语言编写.playbook命令根据自上而下的顺序依次执行.同时,playbook开创了很多特性,它可以允许你传输某个命令 ...

  9. MFC下对串口的操作以及定时器的调用

    最近研究了一下MFC下对串口的操作,测试了一下对设备的读写. 1.打开串口 GetDlgItem(IDC_BUTTON_OPEN)->EnableWindow(FALSE); m_hComm = ...

  10. isr

    Kafaka动态维护了一个同步状态的副本的集合(a set of in-sync replicas),简称ISR