Commands

msfconsole    # to start Metasploit
help          # lists all available commands and guidance   
help set      # replace 'set' with any function to get help e.g. help search 
#tab completion is a thing here too
history       # let's you see the history of commands you typer earlier
ctrl+c        # to stop the process
ls            # lists the contents of metasploit folder

search        # to search for exploits, vulns, payloads...
use #         # to use the exploit, vulns...
show options  # to see the options of selected item
back          # to leave the item
info          # to see all the information on the item
set           # to see any paramater, e.g. set rhosts 10.10.321.123
setg          # to set this parameter for all modules. e.g. setg rhosts 10.10... will set this IP for all the modules
unsetg        # unsets the value across all modules
unset all     # unsets all parameters
unset         # unsets a specific parameter that you provide

exploit       # runs the exploit
exploit -z    # runs the exploit in the background
check         # some modules support will let you check if system is vulnerable without exploiting it.
background    # let's you background the session
ctrl+z        # let's you background the session
sessions      # shows you existing sessions
sessions -i 1 # lets you interact with session #1

nmap          # use nmap from metasploit

search portscan # to scan open ports on the target system and network

Last updated