分析代码可知,file2包含在file_get_contents(相当一个一体式的文件函数,类似的还有
readfile()、 file()),所以用php://filter的base64进行读取
php://filter 是php中独有的一个协议,可以作为一个中间流来处理其他流,可以进行任意文件的读取
php://filter 的 参数列表
read 读取
write 写入
resource 数据来源(必须的)
read参数值可为
string.strip_tags 将数据流中的所有html标签清除
string.toupper 将数据流中的内容转换为大写
string.tolower 将数据流中的内容转换为小写convert.base64-encode 将数据流中的内容转换为base64编码
convert.base64-decode 与上面对应解码
file1则包含在include函数中,可以用php://input协议绕过
根据题目提示,我们应该获取当前目录下flag.php的文件内容
最后post所需要输出的hello ctf即可