{"id":1179,"date":"2020-03-12T16:05:44","date_gmt":"2020-03-12T08:05:44","guid":{"rendered":"http:\/\/www.xiaosuigu.top\/?p=1179"},"modified":"2020-03-12T16:05:44","modified_gmt":"2020-03-12T08:05:44","slug":"javascript-%e6%b7%b7%e6%b7%86%e6%8a%80%e6%9c%af","status":"publish","type":"post","link":"https:\/\/www.xiaosuigu.top\/index.php\/2020\/03\/12\/javascript-%e6%b7%b7%e6%b7%86%e6%8a%80%e6%9c%af\/","title":{"rendered":"JavaScript \u6df7\u6dc6\u6280\u672f"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">1.  \u7b80\u4ecb<\/h3>\n\n\n\n<p><strong>\u538b\u7f29\u3001\u6df7\u6dc6\u3001\u52a0\u5bc6\u6280\u672f\u7b80\u8ff0\u5982\u4e0b<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4ee3\u7801\u538b\u7f29\uff1a\u5373\u53bb\u9664<code>JavaScript<\/code> \u4ee3\u7801\u4e2d\u7684\u4e0d\u5fc5\u8981\u7684\u7a7a\u683c\u3001\u6362\u884c\u7b49\u5185\u5bb9\uff0c\u4f7f\u6e90\u7801\u90fd\u538b\u7f29\u4e3a\u51e0\u884c\u5185\u5bb9\uff0c\u964d\u4f4e\u4ee3\u7801\u53ef\u8bfb\u6027\uff0c\u5f53\u7136\u540c\u65f6\u4e5f\u80fd\u63d0\u9ad8\u7f51\u7ad9\u7684\u52a0\u8f7d\u901f\u5ea6\u3002<\/li><li>\u4ee3\u7801\u6df7\u6dc6\uff1a\u4f7f\u7528\u53d8\u91cf\u66ff\u6362\u3001\u5b57\u7b26\u4e32\u9635\u5217\u5316\u3001\u63a7\u5236\u6d41\u5e73\u5766\u5316\u3001\u591a\u6001\u53d8\u5f02\u3001\u50f5\u5c38\u51fd\u6570\u3001\u8c03\u8bd5\u4fdd\u62a4\u7b49\u624b\u6bb5\uff0c\u4f7f\u4ee3\u7801\u53d8\u5f97\u96be\u4ee5\u9605\u8bfb\u548c\u5206\u6790\uff0c\u8fbe\u5230\u6700\u7ec8\u4fdd\u62a4\u7684\u76ee\u7684\u3002\u4f46\u8fd9\u4e0d\u5f71\u54cd\u4ee3\u7801\u539f\u6709\u529f\u80fd\u3002\u662f\u7406\u60f3\u3001\u5b9e\u7528\u7684<code>JavaScript<\/code>\u4fdd\u62a4\u65b9\u6848<\/li><li>\u4ee3\u7801\u52a0\u5bc6\uff1a\u53ef\u4ee5\u901a\u8fc7\u67d0\u79cd\u624b\u6bb5\u5c06 JavaScript \u4ee3\u7801\u8fdb\u884c\u52a0\u5bc6\uff0c\u8f6c\u6210\u4eba\u65e0\u6cd5\u9605\u8bfb\u6216\u8005\u89e3\u6790\u7684\u4ee3\u7801\uff0c\u5982\u5c06\u4ee3\u7801\u5b8c\u5168\u62bd\u8c61\u5316\u52a0\u5bc6\uff0c\u5982 eval \u52a0\u5bc6\u3002\u53e6\u5916\u8fd8\u6709\u66f4\u5f3a\u5927\u7684\u52a0\u5bc6\u6280\u672f\uff0c\u53ef\u4ee5\u76f4\u63a5\u5c06 <code>JavaScript<\/code> \u4ee3\u7801\u7528 C\/C++ \u5b9e\u73b0\uff0c<code>JavaScript<\/code> \u8c03\u7528\u5176\u7f16\u8bd1\u540e\u5f62\u6210\u7684\u6587\u4ef6\u6765\u6267\u884c\u76f8\u5e94\u7684\u529f\u80fd\uff0c\u5982<code>Emscripten<\/code> \u8fd8\u6709 <code>WebAssembly<\/code>\u3002<\/li><\/ul>\n\n\n\n<p><strong>JavaScript \u6df7\u6dc6\u6280\u672f\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u53d8\u91cf\u6df7\u6dc6 \u5c06\u5e26\u6709\u542b\u610f\u7684\u53d8\u91cf\u540d\u3001\u65b9\u6cd5\u540d\u3001\u5e38\u91cf\u540d\u968f\u673a\u53d8\u4e3a\u65e0\u610f\u4e49\u7684\u7c7b\u4e71\u7801\u5b57\u7b26\u4e32\uff0c\u964d\u4f4e\u4ee3\u7801\u53ef\u8bfb\u6027\uff0c\u5982\u8f6c\u6210\u5355\u4e2a\u5b57\u7b26\u6216\u5341\u516d\u8fdb\u5236\u5b57\u7b26\u4e32\u3002<\/li><li>\u5b57\u7b26\u4e32\u6df7\u6dc6 \u5c06\u5b57\u7b26\u4e32\u9635\u5217\u5316\u96c6\u4e2d\u653e\u7f6e\u3001\u5e76\u53ef\u8fdb\u884c MD5 \u6216 Base64 \u52a0\u5bc6\u5b58\u50a8\uff0c\u4f7f\u4ee3\u7801\u4e2d\u4e0d\u51fa\u73b0\u660e\u6587\u5b57\u7b26\u4e32\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u4f7f\u7528\u5168\u5c40\u641c\u7d22\u5b57\u7b26\u4e32\u7684\u65b9\u5f0f\u5b9a\u4f4d\u5230\u5165\u53e3\u70b9\u3002<\/li><li>\u5c5e\u6027\u52a0\u5bc6 \u9488\u5bf9 JavaScript \u5bf9\u8c61\u7684\u5c5e\u6027\u8fdb\u884c\u52a0\u5bc6\u8f6c\u5316\uff0c\u9690\u85cf\u4ee3\u7801\u4e4b\u95f4\u7684\u8c03\u7528\u5173\u7cfb\u3002<\/li><li>\u63a7\u5236\u6d41\u5e73\u5766\u5316 \u6253\u4e71\u51fd\u6570\u539f\u6709\u4ee3\u7801\u6267\u884c\u6d41\u7a0b\u53ca\u51fd\u6570\u8c03\u7528\u5173\u7cfb\uff0c\u4f7f\u4ee3\u7801\u903b\u53d8\u5f97\u6df7\u4e71\u65e0\u5e8f\u3002<\/li><li>\u50f5\u5c38\u4ee3\u7801 \u968f\u673a\u5728\u4ee3\u7801\u4e2d\u63d2\u5165\u65e0\u7528\u7684\u50f5\u5c38\u4ee3\u7801\u3001\u50f5\u5c38\u51fd\u6570\uff0c\u8fdb\u4e00\u6b65\u4f7f\u4ee3\u7801\u6df7\u4e71\u3002<\/li><li>\u8c03\u8bd5\u4fdd\u62a4 \u57fa\u4e8e\u8c03\u8bd5\u5668\u7279\u6027\uff0c\u5bf9\u5f53\u524d\u8fd0\u884c\u73af\u5883\u8fdb\u884c\u68c0\u9a8c\uff0c\u52a0\u5165\u4e00\u4e9b\u5f3a\u5236\u8c03\u8bd5 debugger \u8bed\u53e5\uff0c\u4f7f\u5176\u5728\u8c03\u8bd5\u6a21\u5f0f\u4e0b\u96be\u4ee5\u987a\u5229\u6267\u884c JavaScript \u4ee3\u7801\u3002<\/li><li>\u591a\u6001\u53d8\u5f02 \u4f7f JavaScript \u4ee3\u7801\u6bcf\u6b21\u88ab\u8c03\u7528\u65f6\uff0c\u5c06\u4ee3\u7801\u81ea\u8eab\u5373\u7acb\u523b\u81ea\u52a8\u53d1\u751f\u53d8\u5f02\uff0c\u53d8\u5316\u4e3a\u4e0e\u4e4b\u524d\u5b8c\u5168\u4e0d\u540c\u7684\u4ee3\u7801\uff0c\u5373\u529f\u80fd\u5b8c\u5168\u4e0d\u53d8\uff0c\u53ea\u662f\u4ee3\u7801\u5f62\u5f0f\u53d8\u5f02\uff0c\u4ee5\u6b64\u675c\u7edd\u4ee3\u7801\u88ab\u52a8\u6001\u5206\u6790\u8c03\u8bd5\u3002<\/li><li>\u9501\u5b9a\u57df\u540d \u4f7f JavaScript \u4ee3\u7801\u53ea\u80fd\u5728\u6307\u5b9a\u57df\u540d\u4e0b\u6267\u884c\u3002<\/li><li>\u53cd\u683c\u5f0f\u5316 \u5982\u679c\u5bf9 JavaScript \u4ee3\u7801\u8fdb\u884c\u683c\u5f0f\u5316\uff0c\u5219\u65e0\u6cd5\u6267\u884c\uff0c\u5bfc\u81f4\u6d4f\u89c8\u5668\u5047\u6b7b\u3002<\/li><li>\u7279\u6b8a\u7f16\u7801 \u5c06 JavaScript \u5b8c\u5168\u7f16\u7801\u4e3a\u4eba\u4e0d\u53ef\u8bfb\u7684\u4ee3\u7801\uff0c\u5982\u8868\u60c5\u7b26\u53f7\u3001\u7279\u6b8a\u8868\u793a\u5185\u5bb9\u7b49\u7b49\u3002<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. ob\u6df7\u6dc6<\/h3>\n\n\n\n<p><strong>\u5b98\u7f51<\/strong>\uff1a<a href=\"https:\/\/obfuscator.io\/\">JavaScript Obfuscator Tool<\/a><\/p>\n\n\n\n<p><strong>\u7b80\u4ecb<\/strong>\uff1a\u6df7\u6dc6\u6280\u672f\u4e2d\u7684\u4e00\u79cd\u3002<\/p>\n\n\n\n<p><strong>\u7279\u5f81<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u4e00\u822c\u7531\u4e00\u4e2a\u5927\u6570\u7ec4\u6216\u8005\u542b\u6709\u5927\u6570\u7ec4\u7684\u51fd\u6570\u3001\u4e00\u4e2a\u81ea\u6267\u884c\u51fd\u6570\u3001\u89e3\u5bc6\u51fd\u6570\u548c\u52a0\u5bc6\u540e\u7684\u51fd\u6570\u56db\u90e8\u5206\u7ec4\u6210\uff1b<\/li><li>\u51fd\u6570\u540d\u548c\u53d8\u91cf\u540d\u901a\u5e38\u4ee5 <code>_0x<\/code> \u6216\u8005 <code>0x<\/code> \u5f00\u5934\uff0c\u540e\u63a5 1~6 \u4f4d\u6570\u5b57\u6216\u5b57\u6bcd\u7ec4\u5408\uff1b<\/li><li>\u81ea\u6267\u884c\u51fd\u6570\uff0c\u8fdb\u884c\u79fb\u4f4d\u64cd\u4f5c\uff0c\u6709\u660e\u663e\u7684 push\u3001shift \u5173\u952e\u5b57\uff1b<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>function _0x22d0(_0xe6a28f, _0x274cc4) {\n    var _0x1bfe9e = _0x1bfe();\n    return _0x22d0 = function (_0x22d0c3, _0x443dc0) {\n        _0x22d0c3 = _0x22d0c3 - 0x1bf;\n        var _0x41d814 = _0x1bfe9e&#91;_0x22d0c3];\n        return _0x41d814;\n    }, _0x22d0(_0xe6a28f, _0x274cc4);\n}\n\nfunction _0x1bfe() {\n    var _0x27621d = &#91;'445AaZSya', '24XVavDe', '1583370iNyweW', '577072vIguEw', '45100EQwcyz', 'log', '2789658gRbvxx', '14100eFOLIU', '115866VdgcXh', '11rtyPOE', '42rnEKnn', '622770KTyCeF'];\n    _0x1bfe = function () {\n        return _0x27621d;\n    };\n    return _0x1bfe();\n}\n\n(function (_0x59905f, _0x12738b) {\n    var _0x4e783f = _0x22d0, _0x3412fd = _0x59905f();\n    while (!!&#91;]) {\n        try {\n            var _0x5eba10 = parseInt(_0x4e783f(0x1bf)) \/ 0x1 + -parseInt(_0x4e783f(0x1ca)) \/ 0x2 + parseInt(_0x4e783f(0x1c1)) \/ 0x3 + parseInt(_0x4e783f(0x1c2)) \/ 0x4 * (parseInt(_0x4e783f(0x1c7)) \/ 0x5) + parseInt(_0x4e783f(0x1c3)) \/ 0x6 * (parseInt(_0x4e783f(0x1c5)) \/ 0x7) + -parseInt(_0x4e783f(0x1c8)) \/ 0x8 * (parseInt(_0x4e783f(0x1c9)) \/ 0x9) + parseInt(_0x4e783f(0x1c6)) \/ 0xa * (-parseInt(_0x4e783f(0x1c4)) \/ 0xb);\n            if (_0x5eba10 === _0x12738b) break; else _0x3412fd&#91;'push'](_0x3412fd&#91;'shift']());\n        } catch (_0x44a704) {\n            _0x3412fd&#91;'push'](_0x3412fd&#91;'shift']());\n        }\n    }\n}(_0x1bfe, 0x80696));\n\nfunction hi() {\n    var _0x154ba0 = _0x22d0;\n    console&#91;_0x154ba0(0x1c0)]('Hello\\x20World!');\n}\n\nhi();<\/code><\/pre>\n\n\n\n<p>\u4f8b\u5982\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c<code>_0x1bfe()<\/code> \u65b9\u6cd5\u5c31\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5927\u6570\u7ec4\uff0c\u81ea\u6267\u884c\u51fd\u6570\u91cc\u6709 push\u3001shift \u5173\u952e\u5b57\uff0c\u4e3b\u8981\u662f\u5bf9\u5927\u6570\u7ec4\u8fdb\u884c\u79fb\u4f4d\u64cd\u4f5c\uff0c<code>_0x22d0()<\/code> \u5c31\u662f\u89e3\u5bc6\u51fd\u6570\uff0c<code>hi()<\/code> \u5c31\u662f\u52a0\u5bc6\u540e\u7684\u51fd\u6570\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u4f7f\u7528ob\u6df7\u6dc6<\/h3>\n\n\n\n<p><code>npm install javascript-obfuscator -save<\/code><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u7b80\u4ecb \u538b\u7f29\u3001\u6df7\u6dc6\u3001\u52a0\u5bc6\u6280\u672f\u7b80\u8ff0\u5982\u4e0b \u4ee3\u7801\u538b\u7f29\uff1a\u5373\u53bb\u9664JavaScript \u4ee3\u7801\u4e2d\u7684\u4e0d\u5fc5\u8981\u7684\u7a7a\u683c\u3001\u6362\u884c\u7b49\u5185 [&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-1179","post","type-post","status-publish","format-standard","hentry","category-js"],"_links":{"self":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1179","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=1179"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/posts\/1179\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/media?parent=1179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/categories?post=1179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaosuigu.top\/index.php\/wp-json\/wp\/v2\/tags?post=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}