有人试图破解我的网站,想了解日志

我有一个在CentOS 6上托pipe的wordpress网站。看到下面的访问日志,我检查了服务器,看起来好。 任何人都可以解释这家伙试图做什么? 他们得到了他们想要的东西吗?

我禁用了allow_url_include,并将open_basedir限制为web dir和tmp(/ etc不在path中)。

190.26.208.130 - - [05/Sep/2012:21:24:42 -0700] "POST http://my_ip/?-d%20allow_url_include%3DOn+-d%20auto_prepend_file%3D../../../../../../../../../../../../etc/passwd%00%20-n/?-d%20allow_url_include%3DOn+-d%20auto_prepend_file%3D../../../../../../../../../../../../etc/passwd%00%20-n HTTP/1.1" 200 32656 "-" "Mozilla/5.0"

首先看一下CVE-2012-1823 。

上面的URL被解码为:

http://my_ip/?-d allow_url_include=On+-d auto_prepend_file=../../../../../../../../../../../../etc/passwd -n/?-d allow_url_include=On+-d auto_prepend_file=../../../../../../../../../../../../etc/passwd -n

?-d allow_url_include=On :他正在尝试在php-cgi调用中添加一个额外的参数:

 $ php-cgi -h Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>] php <file> [args...] -d foo[=bar] Define INI entry foo with value 'bar' 

+-d auto_prepend_file=../../../../../../../../../../../../etc/passwd -n :prepend他的文件作为代码来执行。 不知道他为什么使用Path Traversal攻击,而不是使用他的代码或php://input

-n最后否定php.ini

 $ php-cgi -h Usage: php [-q] [-h] [-s] [-v] [-i] [-f <file>] php <file> [args...] -n No php.ini file will be used 

PS:不需要担心,如果你没有运行PHP作为CGI脚本。