Introduction to Blind SQLi
Non-Blind vs Blind SQLi
Non-Blind SQL Injection
The "easy-to-exploit" type where results are returned to the attacker.
Example: Vulnerable search feature
' UNION SELECT table_name, table_schema FROM information_schema.tables;--Result: Tables listed directly in the response.
Blind SQL Injection
Attacker doesn't see query results - must rely on differences in response to infer data.
Example: Login form uses input in query but doesn't return output.
Two Categories of Blind SQLi
Boolean-based (Content-based)
Differences in response (length, content)
Time-based
Response time differences
Note: All time-based techniques work in boolean-based scenarios. The opposite is not possible.
Boolean-Based SQLi
How It Works
Inject query that evaluates to True or False
Observe response differences
Infer data bit by bit
Detection Signals
Longer response
Shorter response
"Email found"
"Email not found"
HTTP 200
HTTP 500
Content differs
Different content
Vulnerable Code Example
Vulnerability Analysis
No sanitization
$_POST['email'] directly concatenated
String interpolation
Input placed inside SQL string
Different responses
"Found" vs "Not found" = oracle
Exploitation Logic
Time-Based SQLi
How It Works
Inject sleep/delay command
Measure response time
Long response = True, Normal = False
Common Delay Functions
MSSQL
WAITFOR DELAY '0:0:5'
MySQL
SLEEP(5)
PostgreSQL
pg_sleep(5)
Oracle
DBMS_LOCK.SLEEP(5)
Example Payload
1=1 (True)
~5 seconds
1=2 (False)
Immediate
Comparison
Detection
Response content/length
Response time
Speed
Faster
Slower
Reliability
More reliable
Network latency issues
Stealth
Less detectable
Delays may trigger alerts
Compatibility
Needs visible difference
Works when no visible diff
When to Use Each
Boolean-Based
β Response differs based on query result β Need faster extraction β Stable network conditions
Time-Based
β No visible response difference β Error messages suppressed β Boolean detection not possible
Key Takeaways
Blind SQLi = No direct output, infer from differences
Boolean-based = Content/length differences
Time-based = Response time differences
Root cause = Same as regular SQLi (unsanitized input)
Exploitation = Requires custom scripts for data extraction
Next Steps
Last updated