[ZJCTF 2019]NiZhuanSiWei
打开页面显示一段php代码
<?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__);
}
?> 审计
接收三个Get参数text、file、password
$text不能为空
获取$text文件的内容必须等于welcome to the zjctf
$file不能存在flag关键词
包含$file文件(提示useless.php),反序列化$password的内容
尝试构造payload
使用远程文件绕过text检测,使用php://filter过滤器读取useless.php源代码

解码得到:
构造反序列化
完整Payload

Get Flag!
最后更新于
这有帮助吗?