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:
helpNOTE:
help <command>will show a help menu for a specific command
searchto find modulesuseto use a specific module,NOTE: The number from the
#column in a search result can be used instead of the path
infowill show information of the selected module, or a full path to a payload can be specifiedconnectto communicate with a host netcat-styleshow optionsto see which options tosetwhen using a moduleset,unset,getto set/unset/get optionsspool <filename>to log output to<filename>sessionsto list sessions, usesessions -i <number>to select a sessionjobsto list jobsexploitorrunto launch a moduleNOTE: Use
run -jto launch a module as a job
Database commands
Metasploit comes with several commands that utilizes the database capabilities.
Some of them are:
workspacesto list workspacesservicesto list services in the databasevulnsto list vulnerabilities in the databasedb_nmapto execute nmap and feed the output directly into the database... and several others. See
help databasefor an exhaustive list.
Reference
Full documentation can be found at https://docs.rapid7.com/metasploit/.
Last updated