1

Before I start I would like to inform you that I own a MacBook Pro (Version 10.13), not Linux or Windows.

For the past year and a half I have had metasploit installed on my computer. It has had absolutely no problems, and I have ben using it quite a lot. I only had the metasploit framework installed on my personal account, and recently I decided to install it onto my student account (On The Same Computer), so I downloaded a package (.pkg) for the metasploit framework and installed it. It all worked flawlessly, and I was able to run msfconsole, I checked with db_status, and it said that it was connected. All perfect. But then, I signed in to my personal account, tried running msfconsole, and it did not work, I do not remember in detail, but it had asked me

LOG: database system is shut down If your database is corrupt, would you to reinitialize it?:

Anyways, I'm in another situation now. I completely uninstalled Metasploit & PostgreSQL from both my accounts, then installed them back ONLY on my personal account. I set metasploit up; all smooth. I go to run msfconsole, and then this is the output:

Aryamans-MacBook-Pro:~ admin$ msfconsole
    [-] Failed to connect to the database: FATAL:  password authentication 
    failed for user "msf"

    [*] Starting the Metasploit FrameworK console.../

I have postgreSQL installed; the latest version. And when I type db_status in terminal this is what I get:

    msf > db_status
    [*] postgresql selected, no connection

This has been a problem for about 4 days now, and I would really love if there is a solution to this.

Feel free to ask me any questions about anything else in detail, I will provide you with the info.

oguz ismail
  • 1
  • 16
  • 47
  • 69
AryS
  • 43
  • 1
  • 7

3 Answers3

3

I just found out how to solve it, it was just a problem with the database, so all that had to be done was to recreate the Database that Metasploit Framework uses, using Metasploit. Here are the commands:

msfdb delete
msfdb init
msfconsole
AryS
  • 43
  • 1
  • 7
1

You have to navigate into your folder like so:

cd /opt/metasploit-framework/bin
ls
./msfupdate
./msfdb

Manage a metasploit framework database

  msfdb init    # initialize the database
  msfdb reinit  # delete and reinitialize the database
  msfdb delete  # delete database and stop using it**strong text**
  msfdb status  # check database status
  msfdb start   # start the database
  msfdb stop    # stop the database
  msfdb restart # restart the database

./msfdb init
Found database config at /Users/ME/.msf4/database.yml, do you want to overwrite it?: yes

Done!

Kingsley
  • 14,398
  • 5
  • 31
  • 53
0

1.The Homebrew package manager includes launchctl plists to start automatically. For more information run brew info postgres.

Start manually:

pg_ctl -D /usr/local/var/postgres start

Stop manually:

pg_ctl -D /usr/local/var/postgres stop

Start automatically:

"To have launchd start postgresql now and restart at login:"

brew services start postgresql

2.Initialise the Metasploit PostgreSQL Database With PostgreSQL up and running, we next need to create and initialize the msf database.

msfdb init

Sometimes you can have problems with your database msf because you had preconfigured. I recomend you follow the next steps if the previous don't work.

msfdb delete

msfdb init

msfconsole

Good luck!!