buuctf-[BSidesCF 2020]Had a bad day(小宇特详解)
先看一下题目

这里上面有注入点,这里怀疑是SQL注入
先尝试读取一下index.php
这里使用php伪协议
payload:
php:
 
存在文件包含漏洞,但是这里报错了,分析之后是无法打开流:操作失败
这里去除php后缀
payload
php:

解码之后找到index.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才行
这里构造payload来包含flag.php
/index.php?category=woofers/../flag

那如何去获取flag.php的内容呢
这里使用的知识点是php://filter伪协议套协议
payload:
/index.php?category=php:

base64解码

|