[go: up one dir, main page]

0% found this document useful (0 votes)
45 views2 pages

Error Metasploit

The document describes troubleshooting steps to resolve a Metasploit error connecting to the local PostgreSQL database. The key steps are to edit the Metasploit database configuration file 'database.yml' to change the PostgreSQL port from the default 5432 to 5433, copy the edited file to the Metasploit configuration directory, and restart PostgreSQL. This allows Metasploit to connect to the database and launch msfconsole.

Uploaded by

Muhammad Gusti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views2 pages

Error Metasploit

The document describes troubleshooting steps to resolve a Metasploit error connecting to the local PostgreSQL database. The key steps are to edit the Metasploit database configuration file 'database.yml' to change the PostgreSQL port from the default 5432 to 5433, copy the edited file to the Metasploit configuration directory, and restart PostgreSQL. This allows Metasploit to connect to the database and launch msfconsole.

Uploaded by

Muhammad Gusti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

METASPLOIT ERROR LOCALHOST

msfconsole
[-] Failed to connect to the database: could not connect to
server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and
accepting
TCP/IP connections on port 5432?
FULLY WORKING SOLUTION
Type the following commands
1.root@kali:~# cd /usr/share/metasploit-framework/config/
2.root@kali:/usr/share/metasploit-framework/config# ls
application.rb database.yml database.yml.vagrant
boot.rb database.yml.example environment.rb
cucumber.yml database.yml.travis environments
3.root@kali:/usr/share/metasploit-framework/config# cat database.yml
development:
adapter: postgresql
database: msf
username: msf
password: 2OjgyhT0tacdnxrYIKC8BgDel7tbY=
host: localhost
port: 5432
pool: 5
timeout: 5
production:
adapter: postgresql
database: msf
username: msf
password: 2O/UYGBP3jgyjgYuIT0tacdnxrYIKC8BgDel7tbY=
host: localhost
port: 5432
pool: 5
timeout: 5
test:
adapter: postgresql
database: msf_test
username: msf
password:
2O/UYGBP3nAhfhffhhyfh0tacdnxrYIKC8BgDel7tbY=
host: localhost
port: 5432
pool: 5
timeout: 5

NOW CHANGE THE PORT NUMBER FROM 5432 TO 5433


THIS IS THE MAIN STEP SO DON'T MISS IT
4.root@kali:/usr/share/metasploit-framework/config# nano database.yml
5.root@kali:/usr/share/metasploit-framework/config# cp database.yml /root/.msf4/
6.root@kali:/usr/share/metasploit-framework/config# cd ~/.msf4/
7.root@kali:~/.msf4# ls
database.yml history local logos logs loot modules plugins
8.root@kali:~# /etc/init.d/postgresql start
9.root@kali:~# msfconsole

You might also like