Rogue Security Wiki

Run Metasploit only in a lab or against systems you are explicitly authorized to assess. Define the target scope before starting.

πŸ—„οΈ Initialize the Database

sudo systemctl start postgresql
sudo msfdb init
msfconsole
db_status

If db_status reports that PostgreSQL is selected but not connected, leave msfconsole, initialize or repair the database, restart PostgreSQL, and check again:

exit
sudo msfdb init
sudo systemctl restart postgresql
msfconsole
db_status

πŸ—ΊοΈ Import an Nmap Scan

Create XML output with Nmap:

nmap -Pn -sS -A -oX test.xml target

Import and inspect it from msfconsole:

db_import test.xml
hosts
services

πŸ”Œ SYN Port Scanner

search portscan
use auxiliary/scanner/portscan/syn
set INTERFACE eth0
set PORTS 80
set RHOSTS targets
set THREADS 50
run

🌐 TCP Port Scanner

use auxiliary/scanner/portscan/tcp
hosts -R
set RHOSTS target
run

πŸͺŸ SMB Version Scanner

use auxiliary/scanner/smb/smb_version
set RHOSTS targets
set THREADS 11
run

Review show options before running a module. Confirm the selected hosts, ports, interface, and thread count are appropriate for the authorized environment.