Identifying Boolean-based
Scenario
Target: Aunt Maria's Donuts - Business website Scope: External attacker simulation (no credentials)
Reconnaissance
Registration Page Discovery
Navigate to signup page and observe behavior:
http://<TARGET>/signup.phpWhen entering username, notice:
"The username 'moody' is available"
This suggests database query to check username existence.
Investigating Username Check
Source Code Analysis
Step 1: View page source
The onfocusout event triggers checkUsername() when user leaves field.
Step 2: Find JavaScript reference
Step 3: Analyze signup.js
Key Findings
Endpoint
/api/check-username.php?u=<username>
Method
GET
Response
{"status": "available"} or {"status": "taken"}
Testing for SQLi
Initial Probing
admin
status: taken
maria
status: taken
'
500 Internal Server Error β οΈ
Single quote causes error = potential SQLi!
Backend Query (Assumed)
With ' input:
Confirming Boolean-based SQLi
Injection Test
Payload: ' or '1'='1
Resulting Query:
Since '1'='1' is always true β query returns rows β status: taken
Burp Suite Test
Response:
Confirmation Matrix
' or '1'='1
taken
Always true
' and '1'='2
available
Always false
' or '1'='2
available
False condition
' and '1'='1
Depends on base
True but empty base
What We Know
Vulnerability Confirmed
β Boolean-based Blind SQL Injection
Oracle Responses
status: taken
Query returned rows (TRUE)
status: available
Query returned nothing (FALSE)
Limitations
β No direct data output
β No error messages with data
β Can ask "Yes/No" questions
β Can infer data bit by bit
Attack Strategy
Example Extraction Logic
Next Steps
Boolean-based Exploitation - Data extraction techniques
Writing Custom Scripts - Automating extraction
Quick Reference
Common Boolean Payloads
URL Encoding
'
%27
(space)
%20
=
%3D
--
%2D%2D
Last updated