ShellShock exploited in the wild: kernel exploit with CnC component
A malicious HTTP request exploited the ShellShock vulnerability in Bash to make the server download and run a binary from an attacker-controlled host. The binary appears to be a kernel exploit with a command-and-control component, allowing remote code execution.
gist.github.com
Published on gist.github.com
Clone this repository at <script src="https://gist.github.com/anonymous/929d622f3b36b00c0be1.js"></script> - Save anonymous/929d622f3b36b00c0be1 to your computer and use it in GitHub Desktop.
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 server passed untrusted HTTP headers (such as User-Agent, Cookie, Host, Referer) into Bash as environment variables without sanitisation, triggering the ShellShock vulnerability.
Impact
An attacker could execute arbitrary commands on the server and deploy a kernel exploit with a command-and-control component, potentially taking full control of the machine.
What the attacker needed
Vulnerable Bash (ShellShock); server passes headers to Bash; attacker-controlled server
How it was found
- Send an HTTP request with a malicious payload in headers like Cookie, Host, or Referer.
- The payload uses wget to download a file from the attacker's server to /tmp/besh.
- Make the downloaded file executable with chmod 777.
- Run the downloaded file.
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.
ShellShock is a bug in Bash, a common command-line program, where specially crafted environment variables can run commands. Here, an attacker sent a request with such a variable, causing the server to download and execute a malicious file. That file then tries to take over the machine and connect back to the attacker.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.