如何挖掘sql注入漏洞(二次注入)
时间:2016-11-24 20:17 来源:转载 作者:sqler 点击:次
0x01 前言 讲讲二次注入,不要理解错了,二次注入不是注入两次的意思~ 0x02 什么是二次注入 黑客通过构造数据的形式,在浏览器或者其他软件中提交HTTP数据报文请求到服务端进行处理,提交的数据报文请求中可能包含了黑客构造的SQL语句或者命令信息。 0x03 二次注入的危害 跟sql注入相同(请看第一篇) 0x04 实战案例 这次拿tipask问答系统来讲讲 /htdocs/tipask/model/answer_comment.class.php 在评论的时候,评论内容直接拼接到sql语句中。 [AppleScript] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码 [color=white !important]
[color=white !important]?
找到调用此函数的地方,共两处 1./htdocs/tipask/control/question.php 255行: [AppleScript] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码 [color=white !important]
[color=white !important]?
2./htdocs/tipask/control/answer.php 70行: [AppleScript] [color=rgb(51, 102, 153) !important]纯文本查看 [color=rgb(51, 102, 153) !important]复制代码 [color=white !important]
[color=white !important]?
利用过程。 1,注册账号test\ 2.随便找个问题,评论内容:,user(),111)-- 1 ![]() 3.评论后,立刻出来user()的结果 ![]() 4.查看数据库,user()成功插入 ![]() 0x05 修复建议 过滤危险字符,使用预编译进行增删改查 (责任编辑:蜗蜗侠) |