Skip to content
SQL injection Write-up Beginner

From Long-Term Hacking to Instant Rewards: Finding SQLi in 3 Minutes Worth $3125

A new feature exposed a PUT request whose 'id' parameter was vulnerable to error-based SQL injection. By adding a single quote the attacker triggered an error, and a time-based payload caused the database to sleep, confirming the injection.

Gökhan Güzelkokar Follow

Published on medium.com

Bounty$3,125 View original

Gökhan Güzelkokar

Gökhan Güzelkokar, 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 built a database query by directly concatenating the user-supplied 'id' parameter without parameterisation or escaping.

Impact

An attacker could run arbitrary SQL queries against the database, potentially reading or modifying data.

What the attacker needed

Access to the private program; a new feature in staging

How it was found

  1. Notice a new feature in the staging environment.
  2. Use the new feature and observe a PUT request.
  3. Add a single quote to the 'id' parameter and see a database error.
  4. Send a time-based payload and observe the database sleep for 12 seconds.

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.

SQL injection is when user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, adding a single quote to an 'id' value broke the query and produced an error, showing the input was not safely handled. A time-based test then made the database pause, proving the attacker could run their own database commands.

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 Gökhan Güzelkokar

View all

3 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.