Command Injection
Check List
Methodology
Black Box
s
When a web application includes a terminal, shell, or IDE interface (e.g., Cloud Shell, Dev Console, Admin Terminal), test URL parameters (project, env, config) for command injection.
Access the cloud console or developer environment and identify a terminal or shell interface (via ?show=ide,terminal, ?mode=console, or a "Terminal" tab)
Locate a configurable parameter (project, env, workspace, config) in the URL that influences the terminal session or backend configuration and Change ?project=test and observe the terminal prompt or project name update
Switch to a minimal or IDE-only view (show=ide, view=code) where the parameter is likely processed in a script (Python, Node.js, etc.)
inject a single quote (') into the parameter and reload; if a script syntax error appears in the terminal (SyntaxError, unexpected token), it confirms direct reflection without encoding
Use syntax closure to neutralize the original code
If reflection is in
if 'value':, close with':#to comment out the restIf multi-line, use triple quotes:
''';to close strings. Setproject=asd':#orproject=asd''';print(''to fix syntax and gain control
inject project=asd''';import os;os.system("id");print('' , Reload and check terminal output for uid=....
Blind injection
When you identify an XML-based API endpoint (processing user data like number, email, or mobile), test fields such as <Number> for Blind OS Command Injection using time-delay payloads to confirm execution without visible output. Focus on common XML processing endpoints across enterprise or government web services
Capture a legitimate XML request using Burp Suite when submitting personal data through the web service (profile update, form submission)
Locate the target field (<Number>1234567890123</Number>) that accepts user input and is likely passed to a backend shell command
Send a baseline request with normal input and record the average response time (~56 ms)
Inject a cross-platform time-delay payload into the field using command chaining to force a ~10–15 second delay:
<Number>|ping -n 11 127.0.0.1||ping -c 11 127.0.0.1</Number>Measure the response time; if it increases significantly (~11,876 ms), it confirms blind command execution
White Box
Cheat Sheet
Last updated