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

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

缺陷编号:wooyun-2014-076823

漏洞标题:华为荣耀立方智能路由器ws860s 任意文件上传

相关厂商:华为技术有限公司

漏洞作者: livers

提交时间:2014-09-21 16:15

修复时间:2014-11-05 16:16

公开时间:2014-11-05 16:16

漏洞类型:文件上传导致任意代码执行

危害等级:高

自评Rank:15

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-09-21: 细节已通知厂商并且等待厂商处理中
2014-09-25: 厂商已经确认,细节仅向厂商公开
2014-10-05: 细节向核心白帽子及相关领域专家公开
2014-10-15: 细节向普通白帽子公开
2014-10-25: 细节向实习白帽子公开
2014-11-05: 细节向公众公开

简要描述:

版本 B218SP01【2014年8月27日更新】 之前峰会上提到的问题,与华为的人员已交互过,就是可任意上传 ,执行命令,安装apk等。。

详细说明:

system\etc目录下,存在缺陷代码

<?php  
//$target_path = "/";//接收文件目录
$target_path = $_POST['path'];
$count = count($_FILES['file']['name']);
if(!file_exists($target_path))
{
echo "目录不存在或者不正确 " . $target_path . "<br />";
return;
}
for($i=0;$i<$count;$i++){
$target_path_temp = $target_path . basename( $_FILES['file']['name'][$i]);
if(move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path_temp)) {
echo "The file ". basename( $_FILES['file']['name'][$i]). " has been uploaded" . "<br />";
} else{
echo "There was an error uploading the file, please try again!" . $_FILES['file']['error'][$i] . "<br />";
}
}
?>


图片33333333333333333333333333333333.png


可上传任意文件到任意目录
开启了lighthttpd服务 Conf 配置server.document-root = "/"
Bin目录下start.webserver脚本copy文件到/mnt/.lighttpd/目录下
Webserver.sh 766属性

#!/system/bin/sh
cp /system/etc/accept.html /mnt/.lighttpd/
cp /system/etc/accept.php /mnt/.lighttpd/
cp /system/etc/php.ini /mnt/.lighttpd_etc/
cp -r /system/etc/lighttpd/* /mnt/.lighttpd_etc/
chmod 766 /mnt/.lighttpd/*


攻击者可以上传webshell
执行adb 或pm 命令安装apk,am命令执行apk

漏洞证明:

system\etc目录下,存在缺陷代码

<?php  
//$target_path = "/";//接收文件目录
$target_path = $_POST['path'];
$count = count($_FILES['file']['name']);
if(!file_exists($target_path))
{
echo "目录不存在或者不正确 " . $target_path . "<br />";
return;
}
for($i=0;$i<$count;$i++){
$target_path_temp = $target_path . basename( $_FILES['file']['name'][$i]);
if(move_uploaded_file($_FILES['file']['tmp_name'][$i], $target_path_temp)) {
echo "The file ". basename( $_FILES['file']['name'][$i]). " has been uploaded" . "<br />";
} else{
echo "There was an error uploading the file, please try again!" . $_FILES['file']['error'][$i] . "<br />";
}
}
?>


图片33333333333333333333333333333333.png


可上传任意文件到任意目录
开启了lighthttpd服务 Conf 配置server.document-root = "/"
Bin目录下start.webserver脚本copy文件到/mnt/.lighttpd/目录下
Webserver.sh 766属性

#!/system/bin/sh
cp /system/etc/accept.html /mnt/.lighttpd/
cp /system/etc/accept.php /mnt/.lighttpd/
cp /system/etc/php.ini /mnt/.lighttpd_etc/
cp -r /system/etc/lighttpd/* /mnt/.lighttpd_etc/
chmod 766 /mnt/.lighttpd/*


攻击者可以上传php 的webshell
执行adb 或pm 命令安装apk,am命令执行apk

修复方案:

过滤上传文件的类型 和上传文件的路径

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2014-09-25 15:01

厂商回复:

感谢livers的测试。业务部门已经在排查。

最新状态:

暂无