notrequired

1. 基础判断

打开会自动跳转到/index.php?file=index.html

尝试任意文件读取,成功读取 /etc/passwd

image-20211009152022188

2. 读取文件

使用php://filter过滤器读取index.php的base64编码字符串

image-20211009152211244

解码得到:

<?php

if(!isset($_GET["file"])){
    header("location: http://ctf.bennetthackingcommunity.cf:8333/index.php?file=index.html");
    exit;
}

else{
    require($_GET['file']);
}

#note to myself: delete /bin/secrets.txt!
?>

根据提示,读取 /bin/secrets.txt

image-20211009152437906

BUHC替换为DO即为Flag。

Get Flag!

最后更新于

这有帮助吗?