Code Monkey home page Code Monkey logo

cve-2021-44228-scanner's Introduction

Logpresso Logo

log4j2-scan is a single binary command-line tool for CVE-2021-44228 vulnerability scanning and mitigation patch. It also supports nested JAR file scanning and patch. It also detects CVE-2021-45046 (log4j 2.15.0), CVE-2021-45105 (log4j 2.16.0), CVE-2021-44832 (log4j 2.17.0), CVE-2021-4104, CVE-2019-17571, CVE-2017-5645, CVE-2020-9488, CVE-2022-23302, CVE-2022-23305, CVE-2022-23307 (log4j 1.x), and CVE-2021-42550 (logback 0.9-1.2.7) vulnerabilities.

Log4j Risk Management

You can integrate log4j2-scan with Logpresso Watch service for reporting and patch management. Visit https://logpresso.watch for details.

Download

Build

How to use

Just run log4j2-scan.exe or log4j2-scan with target directory path. The logpresso-log4j2-scan.jar should work with JRE/JDK 7+

--fix option is supported for following vulnerabilities:

  • Log4j v2
    • CVE-2021-44228 (JndiLookup)
    • CVE-2021-45046 (JndiLookup)
  • Log4j v1
    • CVE-2021-4104 (JMSAppender)
    • CVE-2019-17571 (SocketServer)
    • CVE-2020-9488 (SMTPAppender)
    • CVE-2022-23302 (JMSSink)
    • CVE-2022-23305 (JDBCAppender)
    • CVE-2022-23307 (chainsaw package)

--fix option doesn't mitigate following vulnerabilities:

  • Log4j v2
    • CVE-2021-44832 (JDBCAppender)
    • CVE-2021-45105 (DoS)
    • CVE-2017-5645 (SocketServer)
    • CVE-2020-9488 (SMTPAppender)
  • Logback
    • CVE-2021-42550

Usage

Logpresso CVE-2021-44228 Vulnerability Scanner 3.0.1 (2022-02-13)
Usage: log4j2-scan [--scan-log4j1] [--fix] target_path1 target_path2

-f [config_file_path]
        Specify config file path which contains scan target paths.
        Paths should be separated by new line. Prepend # for comment.
--scan-log4j1
        Enables scanning for log4j 1 versions.
--scan-logback
        Enables scanning for logback CVE-2021-42550.
--scan-zip
        Scan also .zip extension files. This option may slow down scanning.
--zip-charset
        Specify an alternate zip encoding other than utf-8. System default charset is used if not specified.
--fix
        Backup original file and remove JndiLookup.class from JAR recursively.
        With --scan-log4j1 option, it also removes JMSAppender.class, SocketServer.class, SMTPAppender.class, SMTPAppender$1.class,
        JMSSink.class, JDBCAppender.class, and all classes of org.apache.log4j.chainsaw package
--force-fix
        Do not prompt confirmation. Don't use this option unless you know what you are doing.
--restore [backup_file_path]
        Unfix JAR files using zip archived file.
--backup-path [zip_output_path]
        Specify backup file path.
--backup-ext [zip]
        Specify backup file extension. zip by default.
        If --backup-path is specified, this option is ignored.
--all-drives
        Scan all drives on Windows
--drives c,d
        Scan specified drives on Windows. Spaces are not allowed here.
--no-symlink
        Do not detect symlink as vulnerable file.
--exclude [path_prefix]
        Path prefixes of directories whose absolute path starts with the specified value will be excluded.
        Does not support relative paths. You can specify multiple --exclude [path_prefix] pairs
--exclude-config [config_file_path]
        Specify exclude path prefix list in text file. Paths should be separated by new line. Prepend # for comment.
--exclude-pattern [pattern]
        Exclude specified paths of directories by pattern. Supports fragments.
        You can specify multiple --exclude-pattern [pattern] pairs (non regex)
--exclude-file-config [config_file_path]
        Specify exclude file path list in text file. Paths should be separated by new line. Prepend # for comment.
--exclude-fs nfs,tmpfs
        Exclude paths by file system type. nfs, nfs3, nfs4, afs, cifs, autofs,
        tmpfs, devtmpfs, fuse.sshfs, smbfs and iso9660 is ignored by default.
--api-key [key]
        Send reports to Logpresso Watch service.
--http-proxy [addr:port]
        Send reports via specified HTTP proxy server.
--syslog-udp [host:port]
        Send reports to remote syslog host.
        Send vulnerable, potentially vulnerable, and mitigated reports by default.
