Skip to content
SQL injection Write-up Intermediate

Unauthorized SQL Injection: Turning ‘No Entry’ Signs into Dol

A login page's ID parameter was vulnerable to time-based SQL injection, allowing an attacker to infer database information by observing delayed responses. The attacker bypassed a WAF and extracted the database name character by character.

Pushkar Bhagat Follow

Published on medium.com

SQL injection vulnerabilities continue to pose a significant risk to web application security. One particularly sophisticated variant is time-based SQL injection, which allows attackers to infer information about the database by manipulating SQL queries.

Pushkar Bhagat, 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 concatenated the ID parameter directly into an SQL query without parameterisation or validation.

Impact

An attacker could extract sensitive database information, such as the database name, despite the presence of a WAF.

What the attacker needed

Access to the login page; WAF bypass required

How it was found

  1. Find an ID parameter in the URL path.
  2. Append a single quote to the ID and observe a MySQL error instead of a 404.
  3. Send a payload with a conditional time delay to confirm execution.
  4. Use a substring function to test each character of the database name with a delay.
  5. Automate character extraction with a script that measures response time.

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. In a time-based attack, the attacker asks the database a yes/no question and watches for a deliberate delay to learn the answer, one character at a time.

What is SQL injection?

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

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.