1/56
Command Injection
Tricking an application into executing attacker-supplied operating-system commands.
They incorporate untrusted input into commands executed on the server.
Using separators to cause multiple commands to execute from one input.
T1190: Exploit Public-Facing Application.
URL parameters, form fields, cookies, and other accepted input.
GET.
POST.
The privileges of the affected web-server process.
Privilege escalation or lateral movement to other systems.
A semicolon (;).
Ampersand (&).
To see whether an underlying command returns help output.
Whether a Unix shell executes a second command after the first.
Whether output piping can trigger another command.
When the first command exits with nonzero status.
When the first command exits successfully with status 0.
Starts the first command in the background, then runs echo.
Command substitution: execute a command and substitute its output.
Command substitution.
Unix process substitution.
It is available in Linux, Windows Command Prompt, and PowerShell.
Injected commands run, but their output is not shown in the application.
A deliberate delay may show that a command executed.
Observe a request or ICMP packet initiated by the target.
Section 4: Command Stacking.
Collect community-service reports and generate branded shareable images.
First name and last name.
It shows that user input determines a server-side output filename.
composite.
Runs the constructed command on the server.
It is the branding image merged into the uploaded image.
Concatenates strings to build the command line.
A semicolon to separate commands and # to comment out trailing text.
The executing user's identity and group information.
Each request runs independently; shell state does not persist.
The working-directory change ends when that command exits.
/var/www/html.
Fully qualified file or directory paths.
ls /var/www/html
cat /var/www/html/.env
Yes. CLI consoles on routers, printers, and IoT devices may be vulnerable.
A networked digital graphics engine.
TCP 41795.
The console's ping command.
CVE-2018-5553.
The input may be interpreted as an unintended system command.
Static Application Security Testing.
Application source code.
Semgrep.
Snyk and Aikido Security.
Burp Suite and Acunetix Vulnerability Scanner.
Web Application Firewall.
It can mitigate some requests and log attack attempts.
Unusual outbound connections originating from a web server.
Command and control.
Unexpected outbound traffic may indicate attacker command and control.
Do not let untrusted input control server-side command execution.