Exploit database

GH-051454c7b90efb27ada398540e967064

lhotari/log4shell-mitigation-tester

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-44228

465 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files1

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

app/src/main/java/log4shell/mitigation/tester/App.java

Java · 1,064 bytes
package log4shell.mitigation.tester;

import java.util.Arrays;
import org.apache.logging.log4j.core.util.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class App {
    private static final Logger LOG = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) throws InterruptedException {
        boolean noLookups = Constants.FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS;
        LOG.info("noLookups {}", noLookups);
        if (noLookups) {
            LOG.info("Lookups are disabled. Example lookup USER=${env:USER}");
        } else {
            LOG.info(
                    "Lookups are enabled! The application is vulnerable for Log4Shell! Example lookup USER=${env:USER}");
        }
        LOG.info("Provided command line arguments are {}", Arrays.asList(args));
        if (args.length > 0) {
            LOG.info(
                    "Since arguments were provided, it's expected to be used for testing Log4Shell. Press CTRL-C to terminate.");
            Thread.sleep(Long.MAX_VALUE);
        }
    }
}