<?php highlight_file(__FILE__); class User { public $username; public $value; public functionexec() { $ser = unserialize(serialize(unserialize($this->value))); if ($ser != $this->value && $ser instanceof Access) { include($ser->getToken()); } } public function__destruct() { if ($this->username == "admin") { $this->exec(); } } }
class Access { protected $prefix; protected $suffix;
public functiongetToken() { if (!is_string($this->prefix) || !is_string($this->suffix)) { throw new Exception("Go to HELL!"); } $result = $this->prefix . 'lilctf' . $this->suffix; if (strpos($result, 'pearcmd') !== false) { throw new Exception("Can I have peachcmd?"); } return$result;
class User { public $username=0; public $value; public functionexec() { $ser = unserialize(serialize(unserialize($this->value))); if ($ser != $this->value && $ser instanceof Access) { include($ser->getToken()); } } public function__destruct() { if ($this->username == "admin") { $this->exec(); } } }
class Access { protected $prefix='/'; protected $suffix='/../flag';
public functiongetToken() { var_dump($this->prefix); if (!is_string($this->prefix) || !is_string($this->suffix)) { throw new Exception("Go to HELL!"); } $result = $this->prefix . 'lilctf' . $this->suffix; if (strpos($result, 'pearcmd') !== false) { throw new Exception("Can I have peachcmd?"); } return$result;
import random defuuid8(a=None, b=None, c=None): """Generate a UUID from three custom blocks. * 'a' is the first 48-bit chunk of the UUID (octets 0-5); * 'b' is the mid 12-bit chunk (octets 6-7); * 'c' is the last 62-bit chunk (octets 8-15). When a value is not specified, a pseudo-random value is generated. """ # 生成伪随机值(若参数未指定) if a isNone: a = random.getrandbits(48) if b isNone: b = random.getrandbits(12) if c isNone: c = random.getrandbits(62)