Skip to content

Commit 5200266

Browse files
Update README.md
1 parent 1701502 commit 5200266

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ Samples of log4j library versions to help log4j scanners / detectors (including
44

55
The samples include shaded jars, [uber jars](https://mergebase.com/blog/software-composition-analysis-sca-vs-java-uber-jars/), spring-boot executable jars, jars inside jars, etc.
66

7+
# Why Are \*.zip Files Included In The Samples?
8+
9+
Java treats \*.zip exactly the same as \*.jar, and always has. You really don't want attackers to simmply rename "webapp/WEB-INF/lib/log4j-core-2.9.jar" to "log4j-core-2.9.zip" to defeat your scanner! Don't believe me? Try this:
10+
11+
```
12+
$ wget https://github.com/mergebase/log4j-samples/raw/master/false-hits/log4j-detector-2021.12.16.zip
13+
$ java -jar log4j-detector-2021.12.16.zip
14+
15+
Usage: java -jar log4j-detector-2021.12.16.jar [--verbose] [paths to scan...]
16+
17+
Exit codes: 0 = No vulnerable Log4J versions found.
18+
1 = At least one legacy Log4J 1.x version found.
19+
2 = At least one vulnerable Log4J 2.x version found.
20+
21+
About - MergeBase log4j detector (version 2021.12.16)
22+
Docs - https://github.com/mergebase/log4j-detector
23+
(C) Copyright 2021 Mergebase Software Inc. Licensed to you via GPLv3.
24+
```
25+
(Similarly, this also works: `java -cp log4j-detector-2021.12.16.zip com.mergebase.log4j.Log4JDetector`).
26+
27+
728
# Latest Scan With [log4j-detector](https://github.com/mergebase/log4j-detector)
829

930
```

0 commit comments

Comments
 (0)