--syslog-level [level]
        Send reports only if report is higher or equal to specified level.
        Specify alert for vulnerable and potentially vulnerable reports.
        Specify info for vulnerable, potentially vulnerable, and mitigated reports.
        Specify debug for vulnerable, potentially vulnerable, mitigated, and error reports.
--syslog-facility [code]
        Default value is 16 (LOCAL0). Facility value must be in the range of 0 to 23 inclusive.
--rfc5424
        Follow RFC5424 The Syslog Protocol strictly.
--report-csv
        Generate log4j2_scan_report_yyyyMMdd_HHmmss.csv in working directory if not specified otherwise via --report-path [path]
--report-json
        Generate log4j2_scan_report_yyyyMMdd_HHmmss.json in working directory if not specified otherwise via --report-path [path]
--report-patch
        Report also patched log4j file.
--report-path
        Specify report output path including filename. Implies --report-csv.
--report-dir
        Specify report output directory. Implies --report-csv.
--no-empty-report
        Do not generate empty report.
--csv-log-path
        Specify csv log file path. If log file exists, log will be appended.
--json-log-path
        Specify json log file path. If log file exists, log will be appended.
--old-exit-code
        Return sum of vulnerable and potentially vulnerable files as exit code.
--debug
        Print exception stacktrace for debugging.
--trace
        Print all directories and files while scanning.
--silent
        Do not print progress message.
--throttle
        Limit scan files per second.
--help
        Print this help.

On Windows

log4j2-scan [--fix] target_path

On Linux

./log4j2-scan [--fix] target_path

On UNIX (AIX, Solaris, and so on)

java -jar logpresso-log4j2-scan-3.0.1.jar [--fix] target_path

If you add --fix option, this program will copy vulnerable original JAR file to .bak file, and create new JAR file without org/apache/logging/log4j/core/lookup/JndiLookup.class entry. All .bak files are archived into the single zip file which is named by log4j2_scan_backup_yyyyMMdd_HHmmss.zip, then deleted safely. In most environments, JNDI lookup feature will not be used. However, you must use this option at your own risk. You can easily restore original vulnerable JAR files using --restore option.

Depending the Operating System:

  • Windows: It is necessary to shutdown any running JVM process before applying patch due to lock files. Start affected JVM process after fix.
  • Linux/macOS: Apply patch, restart the JVM after

If you want to automate patch job, use --force-fix option. With this option, this program will no longer prompt for confirmation.

(mitigated) tag will be displayed if org/apache/logging/log4j/core/lookup/JndiLookup.class entry is removed from JAR file.

If you add --trace option, this program will print all visited directories and files. Use this option only for debugging.

On Windows:

CMD> log4j2-scan.exe D:\tmp
[*] Found CVE-2021-44228 vulnerability in D:\tmp\elasticsearch-7.16.0\bin\elasticsearch-sql-cli-7.16.0.jar, log4j 2.11.1
[*] Found CVE-2021-44228 vulnerability in D:\tmp\elasticsearch-7.16.0\lib\log4j-core-2.11.1.jar, log4j 2.11.1
[*] Found CVE-2021-44228 vulnerability in D:\tmp\flink-1.14.0\lib\log4j-core-2.14.1.jar, log4j 2.14.1
[*] Found CVE-2021-44228 vulnerability in D:\tmp\logstash-7.16.0\logstash-core\lib\jars\log4j-core-2.14.0.jar, log4j 2.14.0
[*] Found CVE-2021-44228 vulnerability in D:\tmp\logstash-7.16.0\vendor\bundle\jruby\2.5.0\gems\logstash-input-tcp-6.2.1-java\vendor\jar-dependencies\org\logstash\inputs\logstash-input-tcp\6.2.1\logstash-input-tcp-6.2.1.jar, log4j 2.9.1
[*] Found CVE-2021-44228 vulnerability in D:\tmp\solr-7.7.3\solr-7.7.3\contrib\prometheus-exporter\lib\log4j-core-2.11.0.jar, log4j 2.11.0
[*] Found CVE-2021-44228 vulnerability in D:\tmp\solr-7.7.3\solr-7.7.3\server\lib\ext\log4j-core-2.11.0.jar, log4j 2.11.0
[*] Found CVE-2021-44228 vulnerability in D:\tmp\solr-8.11.0\contrib\prometheus-exporter\lib\log4j-core-2.14.1.jar, log4j 2.14.1
[*] Found CVE-2021-44228 vulnerability in D:\tmp\solr-8.11.0\server\lib\ext\log4j-core-2.14.1.jar, log4j 2.14.1

