Databases

Setting up the database

PostgreSQL Status

$ sudo service postgresql status

Start PostgreSQL

$ sudo systemctl start postgresql

MSF - Initiate a Database

$ sudo msfdb init

MSF - Connect to the Initiated Database

$ sudo msfdb run

MSF - Reinitiate the Database

rednorth@htb[/htb]$ msfdb reinit
$ cp /usr/share/metasploit-framework/config/database.yml ~/.msf4/
$ sudo service postgresql restart
$ msfconsole -q

msf6 > db_status

MSF - Database Options

Workspaces

Importing Scan Results

Next, let us assume we want to import a Nmap scan of a host into our Database's Workspace to understand the target better. We can use the db_import command for this. After the import is complete, we can check the presence of the host's information in our database by using the hosts and services commands. Note that the .xml file type is preferred for db_import.

Stored Nmap Scan

Importing Scan Results

Using Nmap Inside MSFconsole

MSF - Nmap

Data Backup

MSF - DB Export

Credentials

MSF - Stored Credentials

Loot

MSF - Stored Loot

Last updated