目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

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

来源
关联漏洞
标题: Apache Log4j 代码问题漏洞 (CVE-2021-44228)
Description:Apache Log4j是美国阿帕奇(Apache)基金会的一款基于Java的开源日志记录工具。 Apache Log4J 存在代码问题漏洞,攻击者可设计一个数据请求发送给使用 Apache Log4j工具的服务器,当该请求被打印成日志时就会触发远程代码执行。
Description
Detect and fix log4j log4shell vulnerability (CVE-2021-44228)
介绍
# log4fix
This tool is to detect and fix the log4j log4shell vulnerability (CVE-2021-44228) by looking and removing the JndiLookup class from .jar/.war/.ear files with zero dependencies for free.
This tool has been tested on:
    - Linux 32bit and 64 bit
    - Windows 32 bit and 64 bit
    - OpenBSD 64 bit

This tool is written in the Go programming language which means zero dependencies and standalone binaries which will run everywhere.

## Install
Download binaries (Windows, Linux, Darwin, OpenBSD) here https://github.com/nanitor/log4fix/releases/tag/v4.2.0

## Usage

[![asciicast](https://asciinema.org/a/kQVtPYoz07W9MF8PidmYxQluy.svg)](https://asciinema.org/a/kQVtPYoz07W9MF8PidmYxQluy)

Scan file for vulnerability
```
log4fix detect </path/to/file.war>
```

Scan file for vulnerability and remove the vulnerable class.
```
log4fix fix </path/to/file.war> --overwrite
```

Scan single directory for vulnerability.
```
log4fix scan </path/to/dir>
```

Scan multiple directories for vulnerability.
```
log4fix scan </path/to/dir/1> </path/to/dir/2>
```

Scan directory for vulnerability and remove the vulnerable files. Note, this command overwrites the war/ear/jar files containing the vulnerable class that are found.
```
log4fix scan </path/to/dir> --fix
```

Scan directory for vulnerability and write the vulnerable jar/ear/war files found into the file supplied.
```
log4fix scan </path/to/dir> --output </path/to/text/file.txt>
```

We recommend taking a backup of the files prior to overwriting them.
On Windows, it may be necessary to stop the service prior to applying the fix.
Once the fix has been applied, the service should be restarted.

## Build from source
```
go build
```

## Note:
This is functionally equivalent to the recommended remediation of
```
zip -q -d log4j-core-*.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
```
except it can also go into other .jar/.war/.ear files and look for `log4j-core-*.jar` file in there and
removing the JndiLookup class from there.

And of course works on all platforms.
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →