这篇笔记是笔者在2013年写的,先一起记录到这里吧!晚上闲着没啥事就想着把Metasploit更新了一下,过了好一会才更新完成,但是在用msfconsole命令启动时出现了以下报错,如图2-1-1。
root@bt:apt-get update
root@bt:apt-get upgrade
图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
<br />图2-2-2 已经成功启动Metasploit
<a name="9b33z"></a>
### 0x02 更新后数据库报错问题解决
已经完成更新并且可以成功启动Metasploit了,但在后面用search命令搜索模块时又出现了以下报错。
```bash
msf > search ms08
[!] Database not connected or cache not built, using slow search
[-] Error while running command search:
使用db_rebuild_cache命令重建一下模块缓存即可解决该问题。
msf > db_rebuild_cache //清除和重建模块缓存
[*] Purging and rebuilding the module cache in the background...