Staged vs. Stageless Payloads
Last updated
Last updated
Staged
payloads create a way for us to send over more components of our attack. We can think of it like we are "setting the stage" for something even more useful. Take for example this payload linux/x86/shell/reverse_tcp
. When run using an exploit module in Metasploit, this payload will send a small stage
that will be executed on the target and then call back to the attack box
to download the remainder of the payload over the network, then executes the shellcode to establish a reverse shell. Of course, if we use Metasploit to run this payload, we will need to configure options to point to the proper IPs and port so the listener will successfully catch the shell. Keep in mind that a stage also takes up space in memory which leaves less space for the payload. What happens at each stage could vary depending on the payload.
Stageless
payloads do not have a stage. Take for example this payload linux/zarch/meterpreter_reverse_tcp
. Using an exploit module in Metasploit, this payload will be sent in its entirety across a network connection without a stage. This could benefit us in environments where we do not have access to much bandwidth and latency can interfere. Staged payloads could lead to unstable shell sessions in these environments, so it would be best to select a stageless payload. In addition to this, stageless payloads can sometimes be better for evasion purposes due to less traffic passing over the network to execute the payload, especially if we deliver it by employing social engineering. This concept is also very well explained by Rapid 7 in this blog post on .
Now that we understand the differences between a staged and stageless payload, we can identify them within Metasploit. The answer is simple. The name
will give you your first marker. Take our examples from above, linux/x86/shell/reverse_tcp
is a staged payload, and we can tell from the name since each / in its name represents a stage from the shell forward. So /shell/
is a stage to send, and /reverse_tcp
is another. This will look like it is all pressed together for a stageless payload. Take our example linux/zarch/meterpreter_reverse_tcp
.
It is similar to the staged payload except that it specifies the architecture it affects, then it has the shell payload and network communications all within the same function /meterpreter_reverse_tcp
. For one last quick example of this naming convention, consider these two windows/meterpreter/reverse_tcp
and windows/meterpreter_reverse_tcp
.
The former is a Staged
payload. Notice the naming convention separating the stages. The latter is a Stageless
payload since we see the shell payload and network communication in the same portion of the name. If the name of the payload doesn't appear quite clear to you, it will often detail if the payload is staged or stageless in the description.