Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-24813 — 在 Windows Server 2019 Standard 上,为懒人研究员快速部署 Tomcat v9.0.90 与 java 25.0.1 2025-10-21 LTS 的说明。 | Kitploit
工具/GitHubGitHub/seahcy/cve-2025-24813
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试学习与教育Payload 开发
GitHubseahcy/cve-2025-24813

CVE-2025-24813

在 Windows Server 2019 Standard 上,为懒人研究员快速部署 Tomcat v9.0.90 与 java 25.0.1 2025-10-21 LTS 的说明。

查看仓库
17个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2025-24813

描述

本仓库旨在提供清晰的说明,用于在 Windows Server 2019 Standard 上快速部署 Tomcat v9.0.90 和 java 25.0.1 2025-10-21 LTS,以进行网络安全威胁模拟演练。exploit.py 利用 ysoserial-all.jar 中的 CommonsCollections6 模块生成有效载荷,该载荷随后被 %CATALINA_HOME%\webapps\ROOT\WEB-INF\lib 中的 commons-collections-3.2.1.jar 依赖项反序列化。

设置受害者 Windows Server 2019 Standard 终端

  • 下载 Tomcat v9.0.90:
root@kitploit:~
Invoke-WebRequest -Uri "https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.90/bin/apache-tomcat-9.0.90-windows-x64.zip" -OutFile "apache-tomcat-9.0.90-windows-x64.zip"
Expand-Archive -Path "apache-tomcat-9.0.90-windows-x64.zip" -DestinationPath "C:\"
  • 下载 java 25.0.1 2025-10-21 LTS(ZIP 版本):
root@kitploit:~
Invoke-WebRequest -Uri "https://download.oracle.com/java/25/archive/jdk-25_windows-x64_bin.zip" -OutFile "jdk-25_windows-x64_bin.zip"
Expand-Archive -Path "jdk-25_windows-x64_bin.zip" -DestinationPath "C:\"
  • 下载 commons-collections 依赖:
root@kitploit:~
mkdir C:\apache-tomcat-9.0.90\webapps\ROOT\WEB-INF\lib\
cd C:\apache-tomcat-9.0.90\webapps\ROOT\WEB-INF\lib\
Invoke-WebRequest -Uri "https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" -OutFile "commons-collections-3.2.1.jar"
  • 设置环境变量
root@kitploit:~
1. 点击“开始”
2. 输入“编辑系统环境变量”
3. 创建两个新的系统变量,命名为:
    - `%JAVA_HOME%`,值为 `C:\jdk-25.0.1`
    - `%CATALINA_HOME%`,值为 `C:\apache-tomcat-9.0.90`
4. 编辑名为 `Path` 的系统变量,并添加以下值:
   - `%JAVA_HOME%\bin`
   - `%CATALINA_HOME%\bin`
  • 创建用于自动启动的服务
root@kitploit:~
C:\apache-tomcat-9.0.90\bin\service.bat install Tomcat9Server
Set-Service -Name "Tomcat9Server" -StartupType Automatic
Start-Service -Name "Tomcat9Server"
  • 打开 tomcat-9.0.90\conf 文件夹中的 tomcat-users.xml,并在 </tomcat-users> 之前添加以下内容:
root@kitploit:~
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>
  • 打开 tomcat-9.0.90\conf 文件夹中的 context.xml,并将所有内容替换为以下内容:
root@kitploit:~
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

    <Manager className="org.apache.catalina.session.PersistentManager" maxIdleBackup="1" saveOnRestart="true" processExpiresFrequency="1">
        <Store className="org.apache.catalina.session.FileStore"/>
    </Manager>
</Context>
  • 打开 tomcat-9.0.90\conf 文件夹中的 web.xml,搜索 DefaultServlet,并将整个 <servlet></servlet> 替换为以下内容:
root@kitploit:~
<servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
          <param-name>readonly</param-name>
          <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
  • 使用 PowerShell 重新启动服务器
root@kitploit:~
shutdown.bat
startup.bat
  • 如果无法从外部连接到 Web 服务器,可能是 Windows 防火墙阻止了连接。请配置防火墙以允许连接。
root@kitploit:~
New-NetFirewallRule -DisplayName "Tomcat9Server" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow
  • 恭喜!你已经启用了一个存在漏洞的 Tomcat 服务器,其中包含通过 commons-collections-3.2.1.jar 实现的 Java 反序列化能力、通过 FileStore 实现的会话持久化,以及禁用了 DefaultServlet(web.xml)中的只读保护,使其容易受到通过 ysoserial 有效载荷利用的 CVE-2025-24813 攻击。在 C:\tomcat-9.0.90\webapps\ROOT 中添加一些看起来合法的 index.html,使其看起来更专业。

配置 SSL 以启用 HTTPS(可选)

  • 使用记事本打开 C:\apache-tomcat-9.0.90\conf\web.xml,并搜索“<Connector port=”。你可以取消注释该块并添加你自己的 .pfx 路径。以下是在新创建的 ssl 文件夹中添加一个无密码的 cert.pfx 并运行 HTTP/1.1 的示例:
root@kitploit:~
<Connector port="443" 
           protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" 
           SSLEnabled="true"
           scheme="https" 
           secure="true">
    <SSLHostConfig>
        <Certificate certificateKeystoreFile="C:\tomcat-9.0.90\conf\ssl\cert.pfx"
                     certificateKeystorePassword=""
                     certificateKeystoreType="PKCS12" />
    </SSLHostConfig>
</Connector>
  • 如有需要,添加防火墙规则:
root@kitploit:~
New-NetFirewallRule -DisplayName "Tomcat9HTTPSServer" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow

设置 Kali

  • 克隆 exploit.py
root@kitploit:~
git clone <this-repo-url>
cd CVE-2025-24813
pip install requests 
  • 检查是否安装了 Java,并从 Github 下载 ysoserial
root@kitploit:~
java --version
curl -L -o ysoserial-all.jar https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
  • 使用示例:
root@kitploit:~
python exploit.py -t http://<target IP>:8080/ -c "cmd.exe /c calc.exe"

预期结果与痕迹

  • 每次执行 exploit.py 时,会在 C:\tomcat-9.0.90\webapps\ROOT 和 C:\tomcat-9.0.90\work\Catalina\localhost\ROOT 中创建两个具有随机名称的会话文件。工作文件夹中的 .session 文件应在执行后几秒钟内被删除。

参考

  • https://github.com/PaloAltoNetworks/Unit42-timely-threat-intel/blob/main/2025-03-14-Testing-CVE-2025-24813.md
  • https://scrapco.de/blog/analysis-of-cve-2025-24813-apache-tomcat-path-equivalence-rce.html
下载工具