Metasploit multi/handler
Multi/Handler is a key tool for catching reverse shells, especially when using Meterpreter and staged payloads. Here’s how to use it:
Start Metasploit: Open
msfconsole.Load Multi/Handler: Type
use multi/handlerand press enter.Set Options: Use the
optionscommand to view settings. You need to configure:PAYLOAD: The specific payload for your target.LHOST: The listening address (e.g., yourtun0address on TryHackMe).LPORT: The listening port.
Set these with:
set PAYLOAD <payload> set LHOST <listen-address> set LPORT <listen-port>Start the Listener: Use
exploit -jto run the handler in the background.Receive the Shell: When the staged payload connects, Metasploit sends the rest of the payload, giving you a reverse shell.
Manage Sessions: If the handler is backgrounded, use
sessions 1to bring it to the foreground. If multiple sessions exist, list them withsessionsand select the appropriate one.
Last updated