Visible (In-Band)
Command output appears directly in the application’s response. Confirm and move fast, this is the easy case.
Blind
No output returned. Confirm via time delay (
sleep/ping) or out-of-band channel (DNS/HTTP callback to a server you control) instead.Injection Operators
Which operator works (and what gets executed) depends on the shell and on whether the original command succeeds or fails.Confirming Blind Command Injection
When there’s no visible output, a time delay proves execution without needing to see anything back.Filtered Character Bypasses
Spaces are filtered
Spaces are filtered
Forward slash ('/') is filtered
Forward slash ('/') is filtered
Both of these abuse a variable that’s guaranteed to contain a
/ at a known offset, extracting just that character.Semicolon (';') is filtered
Semicolon (';') is filtered
Same idea, pulling a
; out of an environment variable known to contain one.Specific characters are blocked entirely
Specific characters are blocked entirely
tr can shift every character in a string by a fixed offset, letting you construct a blocked character from an allowed one and reverse the shift at execution time (see man ascii for the ordering).Blacklisted Command Name Bypasses
- Quote Insertion
- Variable/Backslash Splitting (Linux only)
- Case Manipulation (Windows only)
- Case Manipulation (Linux)
- Reversed Command
- Base64 Encoding
The shell strips matched quote pairs before executing, so splitting a blocked command name with empty quotes doesn’t change what runs, just defeats a literal string match on the blacklist.
Obfuscation Tools
- Bashfuscator
- Invoke-DOSfuscation
Automates obfuscating a bash payload well beyond what’s practical to hand-craft, useful against signature-based WAF/IDS detection rather than a basic keyword blacklist.
Reverse Shell via Injection
Once you’ve confirmed command injection, chaining into a reverse shell is usually the next move, see the Shells Cheatsheet for the full reference.PHP Code Injection
Distinct from OS command injection, this targets an endpoint that evaluates PHP directly (often viaeval() on user input) rather than shelling out to the OS. Worth testing both when a parameter looks dynamic, the payload and the impact are different even though they often get lumped together.
Quick Reference Tools
Hackviser: Command Injection
Reference used for this page.
HackTricks: Command Injection
Deeper dive into additional bypasses and edge cases.
PayloadsAllTheThings: Command Injection
Large categorized payload and bypass collection.
Commix
Automated command injection detection and exploitation tool.
Bashfuscator
Bash payload obfuscation framework.
Invoke-DOSfuscation
PowerShell/cmd payload obfuscation framework.

