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/handler
and press enter.Set Options: Use the
options
command to view settings. You need to configure:PAYLOAD
: The specific payload for your target.LHOST
: The listening address (e.g., yourtun0
address 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 -j
to 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 1
to bring it to the foreground. If multiple sessions exist, list them withsessions
and select the appropriate one.
Last updated