Results 1 to 10 of 10

Thread: Postgresql and Metasploit

  1. #1
    Join Date
    2015-Mar
    Posts
    10

    Postgresql and Metasploit

    Hi and thanks for the help. I am having difficulty getting Metasploit to connect to the db. I have confirmed postgresql starts:

    service postgresql start
    [OK] Starting PostgreSQL 9.4 database server: main.

    Then I try and start the Metasploit service but get an error:

    service metasploit start
    metasploit: unrecognized service

    Then I start msfconsole. It starts fine. I run:

    db_status[*] postgresql selected, no connection.

    Not sure what my next steps should be. I can run db_connect but I am not sure what the rest of the command should look like. Any help would be greatly appreciated. Thanks again.

  2. #2
    Join Date
    2015-Apr
    Posts
    12
    so you need to start the metasploit service via the nethunter android app under services. not with in the command line. it won't show as a service there.

    so what i did is just start command line start postgresql service, go to android app start metasploit service, and then back to console and start msfconsole

  3. #3
    Join Date
    2015-Mar
    Posts
    10
    Thanks for the help. No luck though. Started Postgresql from the command line, service postgresql start, then went to the Kali Service Control screen and started the Metasploit service. Returned to the command line and tried msfconsole. Metasploit loaded then I tried db_status:
    [*] postgresql selected, no connection.

    I must also mention, when I leave the Kali Service Control screen and return, the Metasploit service is down again. Thanks again!

  4. #4
    Join Date
    2015-Apr
    Posts
    12
    Quote Originally Posted by Noob123 View Post
    Thanks for the help. No luck though. Started Postgresql from the command line, service postgresql start, then went to the Kali Service Control screen and started the Metasploit service. Returned to the command line and tried msfconsole. Metasploit loaded then I tried db_status:
    [*] postgresql selected, no connection.

    I must also mention, when I leave the Kali Service Control screen and return, the Metasploit service is down again. Thanks again!
    humm your right even with connecting the db_status is still showing disconnected. i tried loading the dummy database.yml that cames with metasploit but it does not load it either.

    wondering if because they changed how the services work and loading if it never created the database. may report it on the github as a issue.
    https://github.com/offensive-securit...sue+is%3Aopen+

    its not working for me either.

  5. #5
    Join Date
    2015-Apr
    Posts
    12
    so after a little digging around it looks like they changed some things around from the last version to this. so to get it working what you will need to do is start up constole. make sure postgresql is started, then go to /usr/share/metasploit-framework and then run the msfdb init to build the database, then start up msfconsole and run your db_status and it will come back as postgresql connected to msf

    hope that helps.

    i wrote up the steps here with a few screenshots.
    http://localtechrepair.blogspot.com/...-database.html
    Last edited by ldglance; 2015-08-18 at 20:21. Reason: add link for screenshot from writeup on fix

  6. #6
    Join Date
    2015-Mar
    Posts
    10
    Awesome! Thanks! Worked like a charm. I couldn't navigate to /usr/share/metasploit-framework though. Tried from both the local connection as well as the terminal in Kali, i.e. logged on as root@Kali as well as u0_a81@grouper. Couldn't find the directory though. So, I ran msfdb init straight from the Kali terminal. It started up and I could see it saved the msf and msf_test dbs in the /usr/share/metasploit-framework directory. How would I navigate there? Thanks again!

  7. #7
    Join Date
    2015-Mar
    Posts
    10
    Sorry, tried to post earlier but must have messed up. msfdb init did the job! Metasploit now connects to the msf db. had a little trouble though as I couldn't find /usr/share/metasploit-framework from either the local login or the Kali terminal. I ran the command as Root@Kali and it worked. Still can't seem to find the directory though. Funny too, when I try and "Turn Off External Wifi" from the menu, I get an error that "/usr/bin/stop-wlan1.sh : No file or directory" exists. Is it possible the name was changed? Anyway, thanks again! You were a big help. Have a good one.

  8. #8
    Join Date
    2015-Apr
    Posts
    12
    humm that could be because i purged and reinstalled metasploit framework. i should probably reflash and see if that changed the folder structure.

    as for the turn off external wifi. ya that has never worked for the one plus one roms. you will need to manually do the "ip link set wlan1 down" command (or what ever your wlan is set to for your external card). your more than willing to recreate that script and move it to that location to get it to work though i just haven't taken the time to rewrite it and do a pull for it.

  9. #9
    Join Date
    2015-Mar
    Posts
    10
    sound great. Thanks again for the help. I am pretty psyched everything is running well. Have a good one!

  10. #10
    Join Date
    2015-Mar
    Posts
    10
    Um, I am a dope. Found the directory, ls -a.

Similar Threads

  1. Problems with metasploit and postgresql
    By brut3impact in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2014-10-22, 11:33
  2. metasploit and postgresql help
    By Lordx19 in forum TroubleShooting Archive
    Replies: 18
    Last Post: 2014-03-04, 14:00

Posting Permissions

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