Blind SQL Injection
Exploiting Blind SQL Injection
Many modern applications in these days do not return full error messages to the end user. This approach makes SQL Injection more difficult since the attacker is not able to see outcome of injected SQL queries directly. This is why in order to get data from SQL Injections we have to automate the process using custom made scripts or SQLMap.
Extracting data through Blind SQL Injection
Since we cannot get the query output directly we have to choose an approach depending on the Blind SQL Injection type.
Boolean based
When it comes to boolean based SQL Injection the first thing you should do is see the difference depending of the outcome of the following commands:
The output from these commands will enable the script to determine difference between the outcome of inserting commands.
The next step - extracting information. You can extract data from the database using conditions like:
This checks whether the ASCII value of the first character of the database name is greater than 64 (
A
).
Time based
Time based SQL Injection is harder to exploit since we as the attacker have to wait at least one second for result which makes a big difference during exploitation of huge chunks of data.
Confirm that the vulnerability exists (SLEEP command can differ depending on the underlying software)
Sample extraction of database name:
Check if the database starts with letter t. If the statement passes the application will sleep for 5 seconds.
Writing a script
Since we know the logic behind exploiting this type of vulnerability we can begin to create a script for both subtypes of Blind SQL Injection.
Time based
Boolean based
Last updated