Blind SQL Injection Techniques
What you'll learn: How attackers extract database information when the application doesn't display query results directly, using clever inference methods.
The Core Problem
In classic SQL injection (like union-based attacks), the attacker sees query results directly on the page. But what if the application doesn't display database output at all? Blind SQL injection solves this by turning the database into a yes/no answering machine—extracting data one bit at a time through observable differences in application behavior.
Two Main Approaches
Boolean-Based Blind Injection
The attacker injects conditions that return TRUE or FALSE, observing whether the page changes:
' AND 1=1-- (page loads normally = TRUE)
' AND 1=2-- (page behaves differently = FALSE)
To extract data character by character:
' AND SUBSTRING(username,1,1)='a'--
' AND SUBSTRING(username,1,1)='b'--
If the page loads normally when testing 'a', the first character is 'a'. Repeat for each character position.
Time-Based Blind Injection
When there's no visible difference at all, attackers force the database to delay responses:
' AND IF(1=1, SLEEP(5), 0)-- (5 second delay = TRUE)
' AND IF(1=2, SLEEP(5), 0)-- (no delay = FALSE)
Extract data by testing conditions:
' AND IF(SUBSTRING(password,1,1)='x', SLEEP(5), 0)--
If the response takes 5 seconds, you know the first character is 'x'.
The Analogy
Think of it like playing "20 Questions" with a database that can only nod (boolean) or take long pauses (time-based) instead of speaking. You ask specific yes/no questions until you've reconstructed the entire answer.
Key Takeaway: Blind SQL injection extracts data without direct output by observing boolean differences in page behavior or timing delays, allowing attackers to reconstruct database contents through systematic inference.