Metasploit connection errors.
Hey guys Im looking for some help getting metasploit working again after an update on my Galaxy S10..
I have all the necessary gems installed but when I start the console it refuses to connect to the server, and gives this error message:
Connection refused    Is the server running on host "127.0.0.1" and accepting    TCP/IP connections on port 5432? When I check the db_status it also shows an error message:  [*] postgresql selected, no connection I've been Googling for days, and all the solutions I've found so far for similar issues with connecting, just don't seem to work for me.
I would really appreciated some help as I'm tearing my hair out trying to fix this problem.
Thank you for reading this.
If you still use the default credentials then you should be able to connect by running:
db_connect msf:msf@127.0.0.1:5432/msf_database
Thank you for replying, but when I run that command the console just refreshes without any errors, and when I run db_status again to check, it still doesn't want to connect.
msf > db_connect msf:msf@127.0.0.1:5432/msf_database msf > msf > db_status [*] postgresql selected, no connection
It looks like your problem is down to Metasploit trying to connect to PostgreSQL, when the service isn't actually running.
Exit Metasploit and enter this in your terminal:
mkdir -p $PREFIX/var/lib/postgresql Start the Metasploit console again, and enter: pg_ctl -D $PREFIX/var/lib/postgresql start That will boot the server and you can connect with: db_connect msf:msf@127.0.0.1:5432/msf_database Check it out with: db_status [*] postgresql connected to msf_database Fuck Yeah !!!