
Apache Tomcat CVE-2025-24813 PoC检测工具
本项目是一个专门用于检测Apache Tomcat服务器CVE-2025-24813漏洞的概念验证(PoC)工具。该工具通过非侵入式的方式,对目标Tomcat服务器进行安全检查,包括版本识别、HTTP PUT权限测试和会话信息收集,所有操作均记录到详细的日志报告中。
pip install requeststargets.csv),格式如下:Hostname,IP address
TestServer,192.168.56.101
AnotherServer,192.168.56.102CVE_2025_24813_report.txt报告文件def init_report():
"""Initializes the report file in the current working directory."""
global REPORT_FILE
REPORT_FILE = os.path.join(os.getcwd(), "CVE_2025_24813_report.txt")
try:
with open(REPORT_FILE, 'w') as f:
f.write("CVE-2025-24813 PoC Check Report\n")
f.write(f"Start Time: {datetime.now()}\n")
f.write("=" * 60 + "\n")
log_message("INFO", "Report initialized.")
except Exception as e:
log_message("ERROR", f"Failed to initialize report file '{REPORT_FILE}': {e}")def log_message(level, message):
"""
Logs a message with a timestamp and severity to the report file and prints it to the console.
"""
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
formatted = f"{timestamp} - {level} - {message}"
print(f"{level}: {message}")
try:
with open(REPORT_FILE, 'a') as f:
f.write(formatted + "\n")
except Exception as e:
pass#!/usr/bin/env python3
"""
PoC for CVE-2025-24813 (HTTP-based Checks Only) with CSV Input and Incremental Reporting
This script accepts a CSV file (with columns "Hostname" and "IP address") from the current working directory.
For each target, it performs the following non-intrusive checks:
1. Extracts the Tomcat version from the HTTP "Server" header.
2. Attempts an HTTP PUT on "CVE-2025-24813-check.txt" (with content "ThreatOPS was here --> MichaelFry@livenation.com")
to determine if the DefaultServlet is write-enabled, then deletes the file.
3. Retrieves a session ID from the target.
All actions are logged (with timestamps and severity levels) to the console and a report file in the CWD.
"""import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# Disable SSL warnings for testing purposes
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)该代码设计为模块化结构,核心功能包括报告生成、日志记录和HTTP请求处理,确保检测过程的安全性和可追溯性。
6HFtX5dABrKlqXeO5PUv/xT3pvZhDSsm+vWSaxtXdTeO7ytUMNgVPToBhhL/tOZRxYBBwPndIbnaQlVbqmBmGQ==
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。