Blind

circle-info

Blind SQLi occurs when an attacker cannot see the results of their queries directly but can infer information based on the application's behavior and responses.

Boolean-based

circle-info

Boolean-based SQLi occurs when the attacker sends queries that return different responses based on a true/false condition, inferring information from the application's behavior.

Headers

The example below is based on TCM's Practical Bug Bountyarrow-up-right 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).

Figure 1: Inspecting potential SQLi positions.

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.

Figure 2: Validating 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.

Conditional

The example below is based on PostSwigger's Blind SQL injection with conditional responsesarrow-up-right lab.

Burp's Active Scan identifies a potential SQLi flaw (Figure 3).

Figure 3: Identifying & validating an SQLi vulnerability.

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

Figure 4: Using Burp's Comparer to see what differs between the two responses.

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

Figure 5: Performing a Cluster bomb attack with Burp's Intruder.

All we need to do now is to filter out the irrevelant responses and sort them by Payload 1 (Figure 6).

Figure 6: Enumerting the administrator's password.
circle-info

For performing the above task with a custom Python-based script, check the Copy As Python-Requestsarrow-up-right Burp's extension.

Time-based

circle-info

Time-based SQLi occurs when the attacker sends queries that introduce deliberate delays, inferring information based on the time it takes for the application to respond.

The example below is based on PostSwigger's Blind SQL injection with time delaysarrow-up-right lab.

We can start by testing the time-based payloads found on PortSwigger's SQLi cheatsheetarrow-up-right. using string concatenation (Figure 7).

Database
Payload

Oracle

dbms_pipe.receive_message(('a'),10)

Microsoft

WAITFOR DELAY '0:0:10'

PostgreSQL

SELECT pg_sleep(10)

MySQL

SELECT SLEEP(10)

Figure 7: Successfully injecting a time-based payload.

Last updated