0%

今天在学习php伪协议的时候,发现了一个很有意思的用法iconv。

首先看看今天遇到的题目

可以看到我们以往正常使用php伪协议读取文件的方法被过滤了,经过测试encode,read字段都被过滤。

经过查询找到了一种新的方法:iconv。官方对其介绍如下:

在激活 iconv 的前提下可以使用 convert.iconv.* 压缩过滤器,等同于用 iconv() 处理所有的流数据。该过滤器不支持参数,但可使用输入/输出的编码名称,组成过滤器名称,比如 convert.iconv..或convert.iconv./(两种写法的语义都相同)。

也就是说,我们可以使用iconv伪协议来执行iconv函数,从而实现文件编码的转换。

已知iconv后面要输入和输出2种编码我们先去php官网查看php目前支持的编码然后使用burpsuite抓包爆破。找到有回显的请求包使用的编码构造payload

得到flag

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment