请问这里有什么问题吗,php反序列化字符串逃逸
ctf吧
全部回复
仅看楼主
level 1
AshzzzA💫 楼主
参考https://www.cnblogs.com/NPFS/p/13338789.html
源码:
<?phpfunction text($str){ return str_replace('x', '66', $str);}$name = $_GET['name'];$sigh = 'hello everyone';$user = array($name, $sigh);
$r = text(serialize($user));echo $r;echo "<br>";$fake = unserialize($r);echo $fake[0];echo "<br>";echo $fake[1];echo "<br>";var_dump($fake);?>
<!-- <?php error_reporting(0); class a { public $uname; public $password; public function __construct($uname, $password) { $this->uname = $uname; $this->password = $password; } public function __wakeup() { if ($this->password === 'yu22x') { // include('flag.php'); echo "flag"; } else { echo 'wrong password'; } } } function filter($string) { return str_replace('Firebasky', 'Firebaskyup', $string); } $uname = $_GET['uname']; $password = 1; $ser = filter(serialize(new a($uname, $password))); $test = unserialize($ser); echo "<br>"; echo $ser; echo "<br>"; echo $test->uname, "<br>", $test->password; echo "<br>"; var_dump($test) ?> -->
2023年09月28日 09点09分 1
1