Wednesday, 17 November 2010

Fixing a broken Metasploit 3 install on Backtrack 4

A couple of times over the past year, I have somehow broken Metasploit on a Backtrack 4 install. This can sometimes happen if you lose an internet connection whilst running msfupdate.

When this happens, Metasploit will fail to start, with some nasty error messages, basically saying there are file mismatches  or missing files. Metasploit will no longer update using msfupdate, and this can be a pain if you have a HDD or USB install of Backtrack.

Here is how to fix this issue, by reinstalling MSF from the Metasploit repository (pretty simple, delete the current Metasploit install, and reinstall)

cd /opt/metasploit3
rm -rf msf3
svn co https://www.metasploit.com/svn/framework3/trunk msf3


 (Choose "p" if it asks a question about trusting the repository)

After it has finished updating, you will have a working Metasploit Framework again. Hurrah!



(Note: /pentest/exploits/framework3/ is only a link. The real location for the Metasploit install is in /opt/metasploit3/msf3)

8 comments:

  1. thanks alot for the post!!!! i really appreciate man

    ReplyDelete
  2. No problem, thanks for the comment.

    ReplyDelete
  3. man, this really helped a lot. keep up the good work.

    ReplyDelete
  4. I sure can access the cli but the web interface do not work..

    Ruby: No such file or directory -- ./msfweb (LoadError)

    Where did the script ./msfweb go??

    ReplyDelete
  5. sourabh,
    I believe support for msfweb has been discontinued. There is a new UI.

    ReplyDelete
  6. Hello Ben, reinstalled MSF from the Metasploit repository due to this Warning?
    WARNING! The following modules could not be loaded!
    [-] /opt/metasploit3/msf3/modules/post/windows/escalate/service_permissions.rb: NameError /opt/metasploit3/msf3/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant Msf::Post::Registry
    Any clues on how to fix this. I'm running BT4R2 on 15 GB usb stick.

    ReplyDelete
  7. When did this start happening?
    Did you reinstall as I described in the blog? (It is not clear from your question)
    Were you getting this warning, both before and after the reinstall?
    (If you have deleted and reinstalled as I described then you should not be getting this issue)

    ReplyDelete