Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Metasploit connection errors.


SuQuay_FuQuay's Avatar
Member
0 0

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.


Maxi's Avatar
Member
0 0

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


SuQuay_FuQuay's Avatar
Member
0 0

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


Huitzilopochtli's Avatar
....
10 9

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 !!!


SuQuay_FuQuay's Avatar
Member
0 0

Thank you so much Huitzilopochtli.  I feared Metasploit would never work again, as I'd already reinstalled it about 10 times without success,  but now it's running perfectly again without any errors.

I salute you sir. :D