GVKun编程网logo

Apache HTTPD 多后缀解析漏洞(apache2.4.7解析漏洞)

42

本文将分享ApacheHTTPD多后缀解析漏洞的详细内容,并且还将对apache2.4.7解析漏洞进行详尽解释,此外,我们还将为大家带来关于Apachehttpd2.4.17发布、ApacheHTTP

本文将分享Apache HTTPD 多后缀解析漏洞的详细内容,并且还将对apache2.4.7解析漏洞进行详尽解释,此外,我们还将为大家带来关于Apache httpd 2.4.17 发布、Apache HTTPd 2.4.49 路径穿越漏洞(CVE-2021-41773)复现、Apache Httpd 与 Apache Tomcat、Apache httpd 和 Easy Apache 4(为 python 应用程序安装 mod_wsgi)的相关知识,希望对你有所帮助。

本文目录一览:

Apache HTTPD 多后缀解析漏洞(apache2.4.7解析漏洞)

Apache HTTPD 多后缀解析漏洞(apache2.4.7解析漏洞)

Apache HTTPD 支持一个文件拥有多个后缀,并为不同后缀执行不同的指令。比如,如下配置文件:

AddType text/html .html
AddLanguage zh-CN .cn

其给.html后缀增加了media-type,值为text/html;给.cn后缀增加了语言,值为zh-CN。此时,如果用户请求文件index.cn.html,他将返回一个中文的html页面。

以上就是Apache多后缀的特性。如果运维人员给.PHP后缀增加了处理器:

AddHandler application/x-httpd-PHP .PHP

那么,在有多个后缀的情况下,只要一个文件含有.PHP后缀的文件即将被识别成PHP文件,没必要是最后一个后缀。利用这个特性,将会造成一个可以绕过上传白名单的解析漏洞。

漏洞环境

运行如下命令启动一个稳定版Apache,并附带PHP 7.3环境:

docker-compose up -d

漏洞复现

根据上面的配置情况,直接访问IP即可

根据页面提示,提交简单的包含PHP探针信息的文件

<?PHP
    PHPinfo()
?>

提示:“Unsupported filetype uploaded.”说明上传失败,根据要求上传图片格式的文件看看。直接将PHPinfo.PHP改为PHPinfo.PHP.png再次尝试上传,可以看到上传成功了,提示:“File uploaded successfully: /var/www/html/uploadfiles/PHPinfo.PHP.png”,根据提示访问对应的路径

漏洞利用

根据上面可以看到我们上传的图片格式的文件仍然被当成PHP文件解析了,所以可以直接上传含有webshell的图片文件,从而获取权限。

开启Burp Suite,直接上传webshell.PHP,在代理中修改文件的后缀名,仍然能够上传成功。

总结

以上是小编为你收集整理的Apache HTTPD 多后缀解析漏洞全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

原文地址:https://www.cnblogs.com/NoCirc1e/p/16283382.html

Apache httpd 2.4.17 发布

Apache httpd 2.4.17 发布

Apache httpd 2.4.17 发布,更新内容如下:

