Skip to content
SQL injection Write-up Intermediate

SQLI amd silly WAF

Two endpoints were vulnerable to boolean-based SQL injection, but a web application firewall (WAF) randomly blocked requests, making exploitation unreliable. The author wrote scripts that repeated blocked requests until the server responded, allowing data extraction.

Mahmoud Gamal Follow

Published on mahmoudsec.blogspot.com

July 25, 2018

Mahmoud Gamal, on mahmoudsec.blogspot.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 user input directly into SQL queries without parameterisation, and the WAF's random blocking was a separate operational issue.

Impact

An attacker could extract arbitrary data from the database, though the WAF's random blocking made exploitation slower and required retries.

What the attacker needed

Access to the vulnerable endpoint; ability to send repeated requests

How it was found

  1. Send a single quote in a parameter and observe an error.
  2. Send a boolean condition that is always true and see valid results.
  3. When the WAF returns a maintenance error, repeat the request until the server responds.
  4. Use a script to extract data character by character based on true/false responses.

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 lets an attacker insert database commands into a web form. A WAF is a security filter that tries to block such attacks. Here the WAF sometimes blocked normal requests too, so the attacker simply retried until the real server answered.

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 Mahmoud Gamal

View all

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