2021年10月5日,Apache官方发布了一批漏洞信息,其中Apache HTTP Server路径穿越漏洞CVE-2021-41773。
满足条件:
Require all granted。(默认情况下是不允许的)
使用docker搭建Apache HTTPd 2.4.49版本服务器:
Dockerfile
FROM vulhub/httpd:2.4.49
LABEL maintainer="phithon <root@leavesongs.com>"
RUN set -ex \
&& sed -i "s|#LoadModule cgid_module modules/mod_cgid.so|LoadModule cgid_module modules/mod_cgid.so|g" /usr/local/apache2/conf/httpd.conf \
&& sed -i "s|#LoadModule cgi_module modules/mod_cgi.so|LoadModule cgi_module modules/mod_cgi.so|g" /usr/local/apache2/conf/httpd.conf \
&& sed -i "s|#Include conf/extra/httpd-autoindex.conf|Include conf/extra/httpd-autoindex.conf|g" /usr/local/apache2/conf/httpd.conf \
&& cat /usr/local/apache2/conf/httpd.conf \
| tr '\n' '\r' \
| perl -pe 's|<Directory />.*?</Directory>|<Directory />\n AllowOverride none\n Require all granted\n</Directory>|isg' \
| tr '\r' '\n' \
| tee /tmp/httpd.conf \
&& mv /tmp/httpd.conf /usr/local/apache2/conf/httpd.confdocker-compose.yml
version: '2'
services:
apache:
build: .
ports:
- "8080:80"环境启动
docker-compose build
docker-compose up -d

使用curl命令发送payload( icons 必须存在且可访问):

在服务端开启了cgi或cgid这两个mod的情况下,这个路径穿越漏洞将可以执行任意命令:

0x03修复建议
升级至官方 ..最新版本
更多渗透相关技术经验分享,学渗透来雨笋教育线上线下任你选择,就业进大厂!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70006652/viewspace-2847456/ ,如需转载,请注明出处,否则将追究法律责任。