更新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. 如何使用kaptcha验证码组件

    kaptcha是基于SimpleCaptcha的验证码开源项目. kaptcha是纯配置的,使用起来比较友好.如使用了Servlet,所有配置都在web.xml中.如果你在项目中使用了开源框架(比如S ...

  2. JavaScript高级程序设计:第四章

    变量.作用域和内存问题 1.ECMAScript变量可能包含两种不同数据类型的值:基本类型值和引用类型值.基本类型值指的是简单的数据段,引用类型值指的是有多个值构成的对象. 2.动态的属性:定义一个基 ...

  3. Linux下开启nfs服务

    1.什么是NFS(Network FileSystem) NFS 就是 Network FileSystem 的缩写,最早之前是由 Sun 所发展出来的.他最大的功能就是可以透过网络,让不同的机器.不 ...

  4. C++11 半同步半异步线程池的实现

    #include <list> #include <mutex> #include <thread> #include <condition_variable ...

  5. 关于spring的注解方式注入默认值(转) -- 首字母小写

    1.是首字母小写 比如 UserAction对应的id是userAction 可以通过ApplicationContext 对象的act.getBean("userAction") ...

  6. linux 查看 cpu 和内存的命令 - top

    1.查看内存,cpu ,当前进程task数目, 每个进程的cpu, 内存使用率, 用top 命令: 在这个页面,按 P,下面的进程排序,以cpu使用率降序排列. 按M,按内存使用率降序排列: 按N, ...

  7. 12C cdb/pdb 配置监听

    . PDB is not an instance, so using SID in the connection string will not work. When the database is ...

  8. gSoap工具wsdl2h及soapcpp2指令汇总

    gSoap开发包的下载地址http://sourceforge.net/projects/gsoap2,在bin目录下提供了两个工具: 1:wsdl2h:The gSOAP wsdl2h tool i ...

  9. iOS 程序性能优化

    前言 转载自:http://www.samirchen.com/ios-performance-optimization/ 程序性能优化不应该是一件放在功能完成之后的事,对性能的概念应该从我们一开始写 ...

  10. 命令行从Android手机中导出已安装APK的方法调研

    一.背景 二.步骤 一.背景 很多时候,APK文件只存在于应用市场,在PC上无法直接下载.用手机下载下来后就直接安装了,也不能保存原始的APK文件. APK安装到手机后,Android系统会保存一份和 ...