Scanned 5047 directories and 26251 files
Found 9 vulnerable files
Completed in 0.42 seconds

How it works

Run in 5 steps:

  1. Find all .jar, .war, .ear, .aar, .rar, .nar files recursively.
  2. Find META-INF/maven/org.apache.logging.log4j/log4j-core/pom.properties entry from JAR file.
  3. Read groupId, artifactId, and version.
  4. Compare log4j2 version and print vulnerable version.
  5. If --fix option is used, backup vulnerable file and patch it.
    • For example, original vulnerable.jar is copied to vulnerable.jar.bak
  6. Archive all backup files into the zip file log4j2_scan_backup_yyyyMMdd_HHmmss.zip, then delete .bak files.

Exit code for automation

  • -1 failed to run
  • 0 for clean (No vulnerability)
  • 1 for found
  • 2 for some errors

Tool Integrations

Contact

If you have any question or issue, create an issue in this repository.

About Logpresso

Logpresso is a leading company in the AI and big data industry located in South Korea. Logpresso provides SIEM, SOAR, Log management, and FDS solutions with its own big data platform.

cve-2021-44228-scanner's People

Contributors

8con avatar abcbarryn avatar abnqeut avatar afrouper avatar arykov avatar axel3rd avatar chkemper avatar fandigunawan avatar jgstew avatar k3it avatar nedjitef avatar pinacoelho avatar pse1202 avatar strawgate avatar wywywywy avatar xeraph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cve-2021-44228-scanner's Issues

[Question] Any chance to have RHEL 6 ELS supported?

Dear,

As per RHEL 6 glibc version is at 2.12, the current script complains about the down-level and won't run.

Is there any chance to incorporate RHEL 6 as well?

RHEL 6 ELS is still supported till June 30 2024.

Many thanks

Laszlo Pinter

Does not find vulnerable jar in Spring Boot Fat Jar

Thanks guys, this is a great addition to mitigate this vulnerability. However, it does not find vulnerable .jar files in Spring Boot Fat Jars.

It does find the vulnerable .jar, though, when the Spring Boot Jar is exploded/unzipped.

[*] Found CVE-2021-44228 vulnerability in path-to\...\edge-service-1.38\BOOT-INF\lib\log4j-core-2.11.2.jar, log4j 2.11.2

Scanned 34 directories and 287 files
Found 1 vulnerable files
Completed in 0,25 seconds

Could you add support for jars built with the Spring Boot Maven Plugin? Documentation is here: https://docs.spring.io/spring-boot/docs/2.5.6/maven-plugin/reference/htmlsingle/#packaging.layers

Description of binaries generation

May I ask you to describe the steps done to generate Windows and Linux binaries in Releases - or point to a place where it is described if I missed it?

[suggestion] windows all servers drive + output to csv format

Hi,

it would be great if we can specify the drives like:
log4j2-scan.exe --drives c,d,e
log4j2-scan.exe --drives all
and also export the finding to csv results like:
log4j2-scan.exe --export file.csv --vulnerable: all,onlyyes
and results like
hostname;path;vulnerable(yes/no)

something like this

scan error: zip END header not found

I used this very useful tool on many servers, all with basically the same basic software installed.

Immediately after starting its spams the output with

...
scan error: zip END header not found
scan error: zip END header not found
scan error: zip END header not found
scan error: zip END header not found
scan error: zip END header not found
scan error: zip END header not found
...

Any Idea where I could look in order to fix this?

System Info

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

Index 2 out of bounds for length 2

I have vulnerable jar in path "C:\Program Files\FlexNet Operations\release\flexnet.ear\flexnet.war\WEB-INF\lib", but scanner returns
error: Index 2 out of bounds for length 2

Scanned 1 directories and 160 files
Found 0 vulnerable files
Completed in 0.03 seconds

OS is windows server 2012 R2, if that helps

remote check

is it possible run the tool remotely on all my network pc? or only possible manually directly on the pc?

the jar file has others, not only log4j-core

Hi

I found if the jar has others, not only log4j-core

BOOT-INF/lib/log4j-to-slf4j-2.14.1.jar
BOOT-INF/lib/log4j-api-2.14.1.jar

this scan doesn't report anything

Scanned 21 directories and 17 files
Found 0 vulnerable files
Completed in 0.61 seconds

does this scan tool design for log4j-core only?

Bug in version check; does not detect e.g. 2.13.3

