Page cover

Blind SQL Injection Detection and Exploitation (Cheat Sheet)

  • Time-based Blind SQLi : Time-based SQL Injection is an inferential SQL Injection technique that relies on sending an SQL query to the database which forces the database to wait for a specified amount of time (in seconds) before responding. The response time will indicate to the attacker whether the result of the query is TRUE or FALSE. epending on the result, an HTTP response will be returned with a delay, or returned immediately. This allows an attacker to infer if the payload used returned true or false, even though no data from the database is returned.

HUNT for Blind Sql Injection:

Time Based (GET,POST,PUT)

Apply on:

Search First name, last name, number, any kind of date, Email or Password (register, login, reset password) Any kind of Product,menu,keyword,payment Cookie,User agent,Referer,X-Forwarded-For

Parameter list (regular):

id
cid
pid
page
search
username
name
register
first name
last name
email
pass
password
dir
category
class
register
file
news
item
menu
lang
name
ref
title
time
view
topic
thread
type
date
form
join
main
nav
region
select
report
role
update
query
user
sort
where
params
process
row
table
from
results
sleep
fetch
order
keyword
column
field
delete
string
number
filter

Payload list:

MySQL Blind (Time Based):

Microsoft SQL Server Blind (Time Based):

Postgresql Blind (Time Based):

Oracle Blind (Time Based):

You can replace AND / OR

Generic Time Based SQL Injection Payloads:

If response delay between 5 to 7 Seconds . It means vulnerable.

Detection and exploitation:

1.=payload

Example:

2.=value payload

Example:

Mysql blind sql injection (time based):

MSSQL blind Sql injection (time based):

3.https://redact.com/page/payloadarrow-up-right https://redact.com/page/valuearrow-up-right payload

Example:

4.Blind Sql injection in json:

{payload}

[payload]

{value payload}

Example:

5.Blind Sql injection in Graphql:

{“operationName”:”pages”,”variables”:{“offset”:0,”limit”:10,”sortc”:”name Payload”,”sortrev”:false},”query”:”query pages($offset: Int!, $limit: Int!, $sortc: String, $sortrev: Boolean) {\n pages(offset: $offset, limit: $limit, sortc: $sortColumn, sortReverse: $sortReverse) {\n id\n n\n __typen\n }\n me {\n firstN\n lastN\n usern\n __typen\n }\n components {\n title\n __typen\n }\n templates {\n title\n __typen\n }\n fonts {\n n\n __typen\n }\n partners {\n id\n n\n banners {\n n\n __typen\n }\n __typen\n }\n}\n”}

Example:

6.Http header based (Error based,Time Based):

Referer: https://https://redact.com/408685756payloadarrow-up-right

Cookie: _gcl_au=1.1.2127391584.1587087463paylaod

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87Payload

or

Referer: https://https://redact.com/408685756arrow-up-right payload

Cookie: _gcl_au=1.1.2127391584.1587087463 paylaod

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Payload

X-Forwarded-For: paylaod

Mysql Error Based:

Mysql Error Based

Mssql Error Based:

Mssql Error Based

7.Blind Sql injection exploitation (Manual):

8.Blind Sql injection exploitation via sqlmap:

9.Blind Sql injection WAF bypass (tamper):

And

Quick SQLMap Tamper Suggester: https://github.com/m4ll0k/Atlas

10.Sql detection payload (Generic Error):

11.SQL Injection Auth Bypass:

References :

  • Blind SQL Injection

https://www.owasp.org/index.php/Blind_SQL_Injectionarrow-up-right

  • Testing for SQL Injection (OTG-INPVAL-005)

https://www.owasp.org/index.php/Testing_for_SQL_Injection_(OTG-INPVAL-005)arrow-up-right

  • SQL Injection Bypassing WAF

https://www.owasp.org/index.php/SQL_Injection_Bypassing_WAFarrow-up-right

  • Reviewing Code for SQL Injection

https://www.owasp.org/index.php/Reviewing_Code_for_SQL_Injectionarrow-up-right

  • PL/SQL:SQL Injection

https://www.owasp.org/index.php/PL/SQL:SQL_Injectionarrow-up-right

  • Testing for NoSQL injection

https://www.owasp.org/index.php/Testing_for_NoSQL_injectionarrow-up-right

  • SQL Injection Query Parameterization Cheat Sheet

https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.htmlarrow-up-right

  • SQL detection and Exploitation:

http://www.securityidiots.com/Web-Pentest/SQL-Injectionarrow-up-right https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/SQL%20Injectionarrow-up-right https://github.com/payloadbox/sql-injection-payload-listarrow-up-right https://github.com/Y000o/Payloads_xss_sql_bypass/blob/master/Payloads_xss_sql_bypass.mdarrow-up-right

Last updated