Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: No database in Metasploit - errors and failures when proposed steps followed

  1. #1
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    6

    Default No database in Metasploit - errors and failures when proposed steps followed

    db_driver shows no active or available drivers. None of the steps I have used to install Postgres or MySQL have worked.

    When I run:
    Code:
    gem install mysql
    It runs successfully, but I still don't have mysql as an available driver and
    Code:
    db_driver mysql
    fails: "Invalid driver specified".

    When I run:
    Code:
    gem install postgres
    It fails with a ruby error "/usr/bin/ruby1.9.2 extconf.rb \ extconf.rb:4:in `<main>': uninitialized constant Object::PLATFORM (NameError)"

    Why doesn't Metasploit come with MySQL and Postgres already configured? What confuses me is that some people are reporting that Postgres works fine in metasploit out of the box. Why would the configurations be different from one VM to another? Some posters are saying that certain metasploit builds work better than others. Others say that it's the ruby version that's at fault (but if you change it, other things break).

    This seems to be in either 'BUG' territory, or there needs to be a much MUCH better guide on setting up databases in metasploit.

    My situation is identical to the OP:
    metasploit db_driver issues (or have i totally lost it?) - I have not tried his workaround script yet.

    Environment:
    Fresh BT5 32bit Gnome VM
    Metasploit 3.7.0 and 3.8.0 r13224 (tried before upgrading and after)

    Steps tried:
    BT5 + Metasploit + PostgreSQL
    Metasploit db_autopwn using PostgreSQL
    -- These both fail to make Postgres an available driver. i.e. db_driver postgres fails with "Invalid driver specified".
    I have deleted the VM and started fresh twice.

  2. #2
    Administrator sickness's Avatar
    Join Date
    Jan 2010
    Location
    Behind the screen.
    Posts
    2,921

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    Metasploit already somes with postgresql running, check your processes and you will see it's up and running, also follow the official wiki guide for mysql.

    http://www.backtrack-linux.org/wiki/...ramework_MySQL
    Back|track giving machine guns to monkeys since 2007 !

    Do not read the Wiki, most your questions will not be answered there !
    Do not take a look at the: Forum Rules !

  3. #3
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    6

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    I get that it is supposed to be enabled by default, but why does db_hosts and db_driver show no hosts and no drivers? Port 7175 (the default Postgres port for metasploit) is showing as listening, but why does metasploit not see it?

    I have uninstalled metasploit, rebooted, and reinstalled from Rapid7 binary installer a couple times, but the behavior remains. I even tried different ports, to no avail.

    I am dead in the water until I figure this out.

    Is it noteworthy that the Web Security Dojo 1.2 VM has exactly the same problem? Could the VM manager cause this kind of problem? (If so, why the ruby error on 'gem install postgres').

    Any ideas would be helpful.

  4. #4
    Good friend of the forums scottm99's Avatar
    Join Date
    Feb 2010
    Location
    underwater
    Posts
    371

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    I'm one of those who's mentioned metasploit & postgres working fine out of the box. I'm also using the BT5 32-bit gnome VM environment. When you start metasploit & run db_status, what's the output? I get "postgresql connected to msf3".

    You might also have a look at /opt/framework3/config/database.yml for postgresql configuration stuff. Also, have you tried running /opt/framework3/postgresql/bin/psql –U msf3 –d msf3 to connect to the msf3 database used by metasploit?
    If I could figure out how to scuba dive & hack at the same time, there would be nothing I couldn't do...

  5. #5
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    6

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    db_status:[*] No driver selected

    root@bt:~# /opt/framework3/postgresql/bin/psql –U msf3 –d msf3
    psql.bin: warning: extra command-line argument "–d" ignored
    psql.bin: warning: extra command-line argument "msf3" ignored
    Password for user msf3:

    but I do not know the password. Same for the postgres user when running:
    root@bt:~# /opt/framework3/postgresql/bin/psql –d msf3

    What should these passwords be

  6. #6
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    6

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    msf > db_status[*] No driver selected
    msf >

    root@bt:/opt/framework3/config# cat database.yml

    production:
    adapter: postgresql
    database: msf3
    username: msf3
    password: *PASSWORD*
    host: 127.0.0.1
    port: 7175
    pool: 75
    timeout: 5

    root@bt:/opt/framework3/config# /opt/framework3/postgresql/bin/psql –U msf3 –d msf3
    psql.bin: warning: extra command-line argument "–d" ignored
    psql.bin: warning: extra command-line argument "msf3" ignored
    Password for user msf3:
    psql.bin: FATAL: database "–U" does not exist

  7. #7
    Good friend of the forums scottm99's Avatar
    Join Date
    Feb 2010
    Location
    underwater
    Posts
    371

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    Another follow-up...have you tried starting msfconsole using sudo (i.e. "sudo msfconsole" from /pentest/exploits/framework3)? This has resolved problems for me in the past. Failing that, perhaps running msfupdate, and grabbing the latest version of the framework would help.
    If I could figure out how to scuba dive & hack at the same time, there would be nothing I couldn't do...

  8. #8
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    6

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    Sorry, using sudo does not change behaviour.

  9. #9
    Just burned his ISO
    Join Date
    Jul 2011
    Posts
    2

    Default 回覆: No database in Metasploit - errors and failures when proposed steps followed

    Or you can try this... i got the solution on the internet..

    when you start msfconsole by /pentest/exploits/framework3/msfconsole, it does not set the environment variables properly

    So all you have to do is, start msfconsole using BT5 menu or by using /usr/local/bin/msfconsole

    Reference by : THIS IS MY eye-Blog: No Active Driver when you type in db_driver or db_connect?

  10. #10
    Just burned his ISO
    Join Date
    Jul 2009
    Posts
    1

    Default Re: No database in Metasploit - errors and failures when proposed steps followed

    Thanks scott. After trying various approaches (including an update and new install of the framework), the sudo command solved it (postgresql database). I`m running the 64-bit BT5 in Vmware workstation 7.13. Hope this helps others.

Page 1 of 2 12 LastLast

Similar Threads

  1. Error when adding user to MySQL database in Metasploit 3
    By Nyk0n in forum BackTrack 5 Beginners Section
    Replies: 3
    Last Post: 06-16-2011, 02:01 PM
  2. Metasploit errors
    By bk5115545 in forum BackTrack 5 Beginners Section
    Replies: 4
    Last Post: 06-08-2011, 10:23 AM
  3. metasploit vbs to .doc errors
    By pentest09 in forum Beginners Forum
    Replies: 3
    Last Post: 09-28-2010, 11:55 PM
  4. Metasploit Database Problems
    By xtjacob in forum Beginners Forum
    Replies: 2
    Last Post: 06-08-2010, 11:50 AM
  5. Metasploit Opcode Database down?
    By jorgan in forum OLD General IT Discussion
    Replies: 7
    Last Post: 04-17-2008, 11:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •