POC详情: 8fe8b5b3f5976597fe44dd19171f5267ed003a33

来源
关联漏洞
标题: Apache HTTP Server 路径遍历漏洞 (CVE-2021-41773)
描述:Apache HTTP Server是美国阿帕奇(Apache)基金会的一款开源网页服务器。该服务器具有快速、可靠且可通过简单的API进行扩充的特点。 Apache HTTP Server 2.4.49版本存在路径遍历漏洞,攻击者可利用该漏洞使用路径遍历攻击将URL映射到预期文档根以外的文件。
介绍
# CVE-2021-41773 PoC

Proof of concept to check if hosts are vulnerable to CVE-2021-41773.

## Description (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41773)

A flaw was found in a change made to path normalization in Apache HTTP Server 2.4.49-2.4.50.  

An attacker could use a path traversal attack to map URLs to files outside the expected document root. If files outside of the document root are not protected by "require all denied" these requests can succeed. Additionally this flaw could leak the source of interpreted files like CGI scripts.

This issue only affects Apache 2.4.49 & 2.4.50 and not earlier versions.

## Patch

There are currently two methods:
1. Update Apache HTTP Server to a version >= 2.4.51
2. If the above is not possible, although not recommended as it doesn't guarantee a fix, edit the following in `/etc/apache2/apache2.conf`:
  ```xml
<!-- Vulnerable (Require all granted in '/') -->
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>

<!-- Patched (Require all denied in '/') -->
<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>
```

## Usage

Use the script as follows:
```plaintext
CVE-2021-41773.py [-h] [--nosslcheck] [--cores CORES] [--file TARGETFILE] host

Checks if an apache server is vulnerable to CVE-2021-41773.

optional arguments:
  -h, --help            show this help message and exit
  --host HOST           ip/domain to be checked e.g. 'https://google.com/'.
  --nosslcheck, -n      Do not verify ssl certificates.
  --cores CORES, -C CORES
                        Specify number of cores that should be dedicated to the task, default: 1
  --file TARGETFILE, -f TARGETFILE
                        Specify file to fetch list of hosts from, example: "/home/user/Desktop/myfile.txt"
  --rce, -r             When toggled checks if target is susceptible to RCE (NOT YET IMPLEMENTED!)
```
文件快照

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