Metasploit

Start Required Services

  • Metasploit uses PostgreSQL as its database so it needs to be launched first.

$ sudo service postgresql start

Initialise the Metasploit PostgreSQL Database

  • With PostgreSQL up and running, we next need to create and initialize the msf database.

$ sudo msfdb init

Launch msfconsole in Kali

$ sudo msfconsole
msf > db_status
[*] postgresql connected to msf3

Connect MSF to the database if needed

db_connect -y /usr/share/metasploit-framework/config/database.yml

Fix Metasploit Cache Issue

msf > search wordpress
[!] Database not connected or cache not built, using slow search

# Rebuid Cache
# It takes some time for the cache to be rebuild
msf> db_rebuild_cache
services -S 445 -R

Set RHOSTS globally

Export Database

 db_export -f xml /root/msfu/Exported.xml

If you have found that Metasploit does this:

Then run the below to turn it off. dont forget to run the 'save' command after if you want it persistant on next boot.

features set hierarchical_search_table false

Last updated