Metasploit Framework

Setup MSF Database

Begin MSF Database

Is not started by default

sudo msfdb init

Enable Database Launch on System Start

Uses postgresql

sudo systemctl enable postgresql

Enter CLI

sudo msfconsole

Verify Database Connectivity

msf6> db_status

Setup and Work with MSF

Start database service and initialize MSF database

Enable database service at boot time

Workspaces

When we perform a penetration test with Metasploit, it will stare all information about our target in its infrastructure in the database. When we start the next penetration test, this information still exists in the database. We can avoid mixing each assessment's results by using workspaces.

The Metasploit workspace command lists all previously created workspaces.

Here is how you would create a workspace:

Database Backend Commands

db_nmap

a wrapper to execute nmap inside metasploit and save the findings in the database:

hosts

provides a list of all discovered hosts

services

display discovered services from our port scan

Last updated