I am running Arch Linux on my i386 laptop.

I've made a fresh install of ruby1.9 and metasploit from AUR and now I'm experiencing some weird stuff with it.

First, it does not load any modules upon starting msfconsole. Although loadpath /usr/share/metasploit/modules works, I still wonder why it isn't automatic.

And the second thing is, it doesn't work with the database properly. I've installed PostgreSQL, started it, created a superuser role and 'msf' database. db_connect <username>@msf works perfectly, as db_status outputs [*] postgresql connected to msf. However, db_rebuild_cache or any other db-related command outputs "The database is not connected" or a similar message. This issue stops me from further use of Metasploit.

I've googled it really hard, but there's nothing out there at this problem. There's the following piece of code in db.rb file:

  def cmd_db_rebuild_cache
        unless framework.db.active
            print_error("The database is not connected")

And this:

    def cmd_db_status(*args)
        return if not db_check_driver
        if ::ActiveRecord::Base.connected?
            print_status("#{framework.db.driver} connected to #{cdb}"

So, it turns out that connection actually exists, but it's kind of... inactive.

Any help on this issue would be much appreciated.


Try having the database connect while it's starting up. Check out this blog [http://www.darkoperator.com/installing-metasploit-in-ubunt/] post about setting up Metasploit on Ubuntu but it should be very similar to Arch in a lot of ways. In particular put the following in your home directory under ~/.msf4/database.yml:

 adapter: postgresql
 database: msf
 username: msf
 port: 5432
 pool: 75
 timeout: 5

Obviously changing the password, database, and username to fit what you setup is. This should make it so the database is loaded when msfconsole starts.

This should make sure the right functions are called to get the caching and everything to work.

  • Did it, and indeed, it connected to the database after msfconsole started, but unfortunately, database-related commands still do not work and no modules are loaded on startup. – user368757 Sep 16 '14 at 5:03
  • Try using the git version of Metasploit. git clone https://github.com/rapid7/metasploit-framework.git – mubix Sep 17 '14 at 13:32

try to run msfupdate to update from git to latest metasploit version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.