Blind SQL Injection
Observe differences within HTTP response in terms of headers, content or bytes
There are more techniques to detect blind SQL injection using:
conditional errors (trigger an error in conditional statements),
out of band interactions with data exfiltration.
Conditional Statements
Detect number of columns
A' OR 1=1 ORDER BY 1 -- commentDetect database
A' AND TRUE=(SELECT @@version) -- comment MySQL or MSSQL
A' AND 1=(SELECT 1 LIMIT 1) -- comment pure MySQL syntax
A' AND TRUE=(SELECT version()) -- comment pure PostgreSQL function
A' AND TRUE=(SELECT version FROM v$instance) -- comment Oracle v$viewDetect table
You need to know a table name, guess it, find it in the code (open source) or query the data dictionary using automation tools. Confirm the table name by the following query (MySQL)
Specific data record (username)
In order to query a password from the application "users" table, match a record within the table.
Password length
Query data - Burp Suite Intruder
Automate the attack in Burp Suite - Intruder, define an alphabet, and iterate over password character positions in the SUBSTRING('other dbs',1,1) or SUBSTR('oracle',1,1) functions.
Conditional Errors
When error response is the only observation you have, raise an error on a positive match using conditional SQL statements (CASE, IF). First, detect the database platform.
Detect database
using string concetination functions to determine the database platform
for example, extend a string value in a where close using || following an empty string (this string does not change however, teh database needs to evaluate the concetination operator.
Detect table
Conditional statements
Test the coditional statement with zero division (CASE WHEN (1=1) and (1=2)
Specific data record (username)
Password length
Query data - Burp Suite Intruder
Time Delays
Detect database
Conditional time delays
Detect table
Password length
Query data - Burp Suite Intruder
Out of Band
DNS lookup
DNS lookup with data exfiltration
Last updated
Was this helpful?