Join us on Slack!
I'd prefer to die standing, than to live on my knees - Che Guevara
Saturday, January 18, 2020
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 46
Guests Online: 45
Members Online: 1

Registered Members: 123096
Newest Member: Alexafade
Latest Articles
View Thread

HellBound Hackers | Computer General | Hacking in general

Author

Metasploit connection errors.

SuQuay_FuQuay
Member

Your avatar

Posts: 19
Location:
Joined: 13.03.16
Rank:
Hacker Level 2
Posted on 05-01-20 01:31
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.
Author

RE: Metasploit connection errors.

Maxi
Member

Your avatar

Posts: 4
Location:
Joined: 05.09.15
Rank:
Active User
Posted on 05-01-20 01:51
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
Author

RE: Metasploit connection errors.

SuQuay_FuQuay
Member

Your avatar

Posts: 19
Location:
Joined: 13.03.16
Rank:
Hacker Level 2
Posted on 05-01-20 02:00
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
Author

RE: Metasploit connection errors.

Huitzilopochtli
Member



Posts: 1629
Location:
Joined: 19.02.13
Rank:
God
Posted on 05-01-20 04:17
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 !!!


.
Author

RE: Metasploit connection errors.

SuQuay_FuQuay
Member

Your avatar

Posts: 19
Location:
Joined: 13.03.16
Rank:
Hacker Level 2
Posted on 05-01-20 23:57
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. Grin