NSSCTF
[ZJCTF 2019]NiZhuanSiWei
<?php
$text = $_GET["text"];
$file = $_GET["file"];
$password = $_GET["password"];
if(isset($text)&&(file_get_contents($text,'r')==="welcome to the zjctf")){
echo "<br><h1>".file_get_contents($text,'r')."</h1></br>";
if(preg_match("/flag/",$file)){
echo "Not now!";
exit();
}else{
include($file); //useless.php
$password = unserialize($password);
echo $password;
}
}
else{
highlight_file(__FILE__);
}
?>
审计源码得知text参数需要完全等于welcome to the zjctf
直接使用伪协议input进去就好,传参file查看一下提示的php源码一个php://filter/read=convert.iconv.utf8.utf16/resource=useless.php
burp发包
首页代码审计发现对password参数进行了反序列化,且useless文件有个读取文件的类,直接构造反序列化payload即可。
然后进行发包获取到flag。
[鹤城杯 2021]EasyP
代替下划线: 绕过下划线的话可以考虑用 加号(+) 左中括号([) 空格( ) 点号(.)
/index.php/utils.php/%80?show[source