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

[![Dockerfile](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-dockerfile.yml/badge.svg)](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-dockerfile.yml)  [![docker-compose](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-docker-compose.yml/badge.svg)](https://github.com/ahmad4fifz/CVE-2021-44228/actions/workflows/test-docker-compose.yml)

This is the deployment for [Spring Boot app](https://github.com/ahmad4fifz/log4shell-vulnerable-app) with Apache Log4j2 that is vulnerable to [CVE-2021-44228](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228) either using **docker-compose** or **Podman**.

## Description:

Apache Log4j2 <=2.14.1 JNDI features used in configuration, log messages, and parameters do not protect against attacker controlled LDAP and other JNDI related endpoints. An attacker who can control log messages or log message parameters can execute arbitrary code loaded from LDAP servers when message lookup substitution is enabled. From log4j 2.15.0, this behavior has been disabled by default. In previous releases (>2.10) this behavior can be mitigated by setting system property "log4j2.formatMsgNoLookups" to &#8220;true&#8221; or it can be mitigated in prior releases (<2.10) by removing the JndiLookup class from the classpath (example: zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class).

## Deployment:

### Using docker-compose:

```
docker-compose up -d
```

### Using podman: (not tested)

```
sudo podman build -t ahmad4fifz/cve-2021-44228 app/.
sudo podman play kube pods/cve-2021-44228-pod
```

## References:

- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44228
- https://nvd.nist.gov/vuln/detail/CVE-2021-44228
- https://logging.apache.org/log4j/2.x/security.html
- https://www.forescout.com/blog/forescout%E2%80%99s-response-to-cve-2021-44228-apache-log4j-2/
- https://www.docker.com/blog/apache-log4j-2-cve-2021-44228/

## License

Released under [MIT](/LICENSE) by [@ahmad4fifz](https://github.com/ahmad4fifz).
File Snapshot

[4.0K] /data/pocs/e55d06b90774c4e5d4d95d8f9359c9a39cc96461 ├── [4.0K] app │   └── [ 714] Dockerfile ├── [4.0K] data │   └── [ 19M] app.jar ├── [ 610] docker-compose.yml ├── [1.0K] LICENSE ├── [4.0K] pods │   └── [1.1K] cve-2021-44228-pod.yaml ├── [4.0K] proxy │   ├── [ 110] Caddyfile │   └── [ 210] Dockerfile └── [2.0K] README.md 4 directories, 8 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.