Skip to content
SQL injection Write-up Advanced

Advanced sqlmap Case Study

A SQL injection vulnerability was found in a parameter that was used in two SQL queries, requiring a payload that would satisfy the first query to produce a boolean true/false result. An attacker could use this to extract data from the database via blind SQL injection.

Peter M Follow

Published on pmnh.site

May 6, 2022 · 6 min read · sqlmapsqliadvanced ·

Peter M (@pmnh_), on pmnh.site

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 user input directly into SQL queries without parameterisation, and the two-query logic created a situation where a boolean-based blind injection was possible.

Impact

An attacker could extract data from the database using blind SQL injection, as demonstrated by the successful sqlmap run.

What the attacker needed

Source code access; ability to send crafted requests

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, allowing an attacker to change the query's meaning. Here, the input was used in two queries, so the attacker had to craft a special value that would make the first query succeed or fail in a way that reveals information. This is called blind SQL injection because the attacker doesn't see the data directly but can ask true/false questions.

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 Peter M

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.