Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2020-1938 PoC — Apache Tomcat 安全漏洞

Source
Associated Vulnerability
Title:Apache Tomcat 安全漏洞 (CVE-2020-1938)
Description:When using the Apache JServ Protocol (AJP), care must be taken when trusting incoming connections to Apache Tomcat. Tomcat treats AJP connections as having higher trust than, for example, a similar HTTP connection. If such connections are available to an attacker, they can be exploited in ways that may be surprising. In Apache Tomcat 9.0.0.M1 to 9.0.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99, Tomcat shipped with an AJP Connector enabled by default that listened on all configured IP addresses. It was expected (and recommended in the security guide) that this Connector would be disabled if not required. This vulnerability report identified a mechanism that allowed: - returning arbitrary files from anywhere in the web application - processing any file in the web application as a JSP Further, if the web application allowed file upload and stored those files within the web application (or the attacker was able to control the content of the web application by some other means) then this, along with the ability to process a file as a JSP, made remote code execution possible. It is important to note that mitigation is only required if an AJP port is accessible to untrusted users. Users wishing to take a defence-in-depth approach and block the vector that permits returning arbitrary files and execution as JSP may upgrade to Apache Tomcat 9.0.31, 8.5.51 or 7.0.100 or later. A number of changes were made to the default AJP Connector configuration in 9.0.31 to harden the default configuration. It is likely that users upgrading to 9.0.31, 8.5.51 or 7.0.100 or later will need to make small changes to their configurations.
Description
CNVD-2020-10487 OR CVE-2020-1938 批量验证脚本,批量验证,并自动截图,方便提交及复核
Readme
# CNVD-2020-10487(CVE-2020-1938)批量验证脚本
批量脚本,基于@YDHCUI的POC文件制作,批量且可以自动截图,方便复核

## 一、环境准备

虚拟环境请用conda安装(自行百度miniconda安装),因为POC用的python2,所以要建一个python2环境,一个python3环境

### python2(POC运行环境):
    conda create -n python2 python=python2.7
    
### python3(本脚本运行环境):
    conda create -n biubiubiu python=python3.7
    pip install pywin32
    pip install pyqt
    pip install loguru
无法导入win32gui, 参考:https://stackoverflow.com/questions/3956178/cant-load-pywin32-library-win32gui

必须在cmd环境下运行,否则截图不正常!

### usage:
    · 设置下面的TomcatLFI_path路径
    · conda activate biubiubiu
    · cd 到cmd.py所在文件夹目录
    · python cmd.py
其他详细使用说明见cmd.py

## 二、效果
根据`Getting resource`是否存在于返回的结果字符串判断漏洞

有漏洞的截图会以jpg格式保存,不存在就是png。

脚本所在目录会自动生成一个保存结果的txt
File Snapshot

[4.0K] /data/pocs/8e340dd29e2309d1d76b9585c558d87375ee2ad6 ├── [4.8K] cmd.py ├── [ 16] ips.txt ├── [1.1K] README.md └── [ 12K] TomcatLFI.py 0 directories, 4 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →