全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3115|回复: 11

Nginx %00空字节执行任意代码(php)漏洞

[复制链接]
发表于 2011-8-26 21:11:39 | 显示全部楼层 |阅读模式
影响版本:
nginx 0.5.*
nginx 0.6.*
nginx 0.7 <= 0.7.65
nginx 0.8 <= 0.8.37

漏洞描述:
Possible Arbitrary Code Execution with Null Bytes, PHP, and Old Versions of nginx

Ngnix在遇到%00空字节时与后端FastCGI处理不一致,导致可以在图片中嵌入PHP代码然后通过访问xxx.jpg%00.php来执行其中的代码

In vulnerable versions of nginx, null bytes are allowed in URIs by default (their presence is indicated via a variable named zero_in_uri defined in ngx_http_request.h).

Individual modules have the ability to opt-out of handling URIs with null bytes. However, not all of them do; in particular, the FastCGI module does not.
<*参考
https://nealpoole.com/blog/2011/ ... -versions-of-nginx/
*>

测试方法:
[sebug.net]
本站提供程序(方法)可能带有攻击性,仅供安全研究与教学之用,风险自负!
The attack itself is simple: a malicious user who makes a request to http://example.com/file.ext%00.php causes file.ext to be parsed as PHP.

If an attacker can control the contents of a file served up by nginx (ie: using an avatar upload form) the result is arbitrary code execution. This vulnerability can not be mitigated by nginx configuration settings like try_files or PHP configuration settings like cgi.fix_pathinfo: the only defense is to upgrade to a newer version of nginx or to explicitly block potentially malicious requests to directories containing user-controlled content.

SEBUG安全建议:

解决方案
升级nginx版本
http://nginx.org
发表于 2011-8-26 21:12:40 | 显示全部楼层
发表于 2011-8-26 21:14:00 | 显示全部楼层
这个字节?这个不是win系统下的漏洞么
发表于 2011-8-26 21:15:13 | 显示全部楼层
不是發過 了嗎?
发表于 2011-8-26 21:18:19 | 显示全部楼层
之前就有了
发表于 2011-8-26 21:34:35 | 显示全部楼层
关注
发表于 2011-8-26 21:35:09 | 显示全部楼层
最新版路过
发表于 2011-8-26 21:42:30 | 显示全部楼层
我今天部署了几个,升到1.1.1了,LNMP有一键脚本,还是很方便的。
发表于 2011-8-26 21:44:39 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2011-8-26 21:47:09 | 显示全部楼层
新版路过。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-9-21 08:08 , Processed in 0.062382 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表