{"id":1950,"date":"2025-07-16T00:45:06","date_gmt":"2025-07-15T16:45:06","guid":{"rendered":"https:\/\/www.xiaosuigu.top\/?p=1950"},"modified":"2025-11-03T16:34:11","modified_gmt":"2025-11-03T08:34:11","slug":"mt-h5%e5%8f%82%e6%95%b0%e9%80%86%e5%90%91%e5%bf%83%e5%be%97","status":"publish","type":"post","link":"https:\/\/www.xiaosuigu.top\/index.php\/2025\/07\/16\/mt-h5%e5%8f%82%e6%95%b0%e9%80%86%e5%90%91%e5%bf%83%e5%be%97\/","title":{"rendered":"\u4e11\u56e2-H5\u53c2\u6570\u9006\u5411\u5fc3\u5f97"},"content":{"rendered":"\n<p><mark>\u672c\u6587\u7ae0\u4e2d\u6240\u6709\u5185\u5bb9\u4ec5\u4f9b\u5b66\u4e60\u4ea4\u6d41\u4f7f\u7528\uff0c\u4e0d\u7528\u4e8e\u5176\u4ed6\u4efb\u4f55\u76ee\u7684\uff0c\u4e0d\u63d0\u4f9b\u5b8c\u6574\u4ee3\u7801\u4e25\u7981\u7528\u4e8e\u5546\u4e1a\u7528\u9014\u548c\u975e\u6cd5\u7528\u9014\uff0c\u5426\u5219\u7531\u6b64\u4ea7\u751f\u7684\u4e00\u5207\u540e\u679c\u5747\u4e0e\u4f5c\u8005\u65e0\u5173\uff01<\/mark><\/p>\n\n\n\n<p><mark>\u672c\u6587\u7ae0\u672a\u7ecf\u8bb8\u53ef\u7981\u6b62\u8f6c\u8f7d\uff0c\u7981\u6b62\u4efb\u4f55\u4fee\u6539\u540e\u4e8c\u6b21\u4f20\u64ad\uff0c\u64c5\u81ea\u4f7f\u7528\u672c\u6587\u8bb2\u89e3\u7684\u6280\u672f\u800c\u5bfc\u81f4\u7684\u4efb\u4f55\u610f\u5916\uff0c\u4f5c\u8005\u5747\u4e0d\u8d1f\u8d23\uff0c\u82e5\u6709\u4fb5\u6743\uff0c\u8bf7\u8054\u7cfb\u4f5c\u8005\u7acb\u5373\u5220\u9664\uff01<\/mark><\/p>\n\n\n\n<p>\u672c\u7bc7\u6587\u7ae0\u90fd\u662f\u5728\u7f51\u7edc\u5176\u4ed6\u6587\u7ae0\u7684\u57fa\u7840\u4e0a\u8fdb\u884c\u5206\u6790\u7684\uff0c\u56e0\u6b64\u6709\u4e9b\u5730\u65b9\u53ef\u80fd\u53ef\u80fd\u4f1a\u53d1\u51fa\u6000\u7591\u4f60\u662f\u600e\u4e48\u627e\u5230\u7684\uff0c\u5f53\u7136\u6211\u4f1a\u5c3d\u91cf\u5199\u8be6\u7ec6\u70b9\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AST\u8fd8\u539f<\/h2>\n\n\n\n<p>\u8fd8\u539f\u4ee3\u7801\u7f51\u7edc\u4e0a\u8fd8\u662f\u5f88\u591a\uff0c\u627e\u627e\u4e5f\u80fd\u7528\uff0c\u4f46\u8fd8\u662f\u6709\u90e8\u5206\u4ee3\u7801\u9700\u8981\u81ea\u5df1\u5199\u4e0b\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const a = &#91;\"9bfdeef5f8eff2f4f5\", \"13727e77\",....] \/\/ \u5927\u6570\u7ec4\nfunction b(c, d) {\n    var e = a&#91;c -= 0];\n    ...\/\/ \u5c31\u662f\u8001\u662f\u8fdb\u6765\u7684\u90a3\u4e2a\u65b9\u6cd5\n}\nconst vis1 = {\n    \"CallExpression\"(path) {\n        let {callee, arguments} = path.node;\n        if (types.isIdentifier(callee, {'name': 'b'})) {\n            try {\n                let value = eval(path.toString())\n                path.replaceWith(types.valueToNode(value));\n            } catch (e) {\n                console.log(e);\n            }\n        }\n    }\n}\ntraverse(ast, vis1)<\/code><\/pre>\n\n\n\n<p>\u6709\u51e0\u4e2a\u5730\u65b9\u4f1a\u8fd8\u539f\u5931\u8d25\u4e86\uff0c\u4f46\u662f\u90fd\u6253\u5370\u51fa\u6765\u4e86\uff0c\u624b\u52a8\u8fd8\u539f\u4e0b\u5c31\u884c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8c03\u7528<\/h2>\n\n\n\n<p>\u4e07\u4e8b\u90fd\u6709\u4e2a\u5f00\u5934\uff0c\u6240\u4ee5\u6211\u4eec\u4e5f\u8981\u5148\u77e5\u9053\u4ed6\u662f\u8c03\u7528\u54ea\u4e2a\u65b9\u6cd5\u751f\u6210\u7684\u3002\u5b9e\u9645\u4e0a\u53ea\u8981\u4f60\u7f51\u7edc\u4e0a\u641c\u7d22\u7684\u591a\u5c31\u80fd\u627e\u5230\uff0c\u65e0\u9700\u81ea\u5df1\u53bb\u8ddf\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>window.H5guard.init({\u53c2\u6570\u5230\u81ea\u5df1\u7684\u6d4f\u89c8\u5668\u91cc\u53bb\u641c\u7d22})\nwindow.H5guard.sign({\u53c2\u6570\u540e\u9762\u8bf4})<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8865\u73af\u5883<\/h2>\n\n\n\n<p>\u50cf\u8fd9\u79cd\u5927\u5382\u7684\u80af\u5b9a\u4f1a\u68c0\u6d4b\u539f\u578b\u94fe\u7684\uff0c\u6240\u4ee5\u8865\u7684\u65f6\u5019\u5c3d\u91cf\u90fd\u8865\u5230\u539f\u578b\u94fe\u4e0a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6587\u4ef6\u5bfc\u5165<\/h3>\n\n\n\n<p>\u4e0b\u8f7d\u6574\u4e2aH5guard.js\u6587\u4ef6\uff0c\u7136\u540e\u7528<code>require('.\/H5guard.js');<\/code>\u5bfc\u5165\u4e0b\uff0c\u514d\u5f97\u4ee3\u7801\u592a\u957f\u8865\u7684\u65f6\u5019\u6076\u5fc3\u5230\u81ea\u5df1\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">a6<\/h3>\n\n\n\n<p>\u6587\u7ae0\u770b\u591a\u4e86\u5c31\u77e5\u9053\u52a0\u5bc6\u4e2d\u7684a6\u5c31\u662f\u52a0\u5bc6\u540e\u7684\u73af\u5883\u53c2\u6570\u3002a6\u7684\u7ec4\u6210\u90e8\u5206\u5728\u5934\u90e8\u6709\u4e2a\u660e\u663e\u7684<strong><code>h1.<\/code><\/strong>\u6807\u8bc6\uff0c\u5982\u679c\u4f60\u6709\u5bf9js\u4ee3\u7801\u8fdb\u884cast\u8fd8\u539f\uff0c\u90a3\u4e48\u76f4\u63a5\u641c\u7d22<strong><code>h1.<\/code><\/strong>\u5c31\u80fd\u627e\u5230\u751f\u6210\u4f4d\u7f6e\u4e86\u3002<\/p>\n\n\n\n<p>\u6ca1\u8fd8\u539f\u4e5f\u6ca1\u4e8b\uff0c\u6839\u636e\u7f51\u4e0a\u7684\u6587\u7ae0\u5206\u6790\uff0c\u641c\u7d22<code>!1,<\/code>\u627e\u5230\u7c7b\u4f3c<code>gU(kz, !1, kt)<\/code>\u7684\u4ee3\u7801\u4e5f\u884c&#8230;&#8230;<\/p>\n\n\n\n<p>\u6240\u4ee5\u628a\u6700\u7ec8\u73af\u5883\u8865\u6210a6\u52a0\u5bc6\u524d\u7684\u6837\u5b50\u5c31\u884c\u4e86\uff0c\u5f53\u7136\u6709\u90e8\u5206\u73af\u5883\u662f\u4e0d\u5728a6\u5185\u7684\uff0c\u4f60\u4e5f\u8981\u8865\uff01<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">k3<\/h3>\n\n\n\n<p>\u53ea\u8981\u4f60\u6267\u884c\u4e86js\u6587\u4ef6\uff0c\u90a3\u4ed6\u5c31\u4f1a\u53d1\u9001\u8bf7\u6c42\u83b7\u53d6k3\u7684\u503c\uff0c\u4f46\u662f\u5b9e\u9645\u4e0a\u8ba9\u4ed6\u4e0d\u53d1\u9001\u8bf7\u6c42\u4f7f\u7528k2\u7684\u503c\u4e5f\u662f\u53ef\u4ee5\u7684\u3002\u56e0\u6b64\u63a8\u8350\u662f\u8865\u4e0bsendBeacon\u548cXMLHttpRequest\uff0c\u4f46\u662f\u5b9e\u9645\u5185\u5bb9\u4e0d\u8981\u53bb\u5b9e\u73b0\u5373\u53ef\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>XMLHttpRequest = function XMLHttpRequest() {\n    console.log('XMLHttpRequest--&gt;')\n}\nNavigator.prototype.sendBeacon = function (url, data) {\n    console.log('window.navigator.sendBeacon--&gt;', url, data)\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">k66<\/h3>\n\n\n\n<p>\u5d4c\u5957\u7684toString\uff0c\u7f51\u7edc\u4e0a\u4e5f\u6709\u6587\u7ae0\u7ed9\u51fa\u8865\u7684\u4ee3\u7801\uff08\u4f46\u662f\u6ca1\u7ed9\u51fa\u4f7f\u7528\u65b9\u6cd5\uff09\u4e3e\u4e2a\u4f8b\u5b50<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!(function () {\n    \"use strict\";\n    const $toString = Function.toString;\n    const myFunction_toString_symbol = Symbol('('.concat('', ')_', (Math.random() + '').toString(36)));\n    const mytoString = function () {\n        return typeof this == 'function' &amp;&amp; this&#91;myFunction_toString_symbol] || $toString.call(this);\n    };\n\n    function set_native(func, key, value) {\n        Object.defineProperty(func, key, {\n            \"enumerable\": false,\n            \"configurable\": true,\n            \"writable\": true,\n            \"value\": value\n        })\n    };\n    delete Function.prototype&#91;'toString'];\n    set_native(Function.prototype, \"toString\", mytoString);\n    set_native(Function.prototype.toString, myFunction_toString_symbol, \"function toString() { &#91;native code] }\");\n    this.func_set_native = function (func) {\n        set_native(func, myFunction_toString_symbol, `function ${myFunction_toString_symbol, func.name || ''}() { &#91;native code] }`)\n    }\n}).call(globalThis);\n\/\/ \u4e0b\u9762\u662f\u8fd9\u6bb5\u4ee3\u7801\u7684\u4f7f\u7528\u65b9\u6cd5\nfunc_set_native(btoa)\nfunc_set_native(atob)\nfunc_set_native(Window)\nfunc_set_native(Navigator)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">k35<\/h3>\n\n\n\n<p>\u8865\u7684\u662f\u97f3\u9891\u7c7b\u76f8\u5173\u7684\uff1f\u540c\u6837\u4f7f\u7528\u7f51\u7edc\u4e0a\u7684\u4ee3\u7801\uff0c\u540c\u6837\u4f1a\u62a5\u9519<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>offauidio = proxy({\n    createOscillator: function createOscillator() {\n        return proxy({\n            frequency: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            connect: function connect() {\n            },\n            start: function start() {\n            },\n            disconnect: function disconnect() {\n            }\n        }, 'OscillatorNode')\n    },\n    createDynamicsCompressor: function createDynamicsCompressor() {\n        return proxy({\n            connect: function connect() {\n            },\n            threshold: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            knee: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            ratio: 0,\n            reduction: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            attack: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            release: {\n                setValueAtTime: function setValueAtTime() {\n                },\n            },\n            disconnect: function disconnect() {\n            }\n        }, 'DynamicsCompressorNode')\n    },\n    currentTime: 0,\n    destination: {},\n    startRendering: function startRendering() {\n    },\n}, 'OfflineAudioContext');\nObject.defineProperty(offauidio, 'oncomplete', {\n    set: function (func) {\n        func({\n            renderedBuffer: {\n                getChannelData: function () {\n                    return new Float32Array(&#91;...]);\n                },\n            }\n        })\n        return func\n    }\n})\nOfflineAudioContext = function OfflineAudioContext() {\n    return offauidio\n}\nAudioContext = function () {\n    console.log('AudioContext--&gt;')\n}<\/code><\/pre>\n\n\n\n<p>\u89e3\u51b3\uff1anew Float32Array([&#8230;])\uff0c\u66ff\u6362&#8230;\u5c31\u884c\uff0c\u66ff\u6362\u6210\u5565\u5c31\u5230\u81ea\u5df1\u7684\u6d4f\u89c8\u5668\u4e2d\u6253\u65ad\u70b9\u627e\u5230\u8c03\u7528\u8fd9\u4e2a\u65b9\u6cd5\u7684\u5730\u65b9\u7136\u540ecopy\u4e0b\u5c31\u884c\u4e86\u3002\u6216\u8005\u628a\u8865\u73af\u5883\u7684\u4ee3\u7801\u7ed9DeepSeek\uff0c\u8ba9\u4ed6\u5e2e\u5fd9\u751f\u6210\uff1f<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5176\u4ed6<\/h3>\n\n\n\n<p>k47\uff0ck70\u7b49\u7b49\u8fd9\u4e9b\u90fd\u662f\u5f02\u6b65\u7684\uff0c\u6211\u7ed9\u7684\u5efa\u8bae\u662f<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u4e0d\u8981\u52a0<\/mark><\/strong><code><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">setTimeout = function () {}<\/mark><\/strong><\/code>\u8fd9\u6bb5\u4ee3\u7801\uff0c\u4e0d\u7136\u5c31\u600e\u4e48\u4e5f\u6267\u884c\u4e0d\u5230\u4e86\uff0c\u8fd8\u6709\u5c31\u662f\u76f4\u63a5\u5199\u6210API\u7684\u5f62\u5f0f\u8fd9\u6837\u5c31\u4e0d\u7528\u7ba1\u5f02\u6b65\u7684\u95ee\u9898\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const http = require('http');\nhttp.createServer(async (req, res) =&gt; {\n    try {\n        const result = await window.H5guard.xxx(); \/\/ \u8c03\u7528\u6838\u5fc3\u65b9\u6cd5\n        res.end(JSON.stringify({sign: result}));\n    } catch (err) {\n        res.statusCode = 500;\n        res.end('Execution failed');\n    }\n}).listen(3000);\n\nconsole.log('Server running at http:\/\/localhost:3000\/');<\/code><\/pre>\n\n\n\n<p>\u81f3\u4e8e\u5176\u4ed6\u7684\uff0c\u6309\u7406\u6765\u8bf4\u53ea\u8981AST\u8fd8\u539f\u4e86\u5c31\u6ca1\u5565\u96be\u5ea6\u4e86\uff0c\u57fa\u672c\u90fd\u770b\u7684\u6e05\u695a\u505a\u4e86\u4e9b\u4ec0\u4e48\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8c03\u7528<\/h3>\n\n\n\n<p>\u76f8\u4fe1\u5927\u5bb6\u90fd\u80fd\u5feb\u901f\u7684\u627e\u5230\u52a0\u5bc6\u8c03\u7528\u4f4d\u7f6e\uff0c\u76f4\u63a5\u641cH5guard.sign(settings)\u90fd\u80fd\u627e\u5230\uff0c\u4f46\u662f\u8fd9\u91cc\u51fa\u7684\u7ed3\u679c\u662f\u9519\u8bef\u7684\uff0c\u81ea\u5df1\u53bb\u548c\u5b9e\u9645\u8bf7\u6c42\u643a\u5e26\u7684\u53c2\u6570\u6bd4\u5bf9\u4e0b\u5c31\u77e5\u9053\u4e86\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u65ad\u70b9\u5230sign\u65b9\u6cd5\u5185\uff0c\u7136\u540e\u7a0d\u5fae\u770b\u4e00\u773c\u5c31\u77e5\u9053\u4e86\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u771f\u5b9e\u7684\u5165\u53c2\u4e0d\u5728\u662fsettings\u7684\u683c\u5f0f\u800c\u5df2\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u7ae0\u4e2d\u6240\u6709\u5185\u5bb9\u4ec5\u4f9b\u5b66\u4e60\u4ea4\u6d41\u4f7f\u7528\uff0c\u4e0d\u7528\u4e8e\u5176\u4ed6\u4efb\u4f55\u76ee\u7684\uff0c\u4e0d\u63d0\u4f9b\u5b8c\u6574\u4ee3\u7801\u4e25\u7981\u7528\u4e8e\u5546\u4e1a\u7528\u9014\u548c\u975e\u6cd5\u7528\u9014\uff0c\u5426\u5219\u7531\u6b64\u4ea7\u751f\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1950","post","type-post","status-publish","format-standard","hentry","category-js"],"_links":{"self":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1950","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/comments?post=1950"}],"version-history":[{"count":10,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1950\/revisions"}],"predecessor-version":[{"id":2028,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1950\/revisions\/2028"}],"wp:attachment":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/media?parent=1950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/categories?post=1950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/tags?post=1950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}