SQL Injection.md
SQL Injection
Here are some quick methods to detect the SQL Injection vulnerability, though the methods are not limited. There are various tricks and tools.
Methods To Find Sqli
1. Using Burpsuite :
2. Using waybackurls and other bunch of tools :
More Details in this source thread https://twitter.com/El3ctr0Byt3s/status/1302706241240731649
3. Using heuristic scan to get hidden parameters :
4. Error generation with untrusted input or special characters :
Post-Methods
1. Finding total number of columns with order by or group by or having :
2. Finding vulnerable columns with union operator :
To go for the methods in more detail, go through portswigger site.
https://portswigger.net/web-security/sql-injection/union-attacks
3. Extracting basic information like database(), version(), user(), UUID() with concat() or group_concat()
1. Database version
2. Database contents
3. Shows version, user and database name
4. Using group_concat() function, used to concat all the rows of the returned results.
4. Accessing system files with load_file(). and advance exploitation afterwards :
5. Bypassing WAF :
1. Using Null byte before SQL query.
2. Using SQL inline comment sequence.
3. URL encoding
4. Changing Cases (uppercase/lowercase)
For more step wise detailed methods, go through the link below.
https://owasp.org/www-community/attacks/SQL_Injection_Bypassing_WAF
5. Use SQLMAP tamper scripts. It helps bypass WAF/IDS/IPS.
Use Atlas. It helps suggesting tamper scripts for SQLMAP.
JHaddix post on SQLMAP tamper scripts.
https://forum.bugcrowd.com/t/sqlmap-tamper-scripts-sql-injection-and-waf-bypass/423
6. Time Delays :
7. Conditional Delays :
Resources and tools that will help gain an upper hand on finding bugs :
Portswigger SQL Injection cheat sheet - https://portswigger.net/web-security/sql-injection/cheat-sheet
HTTPX - https://github.com/encode/httpx
GF patterns - https://github.com/1ndianl33t/Gf-Patterns
GF (Tomnomnom)- https://github.com/tomnomnom/gf
We can also use gau with waybackurls to fetch all urls.
Waybackurls - https://github.com/tomnomnom/waybackurls
Arjun - https://github.com/s0md3v/Arjun
Hakcrawler - https://github.com/hakluke/hakrawler
Author :
Last updated