Tag Archives: fix_pathinfo漏洞
[警示]Nginx + PHP CGI的安全漏洞:fix_pathinfo
如果你正在使用nginx+php,请关注。 表像: 具体的重现过程,用php代码修改后缀名后上传,比如说www.xxx.com/1.jpg,访问的时候用www.xxx.com/1.jpg/xxx.php 这段jpg代码将会被执行!!! http://docs.php.net/manual/zh/ini.core.php cgi.fix_pathinfo "1" PHP_INI_ALL 从 PHP 4.3.0 起可用 请注意:默认为1 解决办法: 1.修改php.ini中的cgi.cgi.fix_pathinfo为0(即使你在php.ini中没有搜到,也要设置,没有搜到表示默认为1) 2.判断文件上传类型时使用严格的判断,至于怎么判断,参见:http://www.54chen.com/php-tech/php-upload-file-types-to-determine-the-complete-program-and-php-nginx-upload-size-and-complete-control-program.html 3.把nginx的判断正则修改为去除/ if ( $fastcgi_script_name ~ \..*\/.*php ) { return 403; } 鸟哥在http://www.laruence.com/2010/05/20/1495.html一文中提及此事。
SEARCH
Update
- 54chen Twitter memo 2012-02-12
- 人肉解析riak_admin join
- go语言安装手记
- 54chen Twitter memo 2012-02-05
- Riak Core说明
- maven库nexus拖不到jar包小记
- 服务接入层小结
- 54chen Twitter memo 2012-01-15
- nginx防hashdos模块使用帮助
- 54chen Twitter memo 2012-01-08
- nginx防hashdos模块释出
- 54chen Twitter memo 2012-01-01
- 水煮鱼杯2011年度不得不总结的十件事
- 年终攻击hashDos-哈希表多碰撞实现拒绝服务-破解办法
- 54chen Twitter memo 2011-12-25