hanges with Apache 2.4.17

  *) mod_http2: added donated HTTP/2 implementation via core module. Similar
     configuration options to mod_ssl. [Stefan Eissing]

  *) mod_proxy: don''t recyle backend announced "Connection: close" connections
     to avoid reusing it should the close be effective after some new request
     is ready to be sent.  [Yann Ylavic]

  *) mod_substitute: Allow to configure the patterns merge order with the new
     SubstituteInheritBefore on|off directive.  PR 57641
     [Marc.Stern <Marc.Stern approach.be>, Yann Ylavic, William Rowe]

  *) mod_proxy: Fix ProxySourceAddress binding failure with AH00938.
     PR 56687.  [Arne de Bruijn <apache arbruijn.dds.nl>

  *) mod_ssl: Support compilation against libssl built with OPENSSL_NO_SSL3,
     and change the compiled-in default for SSL[Proxy]Protocol to "all -SSLv3",
     in accordance with RFC 7568. PR 58349, PR 57120. [Kaspar Brand]

  *) mod_ssl: append :!aNULL:!eNULL:!EXP to the cipher string settings,
     instead of prepending !aNULL:!eNULL:!EXP: (as was the case in 2.4.7
     and later). Enables support for configuring the SUITEB* cipher
     strings introduced in OpenSSL 1.0.2. PR 58213. [Kaspar Brand]

  *) mod_ssl: Add support for extracting the msUPN and dnsSRV forms
     of subjectAltName entries of type "otherName" into
     SSL_{CLIENT,SERVER}_SAN_OTHER_{msUPN,dnsSRV}_n environment
     variables. Addresses PR 58020. [Jan Pazdziora <jpazdziora redhat.com>,
     Kaspar Brand]

  *) mod_logio: Fix logging of %^FB (time to first byte) on the first request on
     an SSL connection.  PR 58454.  
     [Konstantin J. Chernov <k.j.chernov gmail.com>]

  *) mod_cache: r->err_headers_out is not merged into
     r->headers when mod_cache is enabled and the response
     is cached for the first time. [Edward Lu]

  *) mod_slotmem_shm: Fix slots/SHM files names on restart for systems that
     can''t create new (clear) slots while previous children gracefully stopping
     still use the old ones (e.g. Windows, OS2). mod_proxy_balancer failed to
     restart whenever the number of configured balancers/members changed during
     restart.  PR 58024.  [Yann Ylavic]

  *) core/util_script: make REDIRECT_URL a full URL.  PR 57785. [Nick Kew]

  *) MPMs: Support SO_REUSEPORT to create multiple duplicated listener
     records for scalability. [Yingqi Lu <yingqi.lu@intel.com>,
     Jeff Trawick, Jim Jagielski, Yann Ylavic]

  *) mod_proxy: Fix a race condition that caused a failed worker to be retried
     before the retry period is over. [Ruediger Pluem]

  *) mod_autoindex: Allow autoindexes when neither mod_dir nor mod_mime are
     loaded. [Eric Covener]

  *) mod_rewrite:  Allow cookies set by mod_rewrite to contain '':'' by accepting
     '';'' as an alternate separator.  PR47241. 
     [<bugzilla schermesser com>, Eric Covener]

  *) apxs: Add HTTPD_VERSION and HTTPD_MMN to the variables available with 
     apxs -q. PR58202. [Daniel Shahaf <danielsh apache.org>]

  *) mod_rewrite: Avoid a crash when lacking correct DB access permissions
     when using RewriteMap with MapType dbd or fastdbd.  [Christophe Jaillet]

  *) mod_authz_dbd: Avoid a crash when lacking correct DB access permissions.
     PR 57868. [Jose Kahan <jose w3.org>, Yann Ylavic]

  *) mod_socache_memcache: Add the ''MemcacheConnTTL'' directive to control how 
     long to keep idle connections with the memcache server(s).
     Change default value from 600 usec (!) to 15 sec. PR 58091
     [Christophe Jaillet]

  *) mod_dir: Prevent the internal identifier "httpd/unix-directory" from
     appearing as a Content-Type response header when requests for a directory
     are rewritten by mod_rewrite. [Eric Covener]

下载地址:Download

更多内容请查看:http://httpd.apache.org/

Apache HTTPd 2.4.49 路径穿越漏洞(CVE-2021-41773)复现

Apache HTTPd 2.4.49 路径穿越漏洞(CVE-2021-41773)复现

0x00 漏洞概述

2021 年 10 月 5 日,Apache 官方发布了一批漏洞信息,其中 Apache HTTP Server 路径穿越漏洞 CVE-2021-41773。

满足条件:

  • 版本等于 2.4.49
  • 穿越的目录允许被访问,比如配置了 Require all granted。(默认情况下是不允许的)

 

