Analysing Command Detected In Request Body
An attacker sent a request containing a 'whoami' command to a web server, and the server executed it. The attacker could run arbitrary operating system commands on the host.
In this article, we going to analysis the Command injection Alert generated by LetsDefend.io
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application passed unsanitised user input from the request body to a system shell, allowing command execution.
Impact
The attacker could execute arbitrary commands on the host operating system, potentially gaining unauthorised access to sensitive data or disrupting the application.
What the attacker needed
None
How it was found
- The attacker sent a request to the web server containing a 'whoami' command in the request body.
- The server responded with HTTP 200 and different response sizes, indicating the command was executed.
- The attacker repeated the attack with several command injection attempts.
- The command line history on the web server confirmed the commands were executed.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Command injection happens when a web application takes user input and passes it to the operating system without checking it. An attacker can type extra commands into a form field, and the server runs them as if they were normal system commands. Here, the attacker sent a 'whoami' command, which asks the system to reveal the current user name.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.