<?php class Show { public $source = '/flag'; public $str; public function __toString() { var_dump('__toString'); $text= $this->source; $text = base64_encode(file_get_contents($text)); return $text; } public function __set($key,$value) { $this->$key = $value; } public function _show() { var_dump($this->source); if(preg_match('/http|https|file:|gopher|dict|\.\.|flag/i',$this->source)) { die('hacker!'); } else { highlight_file($this->source); }
} public function __wakeup() { if(preg_match("/http|https|file:|gopher|dict|\.\./i", $this->source)) { echo "hacker~"; $this->source = "index.php"; } } } class S6ow { public $file; public $params = array('_show'=>'file_get'); public function __get($key) { return $this->params[$key]; } public function __call($name, $arguments) { if($this->{$name}) $this->{$this->{$name}}($arguments); } public function file_get($value) { var_dump('file_get'); var_dump($this->file); echo $this->file; }
public function setter($obj) { $this->file = $obj; } }
class Sh0w { public $test; public $str; public function __destruct() { $this->str->_show(); } }
$sh0w = new Sh0w(); $s6ow = new S6ow(); $show = new Show();