这篇笔记是笔者在2013年写的,先一起记录到这里吧!晚上闲着没啥事就想着把Metasploit更新了一下,过了好一会才更新完成,但是在用msfconsole命令启动时出现了以下报错,如图2-1-1。

  1. root@btapt-get update
  2. root@btapt-get upgrade

图片1.png
图2-1-1 Could not find rake-10.1.0

0x01 Metasploit更新报错解决

修改以下文件“CONFIG[“LIBRUBYARG_STATIC”]”这一行的内容,然后进入到/opt/metasploit/msf3目录,在命令终端中执行以下几条命令即可解决该问题。

  • /opt/metasploit/ruby/lib/ruby/1.9.1/i686-linux/rbconfig.rb // 32bit
  • /opt/metasploit/ruby/lib/ruby/1.9.1/x86_64-linux/rbconfig.rb // 64bit ```bash 修改前=> CONFIG[“LIBRUBYARG_STATIC”] = “-Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static” 修改后=> CONFIG[“LIBRUBYARG_STATIC”] = “-Wl,-R -Wl,$(libdir) -L$(libdir)”

root@bt:/opt/metasploit/msf3# /opt/metasploit/ruby/bin/bundle install root@bt:/opt/metasploit/msf3# msfupdate //完成更新后,底部会出现: Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.

root@bt:/opt/metasploit/msf3# msfconsole //启动Metasploit

  1. ![图片2.png](https://cdn.nlark.com/yuque/0/2020/png/1793901/1598403853275-df86c46b-ed42-4226-9ff6-82e01aced81a.png#crop=0&crop=0&crop=1&crop=1&height=111&id=LhCbN&name=%E5%9B%BE%E7%89%872.png&originHeight=110&originWidth=790&originalType=binary&ratio=1&rotation=0&showTitle=false&size=59122&status=done&style=none&title=&width=800)<br />图2-2-2 已经成功启动Metasploit
  2. <a name="9b33z"></a>
  3. ### 0x02 更新后数据库报错问题解决
  4. 已经完成更新并且可以成功启动Metasploit了,但在后面用search命令搜索模块时又出现了以下报错。
  5. ```bash
  6. msf > search ms08
  7. [!] Database not connected or cache not built, using slow search
  8. [-] Error while running command search:

使用db_rebuild_cache命令重建一下模块缓存即可解决该问题。

  1. msf > db_rebuild_cache //清除和重建模块缓存
  2. [*] Purging and rebuilding the module cache in the background...

public.png