How a Blue Team Saved a Company in 3 Hours: A Step-by-Step Real I
An unauthenticated file upload endpoint allowed an attacker to upload a PHP webshell and execute commands on the server. The attacker used this access to dump customer data from the database and exfiltrate it over HTTP.
Published on medium.verylazytech.com
Late one Tuesday afternoon, the call came in: βWeβre seeing weird traffic. Is this normal?β Within three hours, a lean but battle-hardened blue team took the company from open wound to absolute control.
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
Impact
The attacker could execute commands on the server and exfiltrate customer data, though privilege escalation attempts failed and no lateral movement was found.
What the attacker needed
Network access to the web app; no authentication required
The fix
The vulnerable endpoint was removed, the code was patched to add authentication and file type checking, credentials were rotated, and firewall rules were tightened.
How it was found
- Notice a spike in outbound traffic from the database server.
- Check firewall logs and see denied outbound connections to foreign IPs.
- Start a packet capture to record suspicious traffic.
- Isolate the server logically via firewall rules and take memory and disk snapshots.
- Search web server logs for POST requests to the upload endpoint and spot a sqlmap user-agent.
- Inspect the upload endpoint code and find it lacks sanitisation and authentication.
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.
A web server had a page that let anyone upload files without checking who they were or what they sent. The attacker uploaded a small program that let them run commands on the server, then used it to copy customer data out of the database and send it away.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.