不能说是漏洞,只是 apache 特性而已。

下面是apache  httpd.conf中截取的一段:

<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types #
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
   AddType application/x-httpd-php .php3 #
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi # For type maps (negotiated resources):
#AddHandler type-map var #
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml </IfModule>

由上可知道,.php 或 .php3后缀的文件会被php解析。

Index.php.a文件有两个后缀,分别是.php和.a,apache无法识别.a但可以识别.php,然后件给php去解析。

如果去掉后缀 (.php) ,则无法解析,按照默认设置(DefaultType  text/plain),对于无法识别的后缀,按纯文本发给浏览器。

如下图(.a后缀无法识别,按默认):

如果在 httpd.conf 中添加AddType application/x-httpd-php .a如图:

Apache按从右到左的顺序识别文件后缀,直至找到后缀能匹配配置文件中的设置。index.php.txt,将会被识别为纯文本(text/plain);

index.php.Z将会被识别为压缩文件。Index.php.a 若.a没有被设置或mime.types没有定义,则会识别为.php后缀的文件,交给php解析。

在mine.types中设置后缀匹配识别:

[php代码审计] apache 后缀名解析“漏洞”的更多相关文章

  1. IIS 6.0/7.0/7.5、Nginx、Apache 等服务器解析漏洞总结

    IIS 6.0 1.目录解析:/xx.asp/xx.jpg  xx.jpg可替换为任意文本文件(e.g. xx.txt),文本内容为后门代码 IIS6.0 会将 xx.jpg 解析为 asp 文件. ...

  2. Apache HTTPD 换行解析漏洞--CVE-2017-15715

    CVE-2017-15715 一.漏洞描述 Apache HTTPD是一款HTTP服务器,它可以通过mod_php来运行PHP网页.其2.4.0~2.4.29版本中存在一个解析漏洞,在解析PHP时,1 ...

  3. Apache解析漏洞复现(CVE-2017-15715),可以绕过黑名单

    照着P神的文章准备复现一下(总结一下经验) 环境的安装 这里面直接使用的vulhub里面的环境来进行安装的(为了方便吗) 基础环境如下    实际上Apache版本在2.4.0~2.4.29即可 i ...

  4. Apache解析漏洞详解

    很多次听到人说apache的“解析漏洞”了,正好今天又有人问,那就简单科普一下这个“解析漏洞”是何物. 先来看测试过程和结果的对比吧. 结果一 首先,我安装了apache 2.x版本,同时以modul ...

  5. 漏洞复现——Apache HTTPD多后缀解析漏洞

    漏洞原理:Apache Httpd支持一个文件拥有多个后缀,不同的后缀执行不同的命令,也就是说当我们上传的文件中只要后缀名含有php,该文件就可以被解析成php文件,利用Apache Httpd这个特 ...

  6. apache httpd多后缀解析漏洞复现

    apache httpd多后缀解析漏洞复现 一.漏洞描述 Apache Httpd支持一个文件拥有多个后缀,不同的后缀执行不同的命令,也就是说当我们上传的文件中只要后缀名含有php,该文件就可以被解析 ...

  7. Apache HTTPD 未知后缀解析漏洞

    环境搭建 https://blog.csdn.net/qq_36374896/article/details/84102101 该环境版本: PHP 7.x 最新版 Apache HTTPD 2.4. ...

  8. 文件解析漏洞总结(IIS,APACHE,NGINX)

    (本文主体来自https://blog.csdn.net/qq_36119192/article/details/82834063) 文件解析漏洞 文件解析漏洞主要由于网站管理员操作不当或者 Web ...

  9. apache、nginx、Tomcat、IIS引擎解析漏洞

                                            引擎解析漏洞 常见的web容器有IIS.Apache.Nginx.Tomcat等,以下是详细讲解 IIS IIS简介 是 ...

随机推荐

  1. 在 mac 系统上安装 python 的 MySQLdb 模块

    在 mac 系统上安装 python 的 MySQLdb 模块 特别说明:本文主要参考了Mac系统怎么安装MySQLdb(MySQL-Python) 第 1 步:下载 MySQL-python-1.2 ...

  2. (实战)多边形,梯形盒阴影css实现技巧

    一般情况下,我们给块状元素(四边形)添加阴影样式,直接用css box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);就可以了,但是总有一些需求是那么的特别,例如下图: ...

  3. Deepin 系统安装并配置PHP开发环境

    Deepin是由武汉深之度科技有限公司开发的Linux发行版.Deepin团队基于Qt/C++(用于前端)和Go(用于后端)开发了的全新深度桌面环境(DDE),以及音乐播放器,视频播放器,软件中心等一 ...

  4. 用流的方式来操作hdfs上的文件

    import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import ...

  5. Vue知识整理7:vue中函数的应用

    在vue中使用函数对字符串做相应的处理: split:分割字符,将每个字符分割为一个数组值: reverse:将字符进行逆序排序: join:将字符连接: 最终输出结果.

  6. 011-Spring Boot 运行流程分析SpringApplication.run

    一.程序入口 1.1.静态方法 //直接调用run方法 ConfigurableApplicationContext context = SpringApplication.run(App.class ...

  7. 阶段1 语言基础+高级_1-3-Java语言高级_08-JDK8新特性_第3节 两种获取Stream流的方式_11_练习:集合元素处理(Stream方式)

  8. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_05 IO字符流_8_使用try_catch_finally处理流中的异常

    变量没有初始化的赋值 变量可能赋值会失败.设置fw为null.close报错 把close也用try catch捕获异常 修改写入w盘.实际盘符没有这个 上面异常是这里打印的 继续优化代码

  9. 测开之路九十九:js函数、事件、window窗体对象

    函数:function 函数名(参数列表) 事件 单击:onclick()表单提交:onsubmit()鼠标经过:onmouseover()值改表时:onchange() window窗体对象转跳:w ...

  10. 【ABAP系列】SAP ABAP ALV中的TOP_OF_PAGE添加任意图标

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP ABAP ALV中的TOP_ ...