metasploit
Initializing database
First time using Metasploit, the database should be initialized by msfdb init
. Check the status by db_status
. This helps organizing and tracking activities for later use. Different workspaces
can be created for different occasions.
The postgresql
service must be started before launching Metasploit in order to connect to the database.
Usage
General
msfconsole
launches Metasploit and msfconsole -q
launches Metasploit quietly. See msfconsole -h
for more options.
After Metasploit is loaded, some of the more general, widely used and self-explanatory commands are:
help
NOTE:
help <command>
will show a help menu for a specific command
search
to find modulesuse
to use a specific module,NOTE: The number from the
#
column in a search result can be used instead of the path
info
will show information of the selected module, or a full path to a payload can be specifiedconnect
to communicate with a host netcat-styleshow options
to see which options toset
when using a moduleset
,unset
,get
to set/unset/get optionsspool <filename>
to log output to<filename>
sessions
to list sessions, usesessions -i <number>
to select a sessionjobs
to list jobsexploit
orrun
to launch a moduleNOTE: Use
run -j
to launch a module as a job
Database commands
Metasploit comes with several commands that utilizes the database capabilities.
Some of them are:
workspaces
to list workspacesservices
to list services in the databasevulns
to list vulnerabilities in the databasedb_nmap
to execute nmap and feed the output directly into the database... and several others. See
help database
for an exhaustive list.
Reference
Full documentation can be found at https://docs.rapid7.com/metasploit/.
Last updated