{"id":996,"date":"2025-01-18T23:14:32","date_gmt":"2025-01-18T15:14:32","guid":{"rendered":"http:\/\/gzxingyu.cloud\/?p=996"},"modified":"2025-01-18T23:14:33","modified_gmt":"2025-01-18T15:14:33","slug":"hubuctf-2022-%e6%96%b0%e7%94%9f%e8%b5%9bcheckin","status":"publish","type":"post","link":"http:\/\/gzxingyu.cloud\/index.php\/2025\/01\/18\/hubuctf-2022-%e6%96%b0%e7%94%9f%e8%b5%9bcheckin\/","title":{"rendered":"HUBUCTF 2022 \u65b0\u751f\u8d5bcheckin"},"content":{"rendered":"<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='Pasted image 20241207231221.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"Pasted image 20241207231221.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\"><\/div><br \/>\n1.\u5ba1\u8ba1\u4ee3\u7801<br \/>\n<img decoding=\"async\" src=\"Pasted image 20241207231302.png\" alt=\"\"><\/p>\n<pre><code class=\"language-php\">&lt;?php\n\/\/ \u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684\u6e90\u4ee3\u7801\nshow_source(__FILE__);\n \n\/\/ \u5b9a\u4e49\u7528\u6237\u540d\u548c\u5bc6\u7801\n$username  = &quot;this_is_secret&quot;; \n$password  = &quot;this_is_not_known_to_you&quot;; \n \n\/\/ \u5305\u542bflag.php\u6587\u4ef6\uff0c\u8fd9\u91cc\u6211\u4fee\u6539\u4e86\u90a3\u4e24\u4e2a\u503c\ninclude(&quot;flag.php&quot;);\/\/here I changed those two\n \n\/\/ \u83b7\u53d6\u540d\u4e3a'info'\u7684GET\u53c2\u6570\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5219\u9ed8\u8ba4\u4e3a\u7a7a\u5b57\u7b26\u4e32\n$info = isset($_GET['info']) ? $_GET['info'] : &quot;&quot;;\n \n\/\/ \u5bf9\u83b7\u53d6\u7684\u4fe1\u606f\u8fdb\u884c\u53cd\u5e8f\u5217\u5316\n$data_unserialize = unserialize($info);\n \n\/\/ \u68c0\u67e5\u53cd\u5e8f\u5217\u5316\u540e\u7684\u6570\u636e\u4e2d\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u662f\u5426\u4e0e\u5b9a\u4e49\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u5339\u914d\nif ($data_unserialize['username'] == $username &amp;&amp; $data_unserialize['password'] == $password) {\n    \/\/ \u5982\u679c\u5339\u914d\uff0c\u663e\u793aflag\n    echo $flag;\n} else {\n    \/\/ \u5982\u679c\u4e0d\u5339\u914d\uff0c\u663e\u793a\u9519\u8bef\u6d88\u606f\n    echo &quot;username or password error!&quot;;\n}\n?&gt;\n<\/code><\/pre>\n<p>\u6240\u4ee5\u8981\u53cd\u5e8f\u5217\u5316username\u5f31\u7b49\u4e8eusername\u4ee5\u53ca\u53cd\u5e8f\u5217\u5316password\u5f31\u7b49\u4e8epassword\uff0c\u8f93\u51faflag<\/p>\n<p>2.payload\u6784\u9020\u601d\u8def\uff1a<br \/>\n\u7b2c\u4e00\u5c42\uff1a\u7528\u6237\u540d\u548c\u5bc6\u7801\u5148\u88ab\u4fee\u6539\u4e86\uff0c\u53ef\u7528\u5173\u8054\u6570\u7ec4\u91cd\u65b0\u5b9a\u4e49\u3002<\/p>\n<p>\u7b2c\u4e8c\u5c42\uff1a\u68c0\u67e5\u53cd\u5e8f\u5217\u5316\u540e\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u65f6\u4f7f\u7528\u4e86== \u5f31\u6bd4\u8f83\uff0c\u6545\u53ef\u5c06\u6570\u7ec4\u4e2d\u7684\u503c\u5168\u90e8\u8bbe\u7f6e\u4e3a\u5e03\u5c14\u503c true\u3002<\/p>\n<p>3.\u4ee3\u7801\u6784\u9020\uff1a<\/p>\n<pre><code class=\"language-php\">&lt;?php\n$demo=array(&quot;username&quot;=&gt;true,&quot;password&quot;=&gt;true);\necho serialize($demo);\n?&gt;\n<\/code><\/pre>\n<p>\u8f93\u51fa\uff1a<\/p>\n<pre><code>a:2:{s:8:&quot;username&quot;;b:1;s:8:&quot;password&quot;;b:1;}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"Pasted image 20241207233517.png\" alt=\"\"><\/p>\n<h3>\u603b\u7ed3<\/h3>\n<ul>\n<li>\u4f7f\u7528php\u5173\u8054\u6570\u7ec4\u53cd\u5e8f\u5217\u5316<\/li>\n<li>\u5f31\u6bd4\u8f83 \uff1a\u5728\u5f31\u6bd4\u8f83\u4e2d\uff0c\u5e03\u5c14\u503c true \u548c\u4efb\u4f55\u503c\u5f31\u6bd4\u8f83\u90fd\u76f8\u7b49\uff0c\u9664\u4e86 0 \u548c false<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1.\u5ba1\u8ba1\u4ee3\u7801 &lt;?php \/\/ \u663e\u793a\u5f53\u524d\u6587\u4ef6\u7684\u6e90\u4ee3\u7801 show_source(__FILE__); \/\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,22,23],"tags":[37,32],"class_list":["post-996","post","type-post","status-publish","format-standard","hentry","category-ctf","category-ctf-web","category-nssctf","tag-37","tag-32"],"_links":{"self":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/996","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=996"}],"version-history":[{"count":1,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/996\/revisions"}],"predecessor-version":[{"id":997,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/996\/revisions\/997"}],"wp:attachment":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=996"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}