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.
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.
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
- Send a POST request to the booking endpoint with the listed parameters.
- Add Origin and Referer headers pointing at the target site and retry the quote test.
- Add the X-Requested-With: XMLHttpRequest header to the request.
- Place a single quote in the code parameter and observe the database error.
- Confirm with a time-based payload that the injection executes.
- 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.