πŸ—„οΈ Database

πŸ’‘ Purpose

  • Track scan results, discovered credentials, vulnerabilities, etc.

  • Integrate with third-party tools (e.g., Nmap, Nessus).

  • Configure exploit modules using saved data.


βš™οΈ Setting Up the Database

1. Check PostgreSQL status

sudo service postgresql status

2. Start PostgreSQL

sudo systemctl start postgresql

3. Initialize the Metasploit database

sudo msfdb init

If you get an error (e.g., NoMethodError), try:

sudo apt update && sudo apt upgrade
sudo msfdb init

4. Check database status

5. Run Metasploit with DB connected


πŸ’¬ Inside msfconsole

πŸ” Check DB Connection

πŸ” Reinitialize DB (if needed)


πŸ“ Workspaces

🧭 Usage


πŸ“₯ Import Nmap Scans

Preferred format: .xml


πŸ”Ž Using db_nmap directly


πŸ’Ύ Exporting Data


πŸ”§ Key Commands

hosts – Manage discovered hosts

services – View open services

creds – Manage credentials

loot – View captured data


Let me know if you want flashcards or quizzes based on this πŸ’‘

Last updated