Cmd Injection
Where Would You Find Command Injection
Overview
cat vs type
ping -c vs ping -n #ping -n causes an infinte ping loop in linux
ls vs dir
Injection Operators Table
Operator
URL-Encoded
Executed
Using # (Hash) to Truncate Commands
Non-Blind CMD Inj.

Blind CMD Injection
Identification


Burp Collaborator


Data Exfil via DNS and Burp Collaborator
Bypassing Character Blocklist with ffuf
IFS Bypass No Spaces CmdInjection
Space Bypass Techniques
Technique
Example
OS
Slash (/) Bypass
Linux - Using Environment Variables
Windows CMD
Windows PowerShell
Semicolon (;) Bypass
Character Shifting (Linux)
Command Obfuscation
Quote Insertion (Linux & Windows)
Linux-Only Characters
Windows Caret
Case Manipulation
Windows (case insensitive)
Linux (needs tr)
Reversed Commands
Linux
Windows PowerShell
Base64 Encoded Commands
Linux
Windows PowerShell
Encode for PowerShell from Linux
Obfuscation Tools
Bashfuscator (Linux)
DOSfuscation (Windows)
Newline Bypass
Example Challenge Payload
Netcat Port Parameter Injection
Vulnerable Code Pattern
Exploitation
Key Points
Last updated