0x01 环境搭建

使用 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.conf

docker-compose.yml

version: ''2''
services:
apache:
  build: .
  ports:
  - "8080:80"

环境启动

docker-compose build
docker-compose up -d

 

0x02 漏洞复现

  • 访问靶机环境
    环境启动后,访问 http://your-ip:8080 即可看到 Apache 默认的 It works! 页面。

 

 

  • 文件读取复现

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

 

 

  • 命令执行复现

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

 

 

0x03 修复建议

升级至官方 .. 最新版本

更多渗透相关技术经验分享,学渗透来雨笋教育线上线下任你选择,就业进大厂!

Apache Httpd 与 Apache Tomcat

Apache Httpd 与 Apache Tomcat

介绍

    Apache 是Apache HTTP server 的缩写,提供很多features ,像CGI、SSL 和 virtual domains。当提到Apache 服务器的时候,指的是Apache HTTP Server。

    Tomcat 是WEB 容器,基于servlet 和 JSP, 也可以用作HTTP server。Tomcat 会预加载JVM和应用程序库,使用Jasper Converter 将JSP 转为servlets 来执行,Tomcat 需要JRE 环境。Catalina 是servlet 容器,有两个基本的模块:

  • A Connectoer:connect request to thecontainer。该连接器创建request obejcts 和 response objects.
  • A conntainer:是Tomcat服务响应和处理请求的真正服务器

一些相同点:

  • 都是apache 组织开发的
  • 两者都有http 服务的功能
  • 两者都是开源免费的

区别

    Apache 是普通服务器,本身只支持静态内容;Tomcat 可以支持动态jsp 网页。

    Apache 侧重HTTP server,Tomcat 侧重servlet 引擎。

    Apache 先与 Tomcat 开发的。

  Apache Tomcat
定义

Apache HTTP server

提供CGI、SSL 和virtual domains 服务

WEB 容器,运行web程序,基于JVM。

也可用作HTTP Server

速度(静态页面) 比较快 比较慢
可配置性 比较多 比较少
鲁棒性
支持项 CGI 脚本,Server API 模块,Perl, PHP 等等 支持servlet 和JSP
开发者

1995 年 Robert McCool Apache Software Foundation

Apache Software Foundation
维护者 Apache Software Foundation Apache Software Foundation
开发语言 C Java

 

   

 

Apache httpd 和 Easy Apache 4(为 python 应用程序安装 mod_wsgi)

Apache httpd 和 Easy Apache 4(为 python 应用程序安装 mod_wsgi)

如何解决Apache httpd 和 Easy Apache 4(为 python 应用程序安装 mod_wsgi)?

已经有一段时间了,但我遇到了一个问题,在其他地方找不到任何答案。

我为一台运行 Easy Apache 4 和 Centos 7 的专用服务器付费。我拥有对所有内容的 root 访问权限,因此没有任何限制。

我正在为客户端在服务器上部署 Python/Django 应用程序。当尝试安装 mod_wsgi 时,它会出错,指出它需要包 httpd-mmn。我可以使用 yum 安装 httpd 模块,但我担心会发生冲突,因为服务器使用的是 Easy Apache 4。

这是一个相关的问题吗?我的服务器上有一堆 PHP 站点,我担心我会破坏它。

为了记录,我不想使用实验性的easy apache mod wsgi,因为它是……实验性的,在您自担风险的情况下使用。

任何想法或建议都会很棒。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

我们今天的关于Apache HTTPD 多后缀解析漏洞apache2.4.7解析漏洞的分享已经告一段落,感谢您的关注,如果您想了解更多关于Apache httpd 2.4.17 发布、Apache HTTPd 2.4.49 路径穿越漏洞(CVE-2021-41773)复现、Apache Httpd 与 Apache Tomcat、Apache httpd 和 Easy Apache 4(为 python 应用程序安装 mod_wsgi)的相关信息,请在本站查询。

本文标签: