Command Injection Bypasses
Command injection filters typically block spaces, slashes, and known command names. Each bypass technique targets a specific filter type. Start with the simplest and move to more complex only if the simpler ones fail. Always confirm baseline injection works first — if whoami executes cleanly, only apply bypasses when a filtered character or keyword blocks further progress.
Space Bypass
Most filters check for literal space (0x20) but miss alternative whitespace and shell expansion:
Slash Bypass
When / is blocked, reconstruct the path from environment variables:
${PATH:0:1} extracts the first character from $PATH, which is always / on a standard Linux system.
Keyword Blacklist Bypass
Filters that match exact command strings miss these shell parsing tricks:
www-data
On Windows CMD, the caret ^ is an escape character and is ignored during execution:
Base64 Encoding
Encodes the entire command so no keywords or special characters appear in the request. The most reliable bypass for aggressive keyword filters:
Y2F0IC9ldGMvcGFzc3dk
Hex and Octal Encoding
Shell-level character encoding for when base64 itself is blocked:
www-data
www-data
Blind Injection Confirmation
When command output is not reflected in the response, confirm execution through timing or out-of-band callbacks:
real 0m5.123s
GET /www-data HTTP/1.1
References
-
PayloadsAllTheThings — Command Injectiongithub.com/swisskyrepo/PayloadsAllTheThings/tree/master/Command%20Injection (opens in new tab)
Bypass payload collection for space, slash, and keyword filters
-
OWASP — Command Injectionowasp.org/www-community/attacks/Command_Injection (opens in new tab)
Core vulnerability pattern and filter evasion context
Was this helpful?
Your feedback helps improve this page.