Metasploit Section 7 of 10

Database Setup

Metasploit uses PostgreSQL to store scan results, hosts, services, and vulnerabilities. Setting it up enables powerful features like db_nmap and workspace management.

Step 1: Start PostgreSQL

bash
1sudo systemctl start postgresql

Step 2: Initialize Database

bash
1sudo msfdb init

Step 3: Launch msfconsole

bash
1msfconsole

Step 4: Verify Connection

bash
1db_status

Database-Aware Commands

bash
1db_nmap -sS 10.0.0.0/24 # Scan and import results
2hosts # Show hosts in database
3services # Show services discovered
4vulns # Show vulnerabilities found
5workspace -a pentest # Create workspace
6workspace pentest # Switch to workspace