Select an exploit and a staged payload like windows/meterpreter/reverse_tcp
In this step, you will launch the Metasploit Framework console and select a generic exploit handler. Then, you will configure it to use a common staged payload. We use the exploit/multi/handler module because it's a universal listener, perfect for demonstrating payloads without needing a specific vulnerable target.
First, open your terminal and start the Metasploit console. We'll use the -q (quiet) flag to skip the startup banner.
msfconsole -q
Once you see the Metasploit prompt (msf6 >), you need to select the exploit handler.
use exploit/multi/handler
Next, let's set the payload. A staged payload's name is typically formatted as platform/stage/stager. For example, windows/meterpreter/reverse_tcp means the platform is Windows, the final payload (stage) is Meterpreter, and the initial connection method (stager) is a reverse TCP shell.
Set the staged payload with the following command:
set payload windows/meterpreter/reverse_tcp
You will see a confirmation message payload => windows/meterpreter/reverse_tcp. To be sure, you can view the current configuration.
show options
You will see the payload listed in the options. We don't need to set LHOST or LPORT because we are not actually running the exploit; we are just examining the payload's properties.
msf6 exploit(multi/handler) > show options
Module options (exploit/multi/handler):
Name Current Setting Required Description
---- --------------- -------- -----------
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST yes The listen address (an interface may be specified)
LPORT 4444 yes The listen port
Exploit target:
Id Name
-- ----
0 Wildcard Target