Complex Attack Types: Sample Scenarios 45
The admin login endpoint accepted a NoSQL injection payload that bypassed authentication and returned a JWT containing the admin's plaintext password. After logging in, the attacker found a JavaScript execution panel that allowed a reverse shell, then escalated privileges via a sudo-allowed binary vulnerable to a buffer overflow.
This new attack scenario, in which we will manipulate the opposing system and continue the adventure we started on the web by infiltrating the internal network structure, will improve your penetration capabilities in many ways.
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 user-supplied JSON directly into a MongoDB query without sanitisation, allowing NoSQL operator injection, and also stored plaintext passwords in JWT claims.
Impact
An attacker could gain admin access, execute arbitrary commands on the server, and escalate to root, fully compromising the system.
What the attacker needed
Network access to the target; no authentication required for initial injection
How it was found
- Send a POST request to /admin with a JSON body containing NoSQL operators to bypass login.
- Decode the returned JWT to obtain the admin's plaintext password.
- Log in to the admin panel using the recovered credentials.
- Use the JavaScript execution panel to run an immediately-invoked function expression and confirm code execution.
- Send a Base64-encoded reverse shell command through the panel to gain a shell.
- Escalate privileges by exploiting a sudo-allowed binary with a buffer overflow.
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 login form was tricked into letting the attacker in without a real password by using a special database query that always evaluates to true. The system then handed back a token that contained the admin's actual password in readable form. Later, a feature that runs code let the attacker take control of the server.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.