Skip to content
SQL injection Write-up Intermediate

How I got a $$ by discovring a critical Sql Injecation vulnerability In a Public Bug Bounty…

A booking endpoint returned a MySQL syntax error when a single quote was placed in the code parameter, but only after the request carried an X-Requested-With header. The author then confirmed time-based SQL injection and used sqlmap to dump the database.

a7madhacck Follow

Published on medium.com

Hi Hackers, welcome all to this write up, After a long time from sharing write ups in medium, here is the new write up, about new tecnic, for How I able to Got Full SQL injection in a my target.

Ahmad Yussef, 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 code parameter was concatenated directly into a SQL query without parameterisation, and the error was only surfaced when the request carried the AJAX header.

Impact

An attacker could read arbitrary data from the backend database, including through a WAF that was bypassed by adding the same headers.

What the attacker needed

Reachable booking endpoint; no account needed per text; specific headers required

How it was found

  1. Send a POST request to the booking endpoint with the listed parameters.
  2. Add Origin and Referer headers pointing at the target site and retry the quote test.
  3. Add the X-Requested-With: XMLHttpRequest header to the request.
  4. Place a single quote in the code parameter and observe the database error.
  5. Confirm with a time-based payload that the injection executes.
  6. Run sqlmap with the same headers to enumerate databases.

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 database error message that repeats part of what you typed is a strong sign the input is being pasted straight into a database query. Here the site only showed that error once the request looked like it came from the site's own JavaScript, which is what the X-Requested-With header signals. That let the author read data from the database.

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 a7madhacck

View all

1 more disclosed report, 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.