POC详情: 7f3ace6a93cf0e605ab7cb9cca146db96dd01c34

来源
关联漏洞
标题: Apache Tomcat 安全漏洞 (CVE-2020-1938)
描述:Apache Tomcat是美国阿帕奇(Apache)基金会的一款轻量级Web应用服务器。该程序实现了对Servlet和JavaServer Page(JSP)的支持。 Apache Tomcat 7.0.100版本之前的7.*版本、8.5.51版本之前的8.*版本和9.0.31版本之前的9.*版本中的Tomcat AJP协议存在安全漏洞。攻击者可利用该漏洞读取或包含Tomcat上所有webapp目录下的任意文件,如 webapp 配置文件或源代码等。
描述
Ghostcat read file/code execute,CNVD-2020-10487(CVE-2020-1938) 
介绍
# Ghostcat


exp for CNVD-2020-10487(CVE-2020-1938)

tomcat ajp协议任意属性设置导致的文件读取和文件执行。

[漏洞分析](https://www.00theway.org/2020/02/22/ajp-shooter-from-source-code-to-exploit/)

# 代码仅供安全测试,请勿用于非法用途,造成的后果使用者负责与本人无关!!!


```
python3 ajpShooter.py -h

       _    _         __ _                 _
      /_\  (_)_ __   / _\ |__   ___   ___ | |_ ___ _ __
     //_\\ | | '_ \  \ \| '_ \ / _ \ / _ \| __/ _ \ '__|
    /  _  \| | |_) | _\ \ | | | (_) | (_) | ||  __/ |
    \_/ \_// | .__/  \__/_| |_|\___/ \___/ \__\___|_|
         |__/|_|
                                                00theway,just for test

usage: ajpShooter.py [-h] [--ajp-ip AJP_IP] [-H HEADER]
                     [-X {GET,POST,HEAD,OPTIONS,PROPFIND}] [-d DATA]
                     [-o OUT_FILE] [--debug]
                     url ajp_port target_file {read,eval}

positional arguments:
  url                   target site's context root url like
                        http://www.example.com/demo/
  ajp_port              ajp port
  target_file           target file to read or eval like /WEB-
                        INF/web.xml,/image/evil.jpg
  {read,eval}           read or eval file

optional arguments:
  -h, --help            show this help message and exit
  --ajp-ip AJP_IP       ajp server ip,default value will parse from from url
  -H HEADER, --header HEADER
                        add a header
  -X {GET,POST,HEAD,OPTIONS,PROPFIND}
                        Sets the method (default: GET).
  -d DATA, --data DATA  The data to POST
  -o OUT_FILE, --out-file OUT_FILE
                        write response to file
  --debug
```

read file

![](ajp-read.png)

execute file

![](ajp-execute.png)

save file

![](ajp-save.png)


TODO

* POST DATA
* run as a proxy
文件快照

[4.0K] /data/pocs/7f3ace6a93cf0e605ab7cb9cca146db96dd01c34 ├── [272K] ajp-execute.png ├── [398K] ajp-read.png ├── [285K] ajp-save.png ├── [ 13K] ajpShooter.py └── [1.8K] README.md 0 directories, 5 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 如果因为来源失效或无法访问,请发送邮箱到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
    3. 神龙已为您对POC代码进行快照,为了长期维护,请考虑为本地POC付费,感谢您的支持。