Skip to content
SQL injection Write-up Intermediate

Find SQL injection with burp Suite scanner

A SQL injection vulnerability was found in the idEntity parameter, but a web application firewall (WAF) blocked exploitation attempts. The attacker bypassed the WAF by injecting through a cookie parameter, allowing full database extraction.

awais0x1 Follow

Published on awais0x1.medium.com

Burp’s scanner has detected a potential SQL injection on one of my bug bounty program target endpoints. According to it, the idEntity parameter of this endpoint is vulnerable.

Awais Nazeer, on awais0x1.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 fails to properly sanitise user input in both the idEntity parameter and the idEntitySelected cookie before using it in SQL queries.

Impact

An attacker could extract arbitrary data from the database, as demonstrated by the successful UNION-based injection through the cookie.

What the attacker needed

Access to the endpoint; ability to send crafted requests

How it was found

  1. Send a request with a boolean-based SQL injection payload in the idEntity parameter and observe different responses.
  2. Run sqlmap with options to target boolean-blind injection and specify a string that indicates failure.
  3. Notice that sqlmap receives empty responses, indicating a WAF is blocking.
  4. Discover the idEntitySelected cookie using Burp ParamMiner.
  5. Manually test the cookie with a time-based injection and see a delay, confirming the WAF does not block it.
  6. Run sqlmap targeting the cookie parameter with appropriate options to exploit the injection.

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 SQL injection lets an attacker insert database commands into a web request. Here, a firewall blocked the usual attack method, but the attacker found another way to send the same commands through a cookie, which the firewall did not check as strictly.

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.