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

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

缺陷编号:wooyun-2016-0194106

漏洞标题:某防火墙无需登录命令执行多处

相关厂商:博华网龙

漏洞作者: 路人甲

提交时间:2016-04-09 11:25

修复时间:2016-07-10 09:20

公开时间:2016-07-10 09:20

漏洞类型:命令执行

危害等级:高

自评Rank:20

漏洞状态:厂商已经确认

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2016-04-09: 细节已通知厂商并且等待厂商处理中
2016-04-11: 厂商已经确认,细节仅向厂商公开
2016-04-14: 细节向第三方安全合作伙伴开放(绿盟科技唐朝安全巡航无声信息
2016-06-05: 细节向核心白帽子及相关领域专家公开
2016-06-15: 细节向普通白帽子公开
2016-06-25: 细节向实习白帽子公开
2016-07-10: 细节向公众公开

简要描述:

博华网龙防火墙前台命令执行
其实防火墙跟一体机的代码是不一样的,看了别人漏洞有个frame.php,试了一下 防火墙没有这页面

详细说明:

先来看看验证登陆的函数:

function checkLogin(){
if (!session_is_registered('USER_NAME')) {
//header("location:/index.php");

pJsHead();
print "top.window.location = \"/index.php?key=loginAgain\"";
pJsButtom();
}
//$file_path = $_SERVER['SCRIPT_NAME'];
//$checkLogin_msg = new Message();
//if((strstr(getCurPermission(), 'L')) && (!strstr($file_path, "/log")))
//{
// if(!strstr($file_path, "/user/passwdSet.php"))
// {
// pJsHead();
// print "alert('".$checkLogin_msg->getMsgByCode(I18N_MODULE_MASK+0x0005).$file_path."');";
//print "alert('not permission');";
// print "history.go(-1);";
// pJsButtom();
// }
//}
//if((!strstr(getCurPermission(), 'L')) && (strstr($file_path, "/log")))
//{
// pJsHead();
// print "alert('".$checkLogin_msg->getMsgByCode(I18N_MODULE_MASK+0x0005)."');";
//print "alert('not permission');";
// print "history.go(-1);";
// pJsButtom();
//}

return TRUE;
}


直接return 没有exit
在看看现实文件中怎么用的

<?php
header('content-type:text/html;charset=utf-8');
include_once ("pub/pub.inc");
include_once ("pub/ConfigDocument.inc");
include_once ("i18n/Message.inc");
include_once ("pub/shcall.inc");
include_once ("pub/session.inc");
include_once ("pub/user.inc");
check_session();
checkLogin();
checkApproachUrl();


return一下。。完全没影响。。。。无论return的是什么。。无所谓
所以没有其他特殊认证的文件,就可以未登录访问了
第1: cmd.php 多处

else if($_GET['action'] == "arping")
{
$host = $_GET['host'];
$count = $_GET['count'];
$if = $_GET['ifName'];
$src = $_GET['src'];
system("/usr/bin/arping -I $if -c $count -s $src $host >temp.htm");

if($username)
pSyslog("arping $host $count次", 0);
}
else
{
system("echo \"\" >temp.htm");


GET中多个变量拼接入了system命令
第2:
ip_status.php

$subnet = $_GET['subnet'];
$filename = "/proc/net/ip_traffic/".str_replace("/", "-", $subnet);
$file = "/tmp/ipstatus";
system("cp $filename $file");


filename变量是从外部GET获取的 命令执行
第3:
ip_status.php

if($_GET['action'] == "sort")
{
if($_GET['order'] == "desc")
$cmd = "sort $file -k ".$_GET['key']." -g -b -r -o /tmp/ipstatus_sort";
else
$cmd = "sort $file -k ".$_GET['key']." -g -b -o /tmp/ipstatus_sort";
system($cmd);
$file = "/tmp/ipstatus_sort";
}


外部GET的key传入了命令
第4:
function getTotal($subnet)
{
$filename = "/proc/net/ip_traffic/".str_replace("/", "-", $subnet);
exec("wc -l $filename", $output, $result);
$opt = explode("/", $output[0]);
return $opt[0];
}
$subnet变量外部可控,导致同样带入了exec,命令执行

漏洞证明:

直接把ifconfig写入了1.txt
这东西网上很多,用oshadan搜到了很多,从第一个开始按顺序打了十几个
**.**.**.**//diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
https://**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt
**.**.**.**/diagnostics/1.txt

修复方案:

escape

版权声明:转载请注明来源 路人甲@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:10

确认时间:2016-04-11 09:13

厂商回复:

感谢提交漏洞,我们将尽快处理此问题。

最新状态:

暂无