February 2018
Intermediate to advanced
426 pages
11h 3m
English
To connect to a database manually, you can use the db_connect command followed by the credentials, host, and database you want to connect to, using the following syntax:
db_connect <user:pass>@<host:port>/<database>
To test the db_connect command, we can use the values of the username, password, database name, and port number, from the database.yml file:
msf > db_disconnect msf > db_status [*] postgresql selected, no connectionmsf > db_connect msf:3HcNhAtdH6F9F2iGa4z3wJVoI7UK1Ot+MG1zuKjYzn4=@127.0.0.1/msf[*] Rebuilding the module cache in the background...msf > db_status [*] postgresql connected to msf
We can also use db_connect with the -y option and the path to the database configuration file:
msf > db_disconnect msf > db_status ...
Read now
Unlock full access