Skip to content
SQL injection Write-up Advanced

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.

brsdncr Follow

Published on medium.com

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.

Baris Dincer, on medium.com

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

  1. Send a POST request to /admin with a JSON body containing NoSQL operators to bypass login.
  2. Decode the returned JWT to obtain the admin's plaintext password.
  3. Log in to the admin panel using the recovered credentials.
  4. Use the JavaScript execution panel to run an immediately-invoked function expression and confirm code execution.
  5. Send a Base64-encoded reverse shell command through the panel to gain a shell.
  6. 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.

More by brsdncr

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.