Some vulnerable versions, like log4j-core 2.13.3, are not found.

The version check, (major == 2 && minor <= 14 && patch <= 1), is wrong. It should be (major == 2 && (minor < 14 || (minor == 14 && patch <= 1))).

WAR support

Can we expand the file traversal to unpack war files as well?

		if (path.toLowerCase().endsWith(".jar") || path.toLowerCase().endsWith(".war"))

Parameter --fix => Backup jar should be moved to another directory.

Hi,

After using the fix parameter the class loader will find the bak file, created in the same directory, and could load the vulnerable jar again (not deterministic!). We have to ensure to move or remove the backed up files before restarting your Java service/application.

I will try to add a pull request for this.

With regards,
Michael

GLIBC_2.14 incompatibility

The machine is old enough that display this issue, RHEL 6.10 but seems critical at the moment.

./log4j2-scan: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./log4j2-scan)

Cant start .exe on Server

Hey,

for some reason i have a problem on servers to start the .exe.
Im getting this error.

image

Are there any logs i can share?

Possible bug when BufferedReader/InputStreamReader failes

The following code snippet looks dangerous to me. When an exception is thrown the code continues in line 58, which leads to the fix being applied even though the user didn't approve by passing y.

if (fix) {
try {
System.out.print("This command will remove JndiLookup.class from log4j2-core binaries. Are you sure [y/N]? ");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String answer = br.readLine();
if (!answer.equalsIgnoreCase("y")) {
System.out.println("interrupted");
return;
}
} catch (Throwable t) {
System.out.println("error: " + t.getMessage());
}
}
File f = new File(path);
new Log4j2Scanner().run(f, fix);
}

I am going to open a pr with a possible fix.

Doesn't work at SunOS

Hi,
I downloaded the file for Any OS, and try to run it on the SunOS server.
But it didn't run, and just twinkle the cursor at the next line.

So I tried this command,

# java -jar logpresso-log4j2-scan-1.2.0.jar /path
# _
(โ†‘ the cursor's twinkle)

Btw, I checked the "java" command works.
Is it any bug or sth?

Thanks.

Not all all found as vulnerable

Hello,

I did a PoC test for our environment using an older sqldeveloper lib folder.
It found only 1 out of 3 files to be vulnerable

I've extracted and checked the pom.properties for 3 files. In the screenshot below added the pom.properties content

  • log4j-1.2-api.jar (not found)
  • log4j-api.jar (not found)
  • log4j-core.jar (found)
    image

I went with the assumption that it might only print the latest one, which was not the case. After i deleted the log4j-core.jar file there was no vulnerability found. Is there maybe within the command something wrongfully configured ?

image

[QUEOSTION] Scan whole server

Hi there,

im not that deep into Open Suse etc. running the Scan from /tmp with the command "./log4j2-scan /" should scan every directory/file on the server correct ?

Ignore $RECYCLE.BIN on Windows

Hi,

woudl it be possible to ignore the $RECYCLE.BIN on every drive when using the tool on Windows ?

When there is a log4l file in that folder for sure its not used so thats a false positive.

Scan RAR files

RAR (Resource adapter ARchive) is a file type defined in Java EE spec, and it may contains Java code.

	private boolean isScanTarget(String path) {
		String loweredPath = path.toLowerCase();
		if (scanZip && loweredPath.endsWith(".zip"))
			return true;

		// ear = Java EE archive, aar = Android archive
		return loweredPath.endsWith(".jar") || loweredPath.endsWith(".war") || loweredPath.endsWith(".ear")
				|| loweredPath.endsWith(".aar");
	}

Please add || loweredPath.endsWith(".rar") to scan RAR files.

Needs to handle "Nested Nested" jar files?

Hi,
It appears as though the software only handles one level of nested jar files.
We have a number of jar files (eg like those that come with "Matlab") that have nested jar files which also have nested jar files within.
Is it possible to make it recursively check all nested jar files?

Scanner is still treating symlinks as jar files on linux

I did update the previous issue I opened about symlinks, but that issue has already been closed and I don't think the update I made has been seen there. I have pulled, rebuilt, and re-tested. There are still issues with handling symlinks to jar files.

I have a bash script I'm using to cleanup, build, setup, and test. I'm looking for a way to attach it here, if I find one I'll do so. I don't have maven, tried installing it but it fails to build the scanner with maven plugin errors I don't want to spend time right now to resolve. . My java experience is from 2002 so I'm resorting to bash scripts for build and test.

find test -ls
  1049724      4 drwxrwxr-x   4 joi      joi          4096 Dec 14 10:33 test
  1053429      4 drwxrwxr-x   2 joi      joi          4096 Dec 14 10:45 test/dir\ with\ spaces
  1049569   1556 -rw-r--r--   1 joi      joi       1590537 Sep 10  2019 test/dir\ with\ spaces/log4j-core.jar
  1053443      4 drwxrwxr-x   2 joi      joi          4096 Dec 14 10:45 test/test-symlink
  1051275   1556 -rw-r--r--   1 joi      joi       1590537 Sep 10  2019 test/test-symlink/log4j-core.jar
  1053445      0 lrwxrwxrwx   1 joi      joi            14 Dec 14 10:34 test/test-symlink/mytestlink.jar -> log4j-core.jar

# verify bad jar is detected twice
java -jar scanner.jar test
Logpresso CVE-2021-44228 Vulnerability Scanner 1.3.0 (2021-12-15)
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/dir with spaces/log4j-core.jar, log4j 2.11.2
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/log4j-core.jar, log4j 2.11.2
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/mytestlink.jar, log4j 2.11.2

Scanned 3 directories and 3 files
Found 3 vulnerable files
Completed in 0.03 seconds

Running with --fix creates a .bak file for all jars it thinks it detected, including the symlinks.

joi@desktop2004:~/working-dir/CVE-2021-44228-Scanner$ java -jar scanner.jar --fix test
This command will remove JndiLookup.class from log4j2-core binaries. Are you sure [y/N]? y
Logpresso CVE-2021-44228 Vulnerability Scanner 1.3.0 (2021-12-15)
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/dir with spaces/log4j-core.jar, log4j 2.11.2
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/log4j-core.jar, log4j 2.11.2
[*] Found CVE-2021-44228 vulnerability in /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/mytestlink.jar, log4j 2.11.2

Fixed: /home/joi/working-dir/CVE-2021-44228-Scanner/test/dir with spaces/log4j-core.jar
Fixed: /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/log4j-core.jar
Fixed: /home/joi/working-dir/CVE-2021-44228-Scanner/test/test-symlink/mytestlink.jar

Scanned 3 directories and 3 files
Found 3 vulnerable files
Fixed 3 vulnerable files
Completed in 1.12 seconds
joi@desktop2004:~/working-dir/CVE-2021-44228-Scanner$ find test -ls
  1049724      4 drwxrwxr-x   4 joi      joi          4096 Dec 14 10:33 test
  1053429      4 drwxrwxr-x   2 joi      joi          4096 Dec 14 10:48 test/dir\ with\ spaces
  1049569   1572 -rw-r--r--   1 joi      joi       1607573 Dec 14 10:48 test/dir\ with\ spaces/log4j-core.jar
  1051277   1556 -rw-rw-r--   1 joi      joi       1590537 Dec 14 10:48 test/dir\ with\ spaces/log4j-core.jar.bak
  1053443      4 drwxrwxr-x   2 joi      joi          4096 Dec 14 10:48 test/test-symlink
  1051275   1572 -rw-r--r--   1 joi      joi       1607573 Dec 14 10:48 test/test-symlink/log4j-core.jar
  1053445      0 lrwxrwxrwx   1 joi      joi            14 Dec 14 10:34 test/test-symlink/mytestlink.jar -> log4j-core.jar
  1053427   1572 -rw-rw-r--   1 joi      joi       1607573 Dec 14 10:48 test/test-symlink/mytestlink.jar.bak
  1052166   1556 -rw-rw-r--   1 joi      joi       1590537 Dec 14 10:48 test/test-symlink/log4j-core.jar.bak

I am at the office on Central Standard Time, and am willing to update and re-test if I am notified.

Symlinks confuse --fix

The deb package for liblog4j2-java install the jars in /usr/share/java/

/usr/share/java/log4j-core.jar
/usr/share/java/log4j-core-2.11.2.jar -> log4j-core.jar

Scanner detected and fixed both of them. The result that I now have is:
/usr/share/java/log4j-core.jar
/usr/share/java/log4j-core-2.11.2.jar.bak -> log4j-core.jar
/usr/share/java/log4j-core-2.11.2.jar -> log4j-core.jar

now the jar.bak file is a symlink back to the mitigated jar file.
There is no backup log4j-core.jar.bak file left after running --fix.

I tested with simply installing package liblog4j2-java, then running this scanner with --fix against /usr/share/java/ to see what it found.

Using fix option on locked files

Hi,

using the fix option on locked files shows:
Found x vulnerable files
Fixed x vulnerable files
Completed in ... seconds

But it does not succeed, if the target file is locked / open file. At least for users running Windows OS.
Should return an error message. File locked instead.

Thanks

New options to avoid scanning given paths or filesystems

Hi,

It is (or will be) common to scan for "/" (as by #25) to be on the safe side -- on windows more like "all of the attached disks", which is much less applicable.

NFS mountpoints (and/or other network filesystems or USB backup drive or whatsoever) could be slow and/or duplicating the effort.

It could be good to have an option to either:

  1. don't trascend the filesystem (see -xdev option for find). So the admin can specify the path, and will scan only the given mountpoint.
  2. don't proceed on given filesystems and path. see /etc/updatedb.conf for reference (PRUNEPATHS & PRUNEFS options)
  3. simply get a list of path to be excluded on the command line (eg --prunepath /dev --prunepath /mnt [...]) so again the admin can determine what path will be excluded.

What do you think about it?

Source code pls?

Hey, could you provide the source code for this, so that we can build it ourselves? Random binaries from the internet are not much better than the CVE itself. Thanks for your effort though!

Feature request: Scan all Local drives

--all-drives
Scan all drives on Windows

This option scans local drives and networkshares wich generates massive networkload.
"--all-local-drives" could save some networks.

Version 2.15.0 not vulnerable but found

Hi there,

i have some findings like this

[*] Found CVE-2021-44228 vulnerability in D:\install\Log4J_Patche\UTI\log4j_2.15.0\log4j-core-2.15.0.jar, log4j 2.15.0

Version 2.15.0 is the most actual version in which the exploit is already fixxed. This should be excluded from the scan.

Detect all regardless of version.

This might be a perfect opportunity to find and update old v1.x versions, so how bout adding a option to display all v1.x and v2.x versions?

Didn't work with Log4j 2.11.1

I try to use latest release (1.4.0) and define the maven pom.xml:

<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.11.1</version>
</dependency>

but no vulnerable can be found in result

Feature request: -v to add some runtime progress messages.

It would be reassuring to Windows admins if Scanner could be triggered with a -v or similar option that would provide some feedback while massive filesystems are being scanned. One possibility would be a status message that prints the current Scanned/Found/Fixed messages every 10,000 files.

Folks tend to cancel apps they think are hung or crashed because they aren't getting any output.

Allow exclusions by filesystem type

Though this is really specific to Unix, really need an option to exclude by filesystem type.

This is because we have numerous servers with network drives with various mount points.

We need to exclude all network drives (nfs, cifs, etc).

Exclusion by path name is difficult to utilize.

Scanning /proc or /sys results in infinite loop

The scanner should be limited to real filesystems, scanning /proc or /sys can lead to infinite recursion and the scan never completing.

Bonus points if we can pass a flag to skip network shares also.

32bit?

Any way of compiling an x86 32bit version of this tool?

Option to exclude folders

An option to exclude (multiple) folders would be nice, like "C:/Users". Not having an option like that would mean that it scans the same SharePoint for multiple users. Maybe the same option can be added to include multiple folders / drives instead of just one.

CVE-2019-17571

Hi,

thank you publishing this awesome tool!

Would you mind adding support for CVE-2019-17571?
Log4j version 1.2 installations are suffering from a similar issue and it would be great if your scanner could detect both issues.

Files are ALL skipped

When running a scan I run the following comand:
java -jar log4j2-scan.jar /Users//Desktop/SourceCode/

the scan then results in:
Scanned 3949 directories and 9260 files
Found 0 vulnerable files
Completed in 0.62 seconds

However when I run it with --trace it shows that ALL the files are being skipped. even the .java files

Am I doing something wrong or misusing the tool?

Feature request: Print starting point of the scan in the output.

If would be helpful to include the path where the scan was started.

Now:

jlellis@graylog-cmi-008:~$ java -jar scanner-1.3.2.jar /usr/share/java
Logpresso CVE-2021-44228 Vulnerability Scanner 1.3.2 (2021-12-15)

Scanned 1 directories and 2 files
Found 0 vulnerable files
Completed in 0.00 seconds

Suggested:

jlellis@graylog-cmi-008:~$ java -jar scanner-1.3.2.jar /usr/share/java
Logpresso CVE-2021-44228 Vulnerability Scanner 1.3.2 (2021-12-15)
Scanning /usr/share/java

Scanned 1 directories and 2 files
Found 0 vulnerable files
Completed in 0.00 seconds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.