{"id":95,"date":"2026-05-26T12:52:21","date_gmt":"2026-05-26T04:52:21","guid":{"rendered":"https:\/\/reverier.cn\/?p=95"},"modified":"2026-05-26T12:53:18","modified_gmt":"2026-05-26T04:53:18","slug":"%e5%8f%8d%e5%ba%8f%e5%88%97%e5%8c%96wp","status":"publish","type":"post","link":"https:\/\/reverier.cn\/index.php\/2026\/05\/26\/%e5%8f%8d%e5%ba%8f%e5%88%97%e5%8c%96wp\/","title":{"rendered":"\u53cd\u5e8f\u5217\u5316wp"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u4ece 0 \u5f00\u59cb\u7684PHP\u53cd\u5e8f\u5217\u5316\u5165\u95e8\u9776\u573a--\u63a2\u59ec<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u9776\u573a\u5730\u5740<a href=\"http:\/\/125.77.172.32:9090\/\" target=\"_blank\"  rel=\"nofollow\" >http:\/\/125.77.172.32:9090\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Level1--\u7c7b\u7684\u5b9e\u4f8b\u5316<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">class FLAG{<br> &nbsp; &nbsp;public $flag_string = \"HelloCTF{\uff1f\uff1f\uff1f\uff1f}\";<br>\u200b<br> &nbsp; &nbsp;function __construct(){<br> &nbsp; &nbsp; &nbsp; &nbsp;echo $this-&gt;flag_string;<br> &nbsp;  }<br>}<br>\u200b<br>$code = $_POST['code'];<br>\u200b<br>eval($code);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e00\u9898\u7684\u601d\u8def\u5f88\u7b80\u5355<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">__construct()\u662f\u4e00\u4e2a\u6784\u9020\u51fd\u6570\uff0c\u5728\u5bf9\u8c61\u521b\u5efa\u65f6\u88ab\u8c03\u7528\uff0c\u7528\u4e8e\u521d\u59cb\u5316\u5bf9\u8c61<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u5206\u6790\u4e00\u4e0b\u8fd9\u6bb5\u4ee3\u7801\uff0c\u60f3\u8981\u62ff\u5230flag\u53ea\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\u5c31\u53ef\u4ee5\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5payload<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=new FLAG();<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Level2--\u5bf9\u8c61\u4e2d\u503c\u7684\u4f20\u9012<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">error_reporting(0);<br>\u200b<br> $flag_string = \"HelloCTF{\uff1f\uff1f\uff1f\uff1f}\";<br> <br> class FLAG{<br> &nbsp; &nbsp; &nbsp; &nbsp;public $free_flag = \"???\";<br>\u200b<br> &nbsp; &nbsp; &nbsp; &nbsp;function get_free_flag(){<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo $this-&gt;free_flag;<br> &nbsp; &nbsp; &nbsp;  }<br> &nbsp;  }<br>$target = new FLAG();<br>\u200b<br>$code = $_POST['code'];<br>\u200b<br>if(isset($code)){<br> &nbsp; &nbsp; &nbsp; eval($code);<br> &nbsp; &nbsp; &nbsp; $target-&gt;get_free_flag();<br>}<br>else{<br> &nbsp; &nbsp;highlight_file('source');<br>}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e00\u9898\u6709\u4e00\u4e2a\u66b4\u529b\u89e3\u5c31\u662f\u76f4\u63a5\u8f93\u51fafalg_string<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=echo $flag_string;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\u8fd9\u6837\u5e76\u6ca1\u6709\u53bb\u5229\u7528\u8fd9\u4e2a\u4ee3\u7801\u5229\u7528\u94fe<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148code\u4f1a\u88abeval<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540etarget\u53d8\u91cfnew\u4e86\u4e00\u4e2aFLAG<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FLAG\u91cc\u9762\u6709\u4e00\u4e2a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">echo $this-&gt;free_flag;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u6709\u4e00\u4e2aecho\u53ef\u4ee5\u8f93\u51fa\u5185\u5bb9\uff0c\u6240\u4ee5\u6211\u4eec\u5c06free_flag\u7684\u503c\u5f3a\u884c\u8d4b\u503c\u4e3a$flag_string\uff0c\u5c31\u53ef\u4ee5\u8f93\u51fa\u771f\u6b63\u7684falg<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>payload:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=$target-&gt;free_flag=$flag_string;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u94fe\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=target<br>\u7136\u540etarget\u53bb\u8bbf\u95eefree_flag\u8fd9\u4e2a\u5c5e\u6027<br>\u7136\u540e\u518d\u5c06free_flag\u7684\u503c\u5f3a\u884c\u6539\u4e3a$flag_string<br>\u518d\u6267\u884c$target-&gt;get_free_flag();<br>\u8fd9\u4e2a\u51fd\u6570\u6709\u4e00\u4e2aecho $this-&gt;free_flag;<br>\u8fd9\u624d\u662f\u6700\u7ec8\u80fd\u8f93\u51fafalg\u7684\u5173\u952e<br>payload\u7684\u4f5c\u7528\u53ea\u662f\u628afree_flag\u7684\u503c\u7ed9\u4fee\u6539\u4e86\u4f46\u662f\u5e76\u6ca1\u6709\u8f93\u51fa\u8bed\u53e5<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Level3--\u5bf9\u8c61\u4e2d\u503c\u7684\u6743\u9650<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">class FLAG{<br> &nbsp; &nbsp;public $public_flag = \"HelloCTF{?\";<br> &nbsp; &nbsp;protected $protected_flag = \"?\";<br> &nbsp; &nbsp;private $private_flag = \"?}\";<br>\u200b<br> &nbsp; &nbsp;function get_protected_flag(){<br> &nbsp; &nbsp; &nbsp; &nbsp;return $this-&gt;protected_flag;<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;function get_private_flag(){<br> &nbsp; &nbsp; &nbsp; &nbsp;return $this-&gt;private_flag;<br> &nbsp;  }<br>}<br>\u200b<br>class SubFLAG extends FLAG{<br> &nbsp; &nbsp;function show_protected_flag(){<br> &nbsp; &nbsp; &nbsp; &nbsp;return $this-&gt;protected_flag;<br> &nbsp;  }<br>\u200b<br> &nbsp; &nbsp;function show_private_flag(){<br> &nbsp; &nbsp; &nbsp; &nbsp;return $this-&gt;private_flag;<br> &nbsp;  }<br>}<br>\u200b<br>$target = new FLAG();<br>$sub_target = new SubFLAG();<br>\u200b<br>\u200b<br>$code = $_POST['code'];<br>\u200b<br>if(isset($code)){<br> &nbsp; &nbsp;eval($code);<br>} else {<br> &nbsp; &nbsp;highlight_file(__FILE__);<br> &nbsp; &nbsp;echo \"Trying to get FLAG...&lt;br&gt;\";<br> &nbsp; &nbsp;echo \"Public Flag: \".$target-&gt;public_flag.\"&lt;br&gt;\";<br> &nbsp; &nbsp;echo \"Protected Flag:\".$target-&gt;protected_flag .\"&lt;br&gt;\";<br> &nbsp; &nbsp;echo \"Private Flag:\".$target-&gt;private_flag .\"&lt;br&gt;\";<br>}<br>\u200b<br>?&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e00\u9898\u6709\u4e00\u4e2a\u5751\uff0c\u6211\u4e00\u5f00\u59cb\u60f3\u8981\u53bb\u8c03\u7528\u8fd9\u4e2a\u5bf9\u8c61<strong>class SubFLAG<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\u8fd9\u91cc\u6709\u4e00\u4e2a\u95ee\u9898\u5c31\u662fSubFLAG\u867d\u7136\u7ee7\u627f\u4e86FLAG\u5c5e\u6027\uff0c\u4f46\u662f\u5b50\u7c7b SubFLAG \u6839\u672c\u7ee7\u627f\u4e0d\u5230\u7236\u7c7b\u7684 private \u5c5e\u6027\uff0c\u81ea\u7136\u4e5f\u5c31 return \u4e0d\u51fa\u6765\u3002\u8fd9\u4e5f\u662f protected \u548c private \u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\u6700\u5927\u7684\u533a\u522b\u6240\u5728\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u95ee\u9898\u6765\u4e86\u4e3a\u4ec0\u4e48$target-&gt;protected_flag \u4e0d\u80fd\u76f4\u63a5\u83b7\u53d6\u5230\u5bf9\u5e94\u7684\u503c\u5462<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3aprotected_flag\u662f\u53d7\u4fdd\u62a4\u7684\u5c5e\u6027\uff0c\u5916\u90e8\u4e0d\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\uff0c\u53ea\u80fd\u5185\u90e8\u53bb\u8c03\u7528\uff0cFLAG \u7c7b\u91cc\u9762\u5199\u4e86\u4e00\u4e2a\u516c\u5f00\u7684\u65b9\u6cd5 get_protected_flag()\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$target-&gt;public_flag (Public):<br>\u8fd9\u662f\u516c\u5f00\u5c5e\u6027\u3002\u5c31\u50cf\u6446\u5728\u9a6c\u8def\u8fb9\u7684\u516c\u5171\u81ea\u884c\u8f66\uff0c\u8c01\u90fd\u53ef\u4ee5\u76f4\u63a5\u62ff\u6765\u7528\u3002\u6240\u4ee5\u5728\u7c7b\u5916\u90e8\u53ef\u4ee5\u76f4\u63a5 -&gt; \u8bbf\u95ee\u3002<br><br>$target-&gt;get_protected_flag() (Protected):<br>protected \u662f\u53d7\u4fdd\u62a4\u7684\u5c5e\u6027\u3002\u5b83\u53ea\u5141\u8bb8\u7c7b\u81ea\u5df1\u5185\u90e8\u4ee5\u53ca\u7ee7\u627f\u5b83\u7684\u5b50\u7c7b\uff08\u6bd4\u5982 SubFLAG\uff09\u8bbf\u95ee\u3002\u4f60\u5728\u5916\u90e8\u76f4\u63a5\u5199 $target-&gt;protected_flag \u4f1a\u62a5\u9519\uff0c\u4f46\u662f\u51fa\u9898\u4eba\u5728 FLAG \u7c7b\u91cc\u9762\u5199\u4e86\u4e00\u4e2a\u516c\u5f00\u7684\u65b9\u6cd5 get_protected_flag()\u3002\u6211\u4eec\u8c03\u7528\u8fd9\u4e2a\u516c\u5f00\u7684\u65b9\u6cd5\uff0c\u8ba9\u7c7b\u81ea\u5df1\u628a\u5185\u90e8\u7684\u5c5e\u6027\u9012\u51fa\u6765\u7ed9\u6211\u4eec\u3002<br><br>$target-&gt;get_private_flag() (Private):<br>private \u662f\u6700\u4e25\u683c\u7684\u79c1\u6709\u5c5e\u6027\u3002\u5b83\u53ea\u80fd\u5728\u5b9a\u4e49\u5b83\u7684\u7c7b\uff08FLAG\uff09\u5185\u90e8\u8bbf\u95ee\uff0c\u8fde\u7ee7\u627f\u5b83\u7684\u4eb2\u513f\u5b50\uff08\u5b50\u7c7b SubFLAG\uff09\u90fd\u770b\u4e0d\u5230\uff01\u540c\u6837\u5730\uff0c\u6211\u4eec\u901a\u8fc7\u8c03\u7528 FLAG \u7c7b\u516c\u5f00\u7684 get_private_flag() \u65b9\u6cd5\u987a\u5229\u62ff\u5230\u6700\u540e\u4e00\u6bb5\u3002<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5payload\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=echo $target-&gt;public_flag.$target-&gt;get_protected_flag().$target-&gt;get_private_flag();<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Level4--\u5e8f\u5217\u5316\u521d\u4f53\u9a8c<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">class FLAG3{<br>    private $flag3_object_array = array(\"\uff1f\",\"\uff1f\");<br>}<br><br>class FLAG{<br>     private $flag1_string = \"\uff1f\";<br>     private $flag2_number = '?';<br>     private $flag3_object;<br><br>    function __construct() {<br>        $this-&gt;flag3_object = new FLAG3();<br>    }<br>}<br><br>$flag_is_here = new FLAG();<br><br><br>$code = $_POST['code'];<br><br>if(isset($code)){<br>    eval($code);<br>} else {<br>    highlight_file(__FILE__);<br>}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9605\u8bfb\u4ee3\u7801\u53d1\u73b0\u65e0\u8bba\u662fFLAG\u8fd8\u662fFLAG3\u90fd\u6ca1\u6709\u8f93\u51fa\u7684\u8bed\u53e5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">code=echo<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u89c2\u5bdf\u53d1\u73b0\u91cc\u9762\u7684\u6240\u6709\u5bf9\u8c61\u90fd\u662fprivate\uff0c\u6240\u4ee5\u6211\u4eec\u662f\u4e0d\u53ef\u4ee5\u76f4\u63a5\u4ece\u5916\u90e8\u8fdb\u884c\u8bfb\u53d6\u7684<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u6211\u4eec\u7684\u601d\u8def\u5c31\u662f\u4ecephp\u4e2d\u627e\u4e00\u4e9b\u5728\u6267\u884c\u65f6\u6743\u9650\u6781\u5927\u5e76\u4e14\u53ef\u4ee5\u65e0\u89c6protect\u548cprivate\u6743\u9650\u7684\u51fd\u6570\uff0c\u8ba9\u4ed6\u4eec\u8fdb\u884c\u6253\u5370<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u8fd9\u91cc\u7684payload\u5c31\u6709\u597d\u51e0\u4e2a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">code=var_dump($flag_is_here);<br>code=print_r($flag_is_here);<br>code=echo serialize($flag_is_here);<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ece 0 \u5f00\u59cb\u7684PHP\u53cd\u5e8f\u5217\u5316\u5165\u95e8\u9776\u573a&#8211;\u63a2\u59ec \u9776\u573a\u5730\u5740http:\/\/125.77.172.32:9090\/ Level1&#8211;\u7c7b\u7684\u5b9e &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[10,7],"tags":[],"class_list":["post-95","post","type-post","status-publish","format-standard","hentry","category-web","category-7"],"_links":{"self":[{"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/posts\/95","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/comments?post=95"}],"version-history":[{"count":1,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":97,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/posts\/95\/revisions\/97"}],"wp:attachment":[{"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/media?parent=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/categories?post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reverier.cn\/index.php\/wp-json\/wp\/v2\/tags?post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}