华为荣耀立方智能路由器ws860s 任意文件上传

admin 2015年6月20日18:22:01评论288 views字数 222阅读0分44秒阅读模式
摘要

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

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

缺陷编号: WooYun-2014-76823

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

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

漏洞作者: livers

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

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

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

危害等级: 高

自评Rank: 15

漏洞状态: 厂商已经确认

漏洞来源:www.wooyun.org ,如有疑问或需要帮助请联系

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目录下,存在缺陷代码

code 区域
<?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 />";
}
}
?>

华为荣耀立方智能路由器ws860s 任意文件上传

可上传任意文件到任意目录

开启了lighthttpd服务 Conf 配置server.document-root = "/"

Bin目录下start.webserver脚本copy文件到/mnt/.lighttpd/目录下

Webserver.sh 766属性

code 区域
#!/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目录下,存在缺陷代码

code 区域
<?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 />";
}
}
?>

华为荣耀立方智能路由器ws860s 任意文件上传

可上传任意文件到任意目录

开启了lighthttpd服务 Conf 配置server.document-root = "/"

Bin目录下start.webserver脚本copy文件到/mnt/.lighttpd/目录下

Webserver.sh 766属性

code 区域
#!/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的测试。业务部门已经在排查。

最新状态:

暂无


漏洞评价:

对本漏洞信息进行评价,以更好的反馈信息的价值,包括信息客观性,内容是否完整以及是否具备学习价值

漏洞评价(共0人评价):

登陆后才能进行评分


评价

  1. 2014-09-21 19:45 | 0x_Jin ( 普通白帽子 | Rank:319 漏洞数:37 | 微博:http://weibo.com/J1n9999 ...)

    1

    livers 大牛 又来发硬件洞了~

  2. 2014-09-22 00:55 | Gale Albatross ( 实习白帽子 | Rank:67 漏洞数:15 | Gale Albatross)

    1

    物联网,智能设备大牛来了。

  3. 2014-09-22 09:44 | HackBraid 华为荣耀立方智能路由器ws860s 任意文件上传 ( 核心白帽子 | Rank:1914 漏洞数:304 | 最近有人冒充该账号行骗,任何自称HackBrai...)

    1

    已关注

  4. 2014-09-25 15:54 | ONE ( 路人 | Rank:12 漏洞数:2 | balabala)

    0

    应该不是web传上去的吧。是adb接口么?

  5. 2014-10-17 11:53 | wefgod ( 核心白帽子 | Rank:1829 漏洞数:183 | 力不从心)

    0

    没有测试成功的例子?

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin