WhiteSource Log4j Detect is a free CLI tool that quickly scans your projects to find vulnerable Log4j versions

Log4jDetect

WhiteSource Log4j Detect is a free CLI tool that quickly scans your projects to find vulnerable Log4j versions containing the following known CVEs:

  • CVE-2021-45046
  • CVE-2021-44228

It provides the exact path to direct and indirect dependencies, along with the fixed version for speedy remediation.

The supported packages managers are:

  • gradle
  • maven

In addition, the tool will search for vulnerable files with the .jar extension.

Prerequisites:

  • Download the log4j-detect binary based on your OS platform (see installation steps below)

NOTE

  1. For mac users, if the following message appears: "log4j-detect can't be opened because Apple cannot check it for malicious software", please follow the steps described here

  2. The relevant binaries must be installed for the scan to work, i.e:

    • gradle if the scanned project is a gradle project (contains a settings.gradle or a build.gradle file)
    • mvn if the scanned project is a maven project (contains a pom.xml file)
  3. Building the projects before scanning will improve scan time and reduce potential scan errors

    • maven projects must be built prior to scanning, e.g. with the following command:
      mvn install
    • It is not necessary to run gradle build prior to scanning a gradle project, but that will greatly decrease the scan time

Usage

In order to scan your project, simply run the following command:

log4j-detect scan -d PROJECT_DIR

Installation

Linux

ARCH=amd64 # or ARCH=arm64
wget "https://github.com/whitesource/log4j-detect-distribution/releases/download/v1.0.0/log4j-detect-1.0.0-linux-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.0.0-linux-$ARCH.tar.gz
chmod +x log4j-detect
./log4j-detect -h

Mac

ARCH=amd64 # or ARCH=arm64 
wget "https://github.com/whitesource/log4j-detect-distribution/releases/download/v1.0.0/log4j-detect-1.0.0-darwin-$ARCH.tar.gz"
tar -xzvf log4j-detect-1.0.0-darwin-$ARCH.tar.gz
chmod +x log4j-detect
./log4j-detect -h

Windows

Invoke-WebRequest -Uri "https://github.com/whitesource/log4j-detect-distribution/releases/download/v1.0.0/log4j-detect-1.0.0-windows-amd64.zip" -OutFile "log4j-detect.zip"
Expand-Archive -LiteralPath 'log4j-detect.zip'
cd log4j-detect
.\log4j-detect.exe -h
Comments
  • Is this tool support CVE-2021-44832 (12/28 released)?

    Is this tool support CVE-2021-44832 (12/28 released)?

    Apache release new vulnerability with CVE-2021-44832 and state this vulnerability impact before all version of log4j before 2.17.0. So, please check weather this tool can support it. Thanks. https://logging.apache.org/log4j/2.x/

  • PROJECT_DIR is it source code dir or binary directory

    PROJECT_DIR is it source code dir or binary directory

    Can you pl. clarify if PROJECT_DIR is a binary install directory in the readme,

    I am hoping it would support both :) i.e. static code analysis and also binary jar dependencies scan

  • add ruby support

    add ruby support

    • Add support for ruby scanning
    • use both jgem and gem for finding gem cache dirs
    • small bug fixes / improvements
    • fix windows bug, add error logs when operation fails
    • add bundler info to README.md, fix gempath and nil panic bugs
  • JSON Output of results

    JSON Output of results

    Would be handy to have a machine-parsable version of the output to be able to run this and get JSON back with the list of vulnerable files found. Then it can be consumed by other tools or written out in a report of the user's design.

    Something like

    log4j-detect.exe -d C:/path --json
    
  • Place a flag in Windows to ignore System Volume Information folder

    Place a flag in Windows to ignore System Volume Information folder

    By default the Windows "System Volume Information" is locked because Windows uses this folder for certain system-level features. The permissions are set to prevent users—and programs without the appropriate permissions—from tampering with the files inside and interfering with important system functions.

    Are you able to please put a flag for the GO binary to ignore this folder? It throws and error. You can reproduce by going to the root level of any Windows drive and running the binary.

    log4j-detect scan Scanning F:\ for vulnerabilities... fsWalkErrorFunc error: open F:\System Volume Information: Access is denied.

  • Failing exit code when vulns found

    Failing exit code when vulns found

    How do we feel about returning a non-zero exit code from the CLI process when at least one vuln is found? Then this could be used as part of an automated process which would fail when vulns were found without needing to parse the output text and depend on what wording displays. This could be done as the default behavior, or add a command line switch to enable it.

  • Improvements for jar scanning

    Improvements for jar scanning

    I'd like to use this tool for scanning a server for any vulnerable jars, which could be hiding in any number of places. I'd like to recommend the behavior be modified to

    • also look inside of zip files
    • also look inside of war files
    • also look inside of jar files
    • actually scratch all of those-- just recurse into any archive regardless of the extension if possible

    For example, I use a lot of fat-jar deployments where I've just got one big WEB-INF/lib/fat.jar on disk that stores other jar files inside of itself for extraction at run time. Note, I don't mean the classes are shaded in, I mean if you unzip far.jar, you've got full jar files sitting inside of it that were packed in as resources. And If the bullets above (which are really all just archives) were recursively scanned, this would make the tool a lot more powerful to be able to see into hidden jar files that may be still tucked away at scan time. A real life example my hard drive right now is

    ─┬ lucee.zip
     └┬ engine.war
      └┬ WEB-INF/lib/lucee.jar
       ├- bundles/log4j-1.2.17.jar  <-- vulnerable
       └┬ extensions/EFDEB172-F52E-4D84-9CD1A1F561B3DFC8-2.4.1.33.lex
        └─ jars\log4j-1-2-16.jar  <-- vulnerable
    

    Yes, that is a real actual example off my hard drive, and yes that last file is a jar inside a zip (with a .lex extension), inside a jar file, inside a war file, inside a zip file. If we can get this tool recusivley digging all the way down into any archive it comes across, it will find that deep vulnerable jar. As it stand now, I'd have to manually unpack all of those layers myself for the scanner to find it.

Scan all AWS EC2 instances in a region for potentially vulnerable log4j versions

ec2-log4j-scan Scan all AWS EC2 instances in a region for potentially vulnerable log4j versions. This is a clumsy but effective tool which takes outpu

Dec 28, 2021
Application trying to detect processes vulnerable to log4j JNDI exploit

Log4j JNDI Jar Detector Purpose This application is able to detect jars used by

Jan 25, 2022
Scans files for .jars potentially vulnerable to Log4Shell (CVE-2021-44228) by inspecting the class paths inside the .jar.

log4shelldetect Scans a file or folder recursively for jar files that may be vulnerable to Log4Shell (CVE-2021-44228) by inspecting the class paths in

Dec 15, 2022
CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security signals for open source package versions.
CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security signals for open source package versions.

depsdev CLI client (and Golang module) for deps.dev API. Free access to dependencies, licenses, advisories, and other critical health and security sig

May 11, 2023
Scans and catches callbacks of systems that are impacted by Log4J Log4Shell vulnerability across specific headers.
Scans and catches callbacks of systems that are impacted by Log4J Log4Shell vulnerability across specific headers.

Log4ShellScanner Scans and catches callbacks of systems that are impacted by Log4J Log4Shell vulnerability across specific headers. Very Beta Warning!

Jun 17, 2022
Simple local scanner for vulnerable log4j instances

Simple local log4j vulnerability scanner (Written in Go because, you know, "write once, run anywhere.") This is a simple tool that can be used to find

Dec 21, 2022
Look for JAR files that vulnerable to Log4j RCE (CVE‐2021‐44228)
Look for JAR files that vulnerable to Log4j RCE (CVE‐2021‐44228)

Look4jar Look for JAR files that vulnerable to Log4j RCE (CVE‐2021‐44228) Objectives It differs from some other tools that scan for vulnerable remote

Dec 25, 2022
Log4j detector and reporting server for scalable detection of vulnerable running processes.

Log4j Detector A client and reporting server to identify systems vulnerable to Log4j at scale. This work is based on Stripe's Remediation Tools, but w

Apr 8, 2022
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/

Sep 22, 2022
Proto-find is a tool for researchers that lets you find client side prototype pollution vulnerability.

proto-find proto-find is a tool for researchers that lets you find client side prototype pollution vulnerability. How it works proto-find open URL in

Dec 6, 2022
A fully self-contained Nmap like parallel port scanning module in pure Golang that supports SYN-ACK (Silent Scans)

gomap What is gomap? Gomap is a fully self-contained nmap like module for Golang. Unlike other projects which provide nmap C bindings or rely on other

Dec 10, 2022
A compact, cross-platform scanner that scans ports and recognizes fingerprints.

portscan A compact, cross-platform scanner that scans ports and recognizes fingerprints. Usage: Usage of ./portscan: -H headers request headers

Apr 4, 2022
Tool to check whether one of your applications is affected by a vulnerability in log4j: CVE-2021-44228
Tool to check whether one of your applications is affected by a vulnerability in log4j: CVE-2021-44228

log4shell.tools log4shell.tools is a tool allows you to run a test to check whether one of your applications is affected by a vulnerability in log4j:

Nov 2, 2022
A vulnerable graphQL application, for testing purposes

Vulnerable-GoQL Vulnerable-GoQL is an web API which implements main security breach.

Jul 31, 2021
Finds an identifiable hash value for each version of GitLab vulnerable to CVE-2021-22205

Finds an identifiable hash value for each version of GitLab vulnerable to CVE-2021-22205

Sep 20, 2022
Ah shhgit! Find secrets in your code. Secrets detection for your GitHub, GitLab and Bitbucket repositories: www.shhgit.com
Ah shhgit! Find secrets in your code. Secrets detection for your GitHub, GitLab and Bitbucket repositories: www.shhgit.com

shhgit helps secure forward-thinking development, operations, and security teams by finding secrets across their code before it leads to a security br

Dec 23, 2022
This is simple repositry use to detect which port is open. It is a custom tool built in GO LANG.

dynamic-port-scanning-in-GO-lang This is simple repositry use to detect which port is open. It is a custom tool built in GO LANG. This is CUSTOM tool

Jan 25, 2022
Generate mega-workflows using Wappalyzer outputs and existing tech-detect

Usage Usage of ./build/generate-nuclei-templates: -clone-path string Path to clone Wappalyzer repository (default "./wappalyzer") -debug

Nov 9, 2022
Detect Language API Go Client

Detect Language API Go Client Detects language of the given text. Returns detected language codes and scores. Before using Detect Language API client

Sep 27, 2022