Exploiting the Shadows: How I Uncovered a Command Injection via O
An API endpoint accepted an action parameter and a cloud_type parameter that was passed unsafely to a system command. An attacker could inject commands and exfiltrate files such as /etc/passwd to an external server.
Welcome back to my writeup once again!!! This day, I will share with you how I discovered a Command Injection via OOB!
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, user input from the cloud_type parameter was concatenated directly into a shell command without proper sanitisation or validation.
Impact
An attacker could execute arbitrary system commands remotely, leading to full compromise of the server and access to sensitive files.
What the attacker needed
Access to the API endpoint; ability to send crafted requests
How it was found
- Discover an API subdirectory through brute-force scanning.
- Identify that the API uses an action parameter, indicating an RPC-style design.
- Fuzz the action parameter to find valid values.
- Change the cloud_type parameter from an integer to a character and observe a syntax error.
- Set up an Interactsh server for out-of-band testing.
- Craft a payload using cURL to exfiltrate /etc/passwd to the Interactsh server and confirm command execution.
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.
The web server was building a system command using input from the user without cleaning it first. By sending special characters, the attacker could make the server run extra commands, like reading sensitive files and sending them to a server the attacker controls. This is called command injection.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.