Payloads
A payload in Metasploit is the module that works with an exploit to execute post-exploitation code on the target, often resulting in shell/session access.- The exploit bypasses the vulnerable service logic.
- The payload runs on the target and establishes/maintains access.
- Singles
- Stagers
- Stages
/ in the payload name.
Examples:
windows/shell_bind_tcp-> single payload (no staged split)windows/shell/bind_tcp-> staged payload (bind_tcpstager +shellstage)
Singles
Single payloads are self-contained. They include all shellcode needed for the task in one object.- Usually more stable because everything is inline.
- Can become too large for some exploit constraints.
- Execute immediately once delivered.
Stagers
Stagers are compact bootstrap payloads that establish a communication channel from victim to attacker, then prepare delivery of a larger stage.- Designed to be small and reliable.
- Commonly initialize reverse or bind channels.
- Metasploit can auto-select suitable stagers per scenario.
Windows NX vs NO-NX Stagers
- Reliability concerns exist on NX/DEP-protected systems.
- NX-compatible stagers are larger (for example,
VirtualAlloc-style memory handling). - Current defaults generally favor NX and newer Windows compatibility.
Stages
Stages are the larger payload components fetched after stager execution. They provide advanced capabilities such as Meterpreter and VNC injection. Operationally:- A single
recv()may fail for large payloads. - The initial stager can receive an intermediate downloader.
- The intermediate component completes full stage download into memory.
Staged Payloads
A staged payload breaks exploitation into chained functional parts to reduce initial size and improve delivery reliability.Stage0: initial shellcode (for examplereverse_tcp,reverse_https,bind_tcp)Stage1: larger functional component delivered after channel setup
MSF: Staged Payloads
Searching for Payloads
To choose a payload, start with the intended objective on the target. For example, Meterpreter payloads are commonly selected for flexible post-exploitation workflows.MSF: List Payloads
Windows x64 Meterpreter Block (Example)
MSF: Searching for Specific Payloads
Usegrep in msfconsole to reduce large output.
Selecting Payloads
After choosing an exploit module, set a payload by index:set payload <no.>
MSF: Select Payload
Payload Types
The table below lists common payload families for Windows targets.
Other well-known operational payload ecosystems also exist outside default
Metasploit modules. Those are out of scope here.