{"id":1380,"date":"2014-10-23T14:55:31","date_gmt":"2014-10-23T06:55:31","guid":{"rendered":"http:\/\/wx.wosign.com\/?p=1380"},"modified":"2014-10-23T16:28:02","modified_gmt":"2014-10-23T08:28:02","slug":"ssl-strip%e7%9a%84%e6%9c%aa%e6%9d%a5%ef%bc%9ahttps-%e5%89%8d%e7%ab%af%e5%8a%ab%e6%8c%81","status":"publish","type":"post","link":"https:\/\/wx.wosign.com\/?p=1380","title":{"rendered":"SSL Strip\u7684\u672a\u6765\uff1aHTTPS \u524d\u7aef\u52ab\u6301"},"content":{"rendered":"<p>\u5982\u679c\u4f60\u603b\u8ba4\u4e3a\uff0c\u4f60\u5728\u8bbf\u95ee\u67d0\u7f51\u7ad9\u65f6\uff0c\u4e0a\u4f20\u4e0b\u8f7d\u7684\u6570\u636e\u6ca1\u6709\u4efb\u4f55\u4ef7\u503c\uff0c\u90a3\u4e3a\u4f55\u4ecd\u6709\u5982\u6b64\u591a\u6ef4\u9ed1\u5ba2\u602a\u8700\u9ecd\uff0c\u9189\u5fc3\u4e8eSSL\u52ab\u6301\uff1f<\/p>\n<p>\u4ece\u9ed1\u5ba2\u7684\u601d\u7ef4\u601d\u8003\u9690\u79c1\u5b89\u5168\uff0c\u4f60\u624d\u77e5\u9053\u8be5\u4fdd\u62a4\u4e9b\u4ec0\u4e48\uff01\u2014\u2014\u642c\u8fd0\u5de5\u8bed\u5f55<\/p>\n<p>\u5c0f\u7f16\u542d\u54e7\u642c\u8fd0\u8fc7\u6765\uff0c\u5404\u4f4d\u6162\u6162\u4eab\u7528\uff01<\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"color: #666666;\"><span style=\"color: #000000;\"><strong>\u524d\u8a00<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\"><span style=\"color: #00b050;\">\u5728\u4e4b\u524d\u4ecb\u7ecd\u7684\u6d41\u91cf\u52ab\u6301\u6587\u7ae0\u91cc\uff0c\u66fe\u63d0\u5230\u4e00\u79cd\u300eHTTPS \u5411\u4e0b\u964d\u7ea7\u300f\u7684\u65b9\u6848 \u2014\u2014 \u5c06\u9875\u9762\u4e2d\u7684 HTTPS \u8d85\u94fe\u63a5\u5168\u90fd\u66ff\u6362\u6210 HTTP \u7248\u672c\uff0c\u8ba9\u7528\u6237\u59cb\u7ec8\u4ee5\u660e\u6587\u7684\u5f62\u5f0f\u8fdb\u884c\u901a\u4fe1\u3002<\/span><\/p>\n<p style=\"color: #666666;\">\u770b\u5230\u8fd9\uff0c\u4e5f\u8bb8\u5927\u5bb6\u90fd\u4f1a\u60f3\u5230\u4e00\u4e2a\u7ecf\u5178\u7684\u4e2d\u95f4\u4eba\u653b\u51fb\u5de5\u5177 \u2014\u2014 SSLStrip\uff0c\u901a\u8fc7\u5b83\u786e\u5b9e\u80fd\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u3002<strong>\u4e0d\u8fc7\u4eca\u5929\u8bb2\u89e3\u7684\uff0c\u5219\u662f\u5b8c\u5168\u4e0d\u540c\u7684\u601d\u8def\uff0c\u4e00\u79cd\u66f4\u6709\u6548\u3001\u66f4\u5148\u8fdb\u7684\u89e3\u51b3\u65b9\u6848 \u2014\u2014 HTTPS \u524d\u7aef\u52ab\u6301\u3002<\/strong><\/p>\n<h2 style=\"color: #666666;\"><span style=\"color: #000000;\"><strong>\u540e\u7aef\u7684\u7f3a\u9677<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u5728\u8fc7\u53bb\uff0c\u6d41\u91cf\u52ab\u6301\u57fa\u672c\u901a\u8fc7\u540e\u7aef\u6765\u5b9e\u73b0\uff0cSSLStrip \u5c31\u662f\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\u3002<\/p>\n<p style=\"color: #666666;\">\u7c7b\u4f3c\u5176\u4ed6\u4e2d\u95f4\u4eba\u5de5\u5177\uff0c\u7eaf\u540e\u7aef\u7684\u5b9e\u73b0\u53ea\u80fd\u64cd\u63a7\u6700\u539f\u59cb\u7684\u6d41\u91cf\u6570\u636e\uff0c\u8fd9\u4e25\u91cd\u963b\u788d\u4e86\u5411\u66f4\u9ad8\u5c42\u6b21\u7684\u53d1\u5c55\uff0c\u9762\u4e34\u4f17\u591a\u96be\u4ee5\u89e3\u51b3\u7684\u95ee\u9898\u3002<\/p>\n<ul class=\" list-paddingleft-2\" style=\"color: #666666;\">\n<li>\n<pre class=\"prettyprint lang-html prettyprinted\"><span class=\"pln\" style=\"color: #48484c;\">\u52a8\u6001\u5143\u7d20\u600e\u4e48\u529e\uff1f\r\n\u5982\u4f55\u5904\u7406\u6570\u636e\u5305\u5206\u7247\uff1f\r\n\u6027\u80fd\u6d88\u8017\u80fd\u5426\u964d\u4f4e\uff1f\r\n......<\/span><\/pre>\n<\/li>\n<\/ul>\n<h3 style=\"color: #666666;\"><strong><span style=\"color: #262626;\">\u52a8\u6001\u5143\u7d20<\/span><\/strong><\/h3>\n<p style=\"color: #666666;\">\u5728 Web \u521a\u51fa\u73b0\u7684\u5e74\u4ee3\u91cc\uff0cSSLStrip \u8fd9\u6837\u7684\u5de5\u5177\u8fd8\u662f\u5927\u6709\u7528\u6b66\u4e4b\u5730\u7684\u3002\u90a3\u65f6\u7684\u7f51\u9875\u90fd\u4ee5\u9759\u6001\u4e3a\u4e3b\uff0c\u7ed3\u6784\u7b80\u5355\u5c42\u6b21\u6e05\u6670\u3002\u5728\u6d41\u91cf\u4e0a\u8fdb\u884c\u66ff\u6362\uff0c\u5b8c\u5168\u80fd\u591f\u80dc\u4efb\u3002<\/p>\n<p style=\"color: #666666;\">\u7136\u800c\uff0c\u5982\u4eca\u7684\u7f51\u9875\u65e5\u76ca\u590d\u6742\uff0c\u811a\u672c\u6240\u5360\u6bd4\u91cd\u8d8a\u6765\u8d8a\u591a\u3002\u5982\u679c\u4ec5\u4ec5\u4ece\u6d41\u91cf\u4e0a\u7740\u624b\uff0c\u663e\u7136\u529b\u4e0d\u4ece\u5fc3\u3002<\/p>\n<pre class=\"prettyprint lang-html prettyprinted\" style=\"color: #666666;\"><span class=\"pln\" style=\"color: #48484c;\">var\u00a0protocol\u00a0=\u00a0'https';document.write('<\/span><span class=\"tag\">&lt;a<\/span><span class=\"pln\" style=\"color: #48484c;\">\u00a0<\/span><span class=\"atn\" style=\"color: teal;\">href<\/span><span class=\"pun\" style=\"color: #93a1a1;\">=<\/span><span class=\"atv\" style=\"color: #dd1144;\">\"'\u00a0+\u00a0protocol\u00a0+\u00a0':\/\/www.alipay.com\/\"<\/span><span class=\"tag\">&gt;<\/span><span class=\"pln\" style=\"color: #48484c;\">Login<\/span><span class=\"tag\">&lt;\/a&gt;<\/span><span class=\"pln\" style=\"color: #48484c;\">');<\/span><\/pre>\n<p style=\"color: #666666;\">\u5373\u4f7f\u975e\u5e38\u7b80\u5355\u7684\u52a8\u6001\u5143\u7d20\uff0c\u540e\u7aef\u4e5f\u6beb\u65e0\u62db\u67b6\u4e4b\u529b\u3002<\/p>\n<h3 style=\"color: #666666;\"><strong><span style=\"color: #262626;\">\u5206\u7247\u5904\u7406<\/span><\/strong><\/h3>\n<p style=\"color: #666666;\">\u5206\u5757\u4f20\u8f93\u7684\u9053\u7406\u5927\u5bb6\u90fd\u660e\u767d\u3002\u5bf9\u4e8e\u8f83\u5927\u7684\u6570\u636e\uff0c\u4e00\u53e3\u6c14\u662f\u65e0\u6cd5\u4f20\u5b8c\u7684\u3002\u5ba2\u6237\u7aef\u4f9d\u6b21\u6536\u5230\u5404\u4e2a\u6570\u636e\u5757\uff0c\u6700\u7ec8\u624d\u80fd\u5408\u5e76\u6210\u4e00\u4e2a\u5b8c\u6574\u7684\u7f51\u9875\u3002<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/3851413350569.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/3851413350569.png\" \/><\/p>\n<p style=\"color: #666666;\">\u7531\u4e8e\u6bcf\u6b21\u6536\u5230\u7684\u90fd\u662f\u6b8b\u7f3a\u7684\u788e\u7247\uff0c\u8fd9\u7ed9\u94fe\u63a5\u66ff\u6362\u5e26\u6765\u5f88\u5927\u7684\u9ebb\u70e6\u3002\u52a0\u4e0a\u4e0d\u5c11\u9875\u9762\u5e76\u975e\u6807\u51c6\u7684 UTF-8 \u7f16\u7801\uff0c\u56e0\u6b64\u66f4\u662f\u96be\u4e0a\u52a0\u96be\u3002<\/p>\n<p style=\"color: #666666;\">\u4e3a\u4e86\u80fd\u987a\u5229\u8fdb\u884c\uff0c\u4e2d\u95f4\u4eba\u901a\u5e38\u5148\u6536\u96c6\u6570\u636e\uff0c\u7b49\u5230\u9875\u9762\u63a5\u6536\u5b8c\u6574\uff0c\u624d\u5f00\u59cb\u66ff\u6362\u3002<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/97871413350571.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/97871413350571.png\" \/><\/p>\n<p style=\"color: #666666;\">\u5982\u679c\u628a\u6570\u636e\u6bd4\u4f5c\u6c34\u6d41\uff0c\u8fd9\u4e2a\u4ee3\u7406\u5c31\u50cf\u5927\u575d\u4e00\u6837\uff0c\u62e6\u622a\u4e86\u6e90\u6e90\u4e0d\u65ad\u5f80\u4e0b\u6d41\u7684\u6c34\uff0c\u76f4\u5230\u84c4\u6ee1\u4e86\u624d\u5f00\u59cb\u91ca\u653e\u3002\u56e0\u6b64\uff0c\u4e0b\u6e38\u7684\u4eba\u4eec\u9700\u5fcd\u53d7\u5f88\u4e45\u7684\u5e72\u65f1\uff0c\u624d\u80fd\u7b49\u5230\u6c34\u6e90\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u6027\u80fd\u6d88\u8017<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u7531\u4e8e HTML \u517c\u5bb9\u4f17\u591a\u5386\u53f2\u9057\u7559\u89c4\u8303\uff0c\u56e0\u6b64\u66ff\u6362\u5de5\u4f5c\u5e76\u975e\u662f\u4ef6\u8f7b\u677e\u4e8b\u3002<\/p>\n<p style=\"color: #666666;\">\u5404\u79cd\u590d\u6742\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u6d88\u8017\u7740\u4e0d\u5c11\u7684 CPU \u8d44\u6e90\u3002\u5c3d\u7ba1\u7528\u6237\u6700\u7ec8\u70b9\u51fb\u7684\u53ea\u662f\u5176\u4e2d\u4e00\u4e24\u4e2a\u94fe\u63a5\uff0c\u4f46\u4e2d\u95f4\u4eba\u5e76\u4e0d\u77e5\u9053\u5c06\u4f1a\u662f\u54ea\u4e2a\uff0c\u56e0\u6b64\u4ecd\u9700\u5206\u6790\u6574\u4e2a\u9875\u9762\u3002\u8fd9\u4e0d\u5f97\u4e0d\u8bf4\u662f\u4e2a\u60b2\u54c0\u3002<\/p>\n<hr style=\"color: #666666;\" \/>\n<h2 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u524d\u7aef\u7684\u4f18\u52bf<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u5982\u679c\u6211\u4eec\u7684\u4e2d\u95f4\u4eba\u80fd\u6253\u5165\u5230\u9875\u9762\u7684\u524d\u7aef\uff0c\u90a3\u4e48\u60c5\u51b5\u4f1a\u4e0d\u4f1a\u6709\u6240\u6539\u5584\u5462\uff1f<\/p>\n<h3 id=\"-1\" style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u5206\u7247\u5904\u7406<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u9996\u5148\uff0c\u8981\u6d3e\u4e00\u540d\u95f4\u8c0d\u5230\u9875\u9762\u91cc\u3002\u8fd9\u662f\u975e\u5e38\u5bb9\u6613\u529e\u5230\u7684\uff1a<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/79881413350572.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/79881413350572.png\" \/><\/p>\n<p style=\"color: #666666;\">\u4e0d\u50cf\u8d85\u94fe\u63a5\u904d\u5e03\u5728\u9875\u9762\u5404\u5904\uff0c\u811a\u672c\u63d2\u5165\u5230\u5934\u90e8\u5373\u53ef\u8fd0\u884c\u4e86\u3002\u6240\u4ee5\u6211\u4eec\u6839\u672c\u4e0d\u7528\u6574\u4e2a\u9875\u9762\u7684\u6570\u636e\uff0c\u53ea\u9700\u6539\u9020\u4e0b\u7b2c\u4e00\u4e2a chunk \u5c31\u53ef\u4ee5\uff0c\u540e\u7eed\u7684\u6570\u636e\u4ecd\u7136\u4ea4\u7ed9\u7cfb\u7edf\u8f6c\u53d1\u3002<\/p>\n<p style=\"color: #666666;\">\u56e0\u6b64\uff0c\u6574\u4e2a\u4ee3\u7406\u7684\u65f6\u95f4\u51e0\u4e4e\u4e0d\u53d8\uff01<\/p>\n<h3 id=\"-1\" style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u52a8\u6001\u5143\u7d20<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u5f88\u597d\uff0c\u6211\u4eec\u8f7b\u6613\u6e17\u900f\u5230\u9875\u9762\u91cc\u3002\u4f46\u63a5\u7740\u53c8\u5982\u4f55\u53d1\u8d77\u8fdb\u653b\uff1f<\/p>\n<p style=\"color: #666666;\">\u65e2\u7136\u5230\u4e86\u524d\u7aef\u91cc\uff0c\u65b9\u6cd5\u5c31\u76f8\u5f53\u591a\u4e86\u3002\u6700\u7b80\u5355\u7684\uff0c\u5c31\u662f\u904d\u5386\u8d85\u94fe\u63a5\u5143\u7d20\uff0c\u5c06 https \u7684\u90fd\u66ff\u6362\u6210 http \u7248\u672c\u3002<\/p>\n<p style=\"color: #666666;\">\u8fd9\u4e2a\u60f3\u6cd5\u786e\u5b9e\u4e0d\u9519\uff0c\u4f46\u4ecd\u505c\u7559\u5728 SSLStrip \u601d\u7ef4\u6a21\u5f0f\u4e0a\u3002\u8fd8\u662f\u300e\u66ff\u6362\u300f\u8fd9\u6761\u8def\uff0c\u53ea\u662f\u4ece\u540e\u7aef\u642c\u5230\u524d\u7aef\u800c\u5df2\u3002<\/p>\n<p style=\"color: #666666;\">\u5c3d\u7ba1\u8fd9\u4e2a\u65b9\u6cd5\u80fd\u80dc\u4efb\u5927\u591a\u573a\u5408\uff0c\u4f46\u4ecd\u7136\u4e0d\u662f\u6700\u5b8c\u7f8e\u7684\u3002\u6211\u4eec\u5e76\u4e0d\u77e5\u9053\u52a8\u6001\u5143\u7d20\u4f55\u65f6\u4f1a\u6dfb\u52a0\u8fdb\u6765\uff0c\u56e0\u6b64\u9700\u8981\u5f00\u542f\u5b9a\u65f6\u5668\u4e0d\u65ad\u7684\u626b\u63cf\u3002\u8fd9\u663e\u7136\u662f\u4e2a\u5f88\u632b\u7684\u529e\u6cd5\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u6027\u80fd\u4f18\u5316<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u4e8b\u5b9e\u4e0a\uff0c\u8d85\u94fe\u63a5\u65e0\u8bba\u662f\u8c01\u4ea7\u751f\u7684\u3001\u4f55\u65f6\u6dfb\u52a0\u8fdb\u6765\u7684\uff0c<span style=\"color: #00b050;\"><strong>\u53ea\u8981\u4e0d\u70b9\u51fb\uff0c\u90fd\u662f\u4e0d\u8d77\u4f5c\u7528\u7684<\/strong><\/span>\u3002\u6240\u4ee5\uff0c\u6211\u4eec\u53ea\u9700\u5173\u5fc3\u4f55\u65f6\u53bb\u70b9\u51fb\u5c31\u53ef\u4ee5 \u2014\u2014 \u5982\u679c\u6211\u4eec\u7684\u7a0b\u5e8f\uff0c\u80fd\u5728\u70b9\u51fb\u4ea7\u751f\u7684\u7b2c\u4e00\u65f6\u95f4\u91cc\u63a7\u5236\u4f4f\u73b0\u573a\uff0c\u90a3\u4e48\u4e4b\u540e\u7684\u6d41\u7a0b\u5c31\u53ef\u7531\u6211\u4eec\u51b3\u5b9a\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u542c\u8d77\u6765\u4f3c\u4e4e\u5f88\u7384\u4e4e\uff0c\u4e0d\u8fc7\u5728\u524d\u7aef\uff0c\u8fd9\u53ea\u662f\u5c0f\u83dc\u4e00\u789f\u7684\u4e8b\u3002\u70b9\u51fb\uff0c\u4e0d\u8fc7\u4e2a\u4e8b\u4ef6\u800c\u5df2\u3002\u65e2\u7136\u662f\u4e8b\u4ef6\uff0c\u6211\u4eec\u7528\u6700\u57fa\u7840\u7684\u4e8b\u4ef6\u6355\u83b7\u673a\u5236\uff0c\u5373\u53ef\u5c06\u5176\u8f7b\u677e\u62ff\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint lang-html prettyprinted\" style=\"color: #666666;\"><span class=\"pln\" style=\"color: #48484c;\">document.addEventListener('click',\u00a0function(e)\u00a0{\t\/\/\u00a0...},\u00a0true);<\/span><\/pre>\n<p style=\"color: #666666;\">DOM-3-Event \u662f\u4e2a\u975e\u5e38\u6709\u610f\u4e49\u7684\u4e8b\u4ef6\u6a21\u578b\u3002\u4e4b\u524d\u7528\u5b83\u6765\u5b9e\u73b0\u300e<a style=\"color: #00b050;\" title=\"\" href=\"http:\/\/fex.baidu.com\/blog\/2014\/06\/xss-frontend-firewall-1\/\" target=\"_blank\">\u5185\u8054 XSS \u62e6\u622a<\/a>\u300f\uff0c\u5982\u4eca\u540c\u6837\u4e5f\u53ef\u4ee5\u7528\u6765\u52ab\u6301\u94fe\u63a5\u3002<\/p>\n<p style=\"color: #666666;\">\u6211\u4eec\u6355\u83b7\u5168\u5c40\u7684\u70b9\u51fb\u4e8b\u4ef6\uff0c\u5982\u679c\u53d1\u73b0\u6709\u843d\u5728 https \u8d85\u94fe\u63a5\u4e0a\uff0c\u679c\u65ad\u5c06\u5176\u2026\u2026\u62e6\u622a\uff1f<\/p>\n<p style=\"color: #666666;\">\u5982\u679c\u771f\u628a\u5b83\u62e6\u622a\u4e86\uff0c\u90a3\u65b0\u9875\u9762\u5c31\u4e0d\u4f1a\u51fa\u73b0\u4e86\u3002\u5f53\u7136\u4f60\u4f1a\u8bf4\uff0c\u53ef\u4ee5\u81ea\u5df1 window.open \u5f39\u4e00\u4e2a\uff0c\u53cd\u6b63\u70b9\u51fb\u4e8b\u4ef6\u91cc\u662f\u53ef\u4ee5\u5f39\u7a97\u7684\u3002<\/p>\n<p style=\"color: #666666;\">\u4e0d\u8fc7\uff0c\u8bf7\u522b\u5fd8\u4e86\uff0c\u5e76\u975e\u6240\u6709\u7684\u8d85\u94fe\u63a5\u90fd\u662f\u5f39\u7a97\uff0c\u4e5f\u6709\u4e0d\u5c11\u662f\u76f4\u63a5\u8df3\u8f6c\u7684\u3002\u4f60\u4e5f\u4f1a\u8bf4\u53ef\u4ee5\u4fee\u6539 location \u6765\u5b9e\u73b0\u3002<\/p>\n<p style=\"color: #666666;\">\u4f46\u8981\u8bc6\u522b\u662f\u300e\u5f39\u7a97\u300f\u8fd8\u662f\u300e\u8df3\u8f6c\u300f\uff0c\u5e76\u4e0d\u7b80\u5355\u3002\u9664\u4e86\u8d85\u94fe\u63a5\u7684\u00a0<code>target<\/code>\u00a0\u5c5e\u6027\uff0c\u9875\u9762\u91cc\u7684\u00a0<code>&lt;base&gt;<\/code>\u00a0\u5143\u7d20\u4e5f\u4f1a\u6709\u5f71\u54cd\u3002\u5f53\u7136\uff0c\u8fd9\u4e9b\u76f8\u4fe1\u4f60\u90fd\u80fd\u5904\u7406\u597d\u3002<\/p>\n<p style=\"color: #666666;\">\u7136\u800c\uff0c\u73b0\u5b9e\u672a\u5fc5\u90fd\u662f\u90a3\u4e48\u7b80\u5355\u7684\u3002\u6709\u4e9b\u8d85\u94fe\u63a5\u672c\u8eab\u5c31\u7ed1\u5b9a\u4e86 onclick \u4e8b\u4ef6\uff0c\u751a\u81f3\u5728\u5176\u4e2d return false \u6216 preventDefault\uff0c\u5c4f\u853d\u4e86\u9ed8\u8ba4\u884c\u4e3a\u3002\u5982\u679c\u6211\u4eec\u4e0d\u987e\u53ca\u8fd9\u4e9b\uff0c\u4ecd\u7136\u6a21\u62df\u8df3\u8f6c\u6216\u5f39\u7a97\uff0c\u90a3\u5c31\u8fdd\u80cc\u9875\u9762\u7684\u610f\u613f\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u4e8b\u5b9e\u4e0a\uff0c\u6709\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u529e\u6cd5\uff1a\u5f53\u6211\u4eec\u7684\u6355\u83b7\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u65b0\u9875\u9762\u8fd8\u8fdc\u6ca1\u51fa\u73b0\uff0c\u8fd9\u65f6\u4ecd\u6709\u673a\u4f1a\u4fee\u6539\u8d85\u94fe\u63a5\u7684 href\u3002\u5f85\u4e8b\u4ef6\u5192\u6ce1\u5b8c\u6210\u3001\u6267\u884c\u9ed8\u8ba4\u884c\u4e3a\u65f6\uff0c\u6d4f\u89c8\u5668\u624d\u8bfb\u53d6 href \u5c5e\u6027\uff0c\u4f5c\u4e3a\u6700\u7ec8\u7684\u7ed3\u679c\u3002<\/p>\n<p style=\"color: #666666;\">\u56e0\u6b64\uff0c\u6211\u4eec\u53ea\u9700\u6355\u83b7\u70b9\u51fb\u4e8b\u4ef6\uff0c\u4fee\u6539\u8d85\u94fe\u63a5\u5730\u5740\u5c31\u53ef\u4ee5\u4e86\u3002\u81f3\u4e8e\u662f\u8df3\u8f6c\u3001\u5f39\u7a97\u3001\u8fd8\u662f\u88ab\u5c4f\u853d\uff0c\u6839\u672c\u4e0d\u7528\u6211\u4eec\u5173\u5fc3\u3002<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/47711413350574.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/47711413350574.png\" \/><\/p>\n<p style=\"color: #666666;\">\u5c31\u90a3\u4e48\u7b80\u5355\u3002\u56e0\u4e3a\u6211\u4eec\u662f\u5728\u7528\u6237\u70b9\u4e0b\u53bb\u4e4b\u540e\u624d\u4fee\u6539\uff0c\u6240\u4ee5\u6d4f\u89c8\u5668\u72b6\u6001\u680f\u91cc\uff0c\u663e\u793a\u7684\u4ecd\u662f\u539f\u5148 https \uff01<\/p>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u70b9\u8fc7\u4e00\u6b21\u4e4b\u540e\uff0c\u518d\u628a\u9f20\u6807\u653e\u5230\u8d85\u94fe\u63a5\u4e0a\uff0c\u72b6\u6001\u680f\u91cc\u663e\u793a\u7684\u5c31\u662f\u4fee\u6539\u540e\u7684\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u4e3a\u4e86\u80fd\u7ee7\u7eed\u5ffd\u60a0\uff0c\u6211\u4eec\u5728\u4fee\u6539 href \u4e4b\u540e\u7684\u4e0b\u4e2a\u7ebf\u7a0b\u5468\u671f\u91cc\uff0c\u628a\u5b83\u6539\u56de\u6765\u3002\u56e0\u4e3a\u6709\u4e86\u4e00\u5b9a\u5ef6\u65f6\uff0c\u65b0\u9875\u9762\u5e76\u4e0d\u53d7\u5f71\u54cd\u3002<\/p>\n<pre class=\"prettyprint lang-html prettyprinted\" style=\"color: #666666;\"><span class=\"pln\" style=\"color: #48484c;\">var\u00a0url\u00a0=\u00a0link.href;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u4fdd\u5b58\u539f\u59cb\u5730\u5740link.href\u00a0=\u00a0url.replace('https:\/\/',\u00a0'http:\/\/');\t\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u6682\u65f6\u6362\u6210\u00a0http\u00a0\u7684setTimeout(function()\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0link.href\u00a0=\u00a0url;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/\u00a0\u65b0\u9875\u9762\u6253\u5f00\u540e\uff0c\u8fd8\u539f\u56de\u6765},\u00a00);<\/span><\/pre>\n<p style=\"color: #666666;\">\u8fd9\u6837\uff0c\u9875\u9762\u91cc\u7684\u8d85\u94fe\u63a5\u59cb\u7ec8\u90fd\u662f\u6b63\u5e38\u7684 \u2014\u2014 \u53ea\u6709\u7528\u6237\u70b9\u4e0b\u7684\u77ac\u95f4\uff0c\u624d\u4e34\u65f6\u4f2a\u88c5\u4e00\u4e0b\u3002<\/p>\n<hr style=\"color: #666666;\" \/>\n<h2 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u66f4\u591a\u62e6\u622a<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u9664\u4e86\u901a\u8fc7\u8d85\u94fe\u63a5\uff0c\u8fd8\u6709\u5176\u5b9e\u65b9\u5f0f\u8bbf\u95ee\u9875\u9762\uff0c\u6211\u4eec\u5e94\u5c3d\u53ef\u80fd\u591a\u7684\u8fdb\u884c\u76d1\u63a7\u3002\u4f8b\u5982\uff1a<\/p>\n<ul class=\" list-paddingleft-2\" style=\"color: #666666;\">\n<li>\n<pre class=\"prettyprint lang-html prettyprinted\"><span class=\"pln\" style=\"color: #48484c;\">\u8868\u5355\u63d0\u4ea4\r\nwindow.open\u00a0\u5f39\u7a97\r\n\u6846\u67b6\u9875\u9762\r\n.....<\/span><\/pre>\n<\/li>\n<\/ul>\n<h3 style=\"color: #666666;\"><strong><span style=\"color: #262626;\">\u8868\u5355\u63d0\u4ea4<\/span><\/strong><\/h3>\n<p style=\"color: #666666;\">\u8868\u5355\u63d0\u4ea4\u548c\u8d85\u94fe\u63a5\u975e\u5e38\u7c7b\u4f3c\uff0c\u90fd\u5177\u6709\u4e8b\u4ef6\uff0c\u53ea\u662f\u5c06\u00a0<code>click<\/code>\u00a0\u6362\u6210\u00a0<code>submit<\/code>\uff0c<code>href<\/code>\u00a0\u6362\u6210\u00a0<code>action<\/code>\u00a0\u800c\u5df2\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u811a\u672c\u5f39\u7a97<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u51fd\u6570\u8c03\u7528\u7684\u6700\u7b80\u5355\u4e86\uff0c\u53ea\u9700\u4e00\u4e2a\u5c0f\u94a9\u5b50\u5373\u53ef\u641e\u5b9a\uff1a<\/p>\n<pre class=\"prettyprint lang-html prettyprinted\" style=\"color: #666666;\"><span class=\"pln\" style=\"color: #48484c;\">var\u00a0raw_open\u00a0=\u00a0window.open;window.open\u00a0=\u00a0function(url)\u00a0{\t\/\/\u00a0FIX:\u00a0null,\u00a0case\u00a0insensitive\r\n\targuments[0]\u00a0=\u00a0url.replace('https:\/\/',\u00a0'http:\/\/');\r\n\traw_open.apply(this,\u00a0arguments);\r\n}<\/span><\/pre>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u6846\u67b6\u9875\u9762<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u56e0\u4e3a\u6211\u4eec\u628a\u4e3b\u9875\u9762\u964d\u7ea7\u6210 http \u4e86\uff0c\u4f46\u91cc\u9762\u7684\u6846\u67b6\u5730\u5740\u4ecd\u662f\u539f\u5148\u7684\u3002\u7531\u4e8e\u534f\u8bae\u4e0d\u540c\uff0c\u8fd9\u4f1a\u4ea7\u751f\u8de8\u57df\u95ee\u9898\uff0c\u5bfc\u81f4\u9875\u9762\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<p style=\"color: #666666;\">\u6240\u4ee5\u6211\u4eec\u8fd8\u8981\u628a\u9875\u9762\u91cc\u7684\u6846\u67b6\uff0c\u4e5f\u90fd\u8f6c\u578b\u6210 http \u7248\u672c\uff0c\u786e\u4fdd\u80fd\u548c\u4e3b\u9875\u9762\u878d\u4e3a\u4e00\u81f4\u3002<\/p>\n<p style=\"color: #666666;\">\u4f46\u6846\u67b6\u548c\u4e4b\u524d\u7684\u90a3\u4e9b\u4e0d\u540c\uff0c\u56e0\u4e3a\u5b83\u662f\u81ea\u52a8\u52a0\u8f7d\u7684\uff0c\u800c\u4e14\u4e5f\u6ca1\u6709\u4e00\u4e2a\u5373\u5c06\u52a0\u8f7d\u7684\u4e8b\u4ef6\u3002\u5982\u679c\u7b49\u5230\u6846\u67b6\u52a0\u8f7d\u5b8c\u4e86\u518d\u53bb\u5904\u7406\uff0c\u8bf4\u4e0d\u5b9a\u5df2\u7ecf\u5f00\u59cb\u62a5\u8de8\u57df\u9519\u8bef\u4e86\u3002\u800c\u4e14\u8fd8\u4f1a\u767d\u767d\u7684\u6d6a\u8d39\u4e00\u6b21\u52a0\u8f7d\u6d41\u91cf\u3002<\/p>\n<p style=\"color: #666666;\">\u56e0\u6b64\uff0c\u6211\u4eec\u5fc5\u987b\u8ba9\u6846\u67b6\u4e00\u51fa\u73b0\uff0c\u8fd8\u6ca1\u6765\u8ba9\u5b83\u5f97\u53ca\u52a0\u8f7d\uff0c\u5c31\u7acb\u5373\u66ff\u6362\u6389\u5730\u5740\u3002<\/p>\n<p style=\"color: #666666;\">\u8fd9\u5728\u8fc7\u53bb\u662f\u4e2a\u5f88\u68d8\u624b\u7684\u95ee\u9898\uff0c\u7136\u800c HTML5 \u65f6\u4ee3\u7ed9\u6211\u4eec\u5e26\u6765\u4e86\u65b0\u5e0c\u671b \u2014\u2014\u00a0<code>MutationEvent<\/code>\u3002\u7528\u5b83\u5373\u53ef\u5b9e\u65f6\u76d1\u63a7\u9875\u9762\u5143\u7d20\uff0c\u4e4b\u524d\u4e5f<a style=\"color: #238357;\" title=\"\" href=\"http:\/\/fex.baidu.com\/blog\/2014\/06\/xss-frontend-firewall-2\/\" target=\"_blank\">\u5c1d\u8bd5\u8fc7\u4e00\u4e9b\u8bd5\u9a8c<\/a>\u3002<\/p>\n<p style=\"color: #666666;\">\u89e3\u51b3\u4e86\u6846\u67b6\u9875\u7684\u95ee\u9898\uff0c\u6211\u4eec\u5c31\u80fd\u6210\u529f\u52ab\u6301\u652f\u4ed8\u5b9d\u767b\u5f55\u9875\u7684\u8d26\u53f7\u6846 IFrame \u4e86\uff01<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/18241413350576.jpg\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/18241413350576.jpg\" \/><\/p>\n<hr style=\"color: #666666;\" \/>\n<h2 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u540e\u7aef\u914d\u5408<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u901a\u8fc7\u524d\u7aef\u7684 XSS \u811a\u672c\uff0c\u6211\u4eec\u8f7b\u6613\u89e3\u51b3\u4e86\u8fc7\u53bb\u5404\u79cd\u68d8\u624b\u7684\u95ee\u9898\u3002\u4f46\u6311\u6218\u5e76\u672a\u5c31\u6b64\u7ed3\u675f\uff0c\u6211\u4eec\u4ecd\u9762\u4e34\u7740\u4f17\u591a\u96be\u9898\u3002<\/p>\n<h3 style=\"color: #666666;\"><strong><span style=\"color: #262626;\">\u5982\u4f55\u544a\u8bc9\u4ee3\u7406<\/span><\/strong><\/h3>\n<p style=\"color: #666666;\">\u5c3d\u7ba1\u5728\u524d\u7aef\u4e0a\u9762\uff0c\u6211\u4eec\u5df2\u7ecf\u907f\u5f00\u4e86\u5404\u79cd\u8fdb\u5165 https \u7684\u9014\u5f84\uff0c\u8ba9\u8bf7\u6c42\u4ee5\u660e\u6587\u7684\u5f62\u5f0f\u4ea4\u7ed9\u4ee3\u7406\u3002\u4f46\u4ee3\u7406\u53c8\u5982\u4f55\u51b3\u5b9a\uff0c\u8fd9\u4e2a\u8bf7\u6c42\u7528 https \u8fd8\u662f http \u8f6c\u53d1\u5462\uff1f<\/p>\n<p style=\"color: #666666;\">\u4f20\u7edf\u7684\u540e\u7aef\u52ab\u6301\u4e4b\u6240\u4ee5\u80fd\u6b63\u786e\u8f6c\u53d1\uff0c\u90a3\u662f\u5728\u66ff\u6362\u8d85\u94fe\u63a5\u7684\u65f6\u5019\uff0c\u5df2\u7ecf\u505a\u4e0b\u8bb0\u5f55\u3002\u5f53\u51fa\u73b0\u8bb0\u5f55\u4e2d\u7684\u8bf7\u6c42\uff0c\u5c31\u8d70 https \u7684\u8f6c\u53d1\u3002<\/p>\n<p style=\"color: #666666;\">\u800c\u6211\u4eec\u7684\u52ab\u6301\u5728\u524d\u7aef\uff0c\u5e76\u4e14\u53ea\u53d1\u751f\u5728\u70b9\u51fb\u7684\u4e00\u77ac\u95f4\u3002\u5373\u4f7f\u9a6c\u4e0a\u53bb\u544a\u8bc9\u4e2d\u95f4\u4eba\uff0c\u67d0\u4e2a URL \u662f https \u7684\uff0c\u8fd9\u65f6\u4e5f\u6765\u4e0d\u53ca\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u544a\u8bc9\u4e2d\u95f4\u4eba\u662f\u5fc5\u987b\u7684\u3002\u4f46\u6211\u4eec\u53ef\u4ee5\u7528\u4e00\u4e2a\u5de7\u5999\u7684\u65b9\u6cd5\uff0c\u4e0d\u5fc5\u5355\u72ec\u53d1\u9001\u6d88\u606f \u2014\u2014 \u6211\u4eec\u53ea\u9700\u5728\u8f6c\u578b\u540e\u7684 URL \u91cc\uff0c\u505a\u4e2a\u5c0f\u8bb0\u53f7\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u5f53\u4ee3\u7406\u53d1\u73b0\u8bf7\u6c42\u7684 URL \u91cc\u6709\u8fd9\u4e2a\u8bb0\u53f7\uff0c\u5b83\u81ea\u7136\u5c31\u61c2\u4e86\uff0c\u76f4\u63a5\u8d70 https\uff01<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/89341413350579.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/89341413350579.png\" \/><\/p>\n<p style=\"color: #666666;\">\u7531\u4e8e\u628a\u9875\u9762\u4ece https \u964d\u7ea7\u5230\u4e86 http\uff0c\u56e0\u6b64\u76f8\u5173\u8bf7\u6c42\u7684<code>referer<\/code>\u4e5f\u53d8\u6210 http \u7248\u4e86\u3002\u6240\u4ee5\uff0c\u4e2d\u95f4\u4eba\u5e94\u5c3d\u91cf\u628a referer \u4e5f\u4fee\u6b63\u56de\u6765\uff0c\u907f\u514d\u88ab\u670d\u52a1\u5668\u5bdf\u89c9\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u9690\u85cf\u4f2a\u88c5<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u4e0d\u8fc7\uff0c\u5728 URL \u91cc\u52a0\u6807\u8bb0\u7684\u65b9\u6cd5\uff0c\u4e5f\u6709\u5f88\u5927\u7684\u7f3a\u9677\u3002<\/p>\n<p style=\"color: #666666;\">\u56e0\u4e3a\u9875\u9762\u7684 URL \u4f1a\u5728\u5730\u5740\u680f\u91cc\u663e\u793a\u51fa\u6765\uff0c\u6240\u4ee5\u7528\u6237\u4f1a\u770b\u89c1\u6211\u4eec\u7684\u8bb0\u53f7\u3002\u5f53\u7136\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u8ff7\u60d1\u6027\u7684\u5b57\u7b26\uff0c\u4f8b\u5982\u00a0<code>?zh_cn<\/code>\u3001<code>?utf_8<\/code>\uff0c<code>?from_baidu<\/code>\u7b49\u7b49\uff0c\u66f4\u597d\u7684\u6b3a\u9a97\u7528\u6237\u3002<\/p>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u5982\u679c\u4f60\u89c9\u5f97\u8fd8\u662f\u4e0d\u6ee1\u610f\uff0c\u4e5f\u6709\u529e\u6cd5\u8ba9\u8fd9\u4e9b\u788d\u773c\u6807\u8bb0\u5c3d\u5feb\u6d88\u5931\uff1a<\/p>\n<pre class=\"prettyprint lang-html prettyprinted\" style=\"color: #666666;\"><span class=\"pln\" style=\"color: #48484c;\">if\u00a0url\u00a0has\u00a0symbol\r\n\thistory.replaceState(...,\u00a0clear_symbol(url)\u00a0)<\/span><\/pre>\n<p style=\"color: #666666;\">HTML5 \u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4fee\u6539\u5730\u5740\u680f\u7684\u80fd\u529b\uff0c\u5e76\u4e14\u65e0\u9700\u5237\u65b0\u3002\u8fd9\u4e9b\u5f3a\u608d\u7684\u529f\u80fd\uff0c\u5982\u4eca\u90fd\u53ef\u4ee5\u5728\u524d\u7aef\u5229\u7528\u8d77\u6765\u4e86\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u91cd\u5b9a\u5411\u52ab\u6301<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u5149\u9760\u524d\u7aef\u7684\u52ab\u6301\uff0c\u8fd8\u662f\u8fdc\u8fdc\u4e0d\u591f\u7684\u3002\u73b0\u5b9e\u4e2d\uff0c\u8fd8\u6709\u53e6\u4e00\u79cd\u5f88\u5e38\u89c1\u7684\u65b9\u5f0f\uff0c\u90a3\u5c31\u662f\u91cd\u5b9a\u5411\u5230\u5b89\u5168\u9875\u9762\u3002<\/p>\n<p style=\"color: #666666;\">\u4ed4\u7ec6\u56de\u60f3\u4e0b\uff0c\u5e73\u65f6\u6211\u4eec\u662f\u600e\u6837\u8fdb\u5165\u60f3\u4e0a\u7684\u7f51\u7ad9\u7684\u3002\u4f8b\u5982\u652f\u4ed8\u5b9d\uff0c\u9664\u975e\u4f60\u6709\u6536\u85cf\uff0c\u5426\u5219\u5c31\u5f97\u81ea\u5df1\u6572\u5165 www.alipay.com \u6216 www.zhifubao.com\uff0c\u5f53\u4f60\u56de\u8f66\u8fdb\u5165\u65f6\uff0c\u6d4f\u89c8\u5668\u53c8\u5982\u4f55\u77e5\u9053\u8fd9\u662f\u4e2a HTTPS \u7684\u7f51\u7ad9\u5462\uff1f<\/p>\n<p style=\"color: #666666;\">\u663e\u7136\uff0c\u7b2c\u4e00\u4e2a\u8bf7\u6c42\u4ecd\u662f\u666e\u901a\u7684 HTTP \u534f\u8bae\u3002\u5f53\u7136\uff0c\u8fd9\u4e2a HTTP \u7248\u7684\u652f\u4ed8\u5b9d\u7684\u786e\u5b58\u5728\uff0c\u5b83\u7684\u552f\u4e00\u529f\u80fd\u5c31\u5c06\u7528\u6237\u91cd\u5b9a\u5411\u5230 HTTPS \u7248\u672c\u3002<\/p>\n<p style=\"color: #666666;\">\u5f53\u6211\u4eec\u7684\u4e2d\u95f4\u4eba\u4e00\u65e6\u53d1\u73b0\u6709\u91cd\u5b9a\u5411\u5230 HTTPS \u7f51\u7ad9\u7684\uff0c\u5f53\u7136\u4e0d\u5e0c\u671b\u7528\u6237\u8d70\u8fd9\u6761\u4e0d\u53d7\u81ea\u5df1\u63a7\u5236\u7684\u8def\u3002\u4e8e\u662f\u62e6\u4e0b\u8fd9\u4e2a\u91cd\u5b9a\u5411\uff0c\u7136\u540e\u4ee5 HTTPS \u7684\u65b9\u5f0f\uff0c\u83b7\u53d6\u91cd\u5b9a\u5411\u540e\u7684\u5185\u5bb9\uff0c\u6700\u540e\u518d\u4ee5 HTTP \u660e\u6587\u7684\u65b9\u5f0f\uff0c\u56de\u590d\u7ed9\u7528\u6237\u3002<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/42291413350582.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/42291413350582.png\" \/><\/p>\n<p style=\"color: #666666;\">\u56e0\u6b64\u5728\u7528\u6237\u770b\u6765\uff0c\u59cb\u7ec8\u5904\u4e8e HTTP \u7f51\u7ad9\u4e0a\u3002<\/p>\n<p style=\"color: #666666;\">\u4e0d\u8fc7\uff0c\u5982\u4eca\u7684 Web \u91cc\u589e\u52a0\u4e00\u4e2a\u65b0\u7684\u5b89\u5168\u6807\u51c6\uff1a<a style=\"color: #238357;\" title=\"\" href=\"https:\/\/www.owasp.org\/index.php\/HTTP_Strict_Transport_Security\" target=\"_blank\">HTTP Strict Transport Security<\/a>\u3002\u5982\u679c\u5ba2\u6237\u7aef\u6536\u5230\u8fd9\u4e2a\u5934\u90e8\uff0c\u4e4b\u540e\u4e00\u6bb5\u65f6\u95f4\u5185\u8bbf\u95ee\u8be5\u7ad9\u70b9\uff0c\u5c31\u59cb\u7ec8\u901a\u8fc7 HTTPS \u7684\u65b9\u5f0f\u3002<\/p>\n<p style=\"color: #666666;\">\u6240\u4ee5\u6211\u4eec\u7684\u4e2d\u95f4\u4eba\u4e00\u65e6\u53d1\u73b0\u6709\u8fd9\u4e2a\u5b57\u6bb5\uff0c\u5c31\u5f97\u679c\u65ad\u5c06\u5176\u5220\u9664\u3002<\/p>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u7528\u6237\u76f4\u63a5\u6572\u7f51\u5740\u7684\u5e76\u4e0d\u5e38\u89c1\u3002\u5927\u591a\u90fd\u662f\u641c\u7d22\u5f15\u64ce\uff0c\u7136\u540e\u76f4\u63a5\u4ece\u7b2c\u4e00\u4e2a\u7ed3\u679c\u91cc\u8fdb\u6765\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u6bd4\u8f83\u60b2\u5267\u7684\u662f\uff0c\u56fd\u5185\u7684\u641c\u7d22\u5f15\u64ce\u51e0\u4e4e\u90fd\u662f HTTP \u7684\u3002\u5728\u7528\u6237\u8bbf\u95ee\u641c\u7d22\u9875\u9762\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684 XSS \u65e9\u5df2\u6f5c\u4f0f\u5728\u5176\u4e2d\u4e86\uff0c\u56e0\u6b64\u4ece\u4e2d\u70b9\u51fa\u6765\u7684\u4efb\u4f55\u4e00\u6761\u7ed3\u679c\uff0c\u90fd\u662f\u8fdb\u4e0d\u5230\u5b98\u65b9\u7684 HTTPS \u91cc\u7684\uff1a\uff09<\/p>\n<p style=\"color: #666666;\">\u9664\u4e86\u641c\u7d22\u9875\u9762\uff0c\u4e0d\u5c11\u7c7b\u4f3c hao123 \u4e4b\u7c7b\u7684\u7f51\u5740\u5927\u5168\uff0c\u5927\u591a\u4e5f\u672a\u5f00\u542f HTTPS\u3002\u56e0\u6b64\u4ece\u4e2d\u5bfc\u6d41\u7684\u7f51\u7ad9\uff0c\u90fd\u9762\u4e34\u7740\u88ab\u4e2d\u95f4\u4eba\u52ab\u6301\u7684\u98ce\u9669\u3002<\/p>\n<hr style=\"color: #666666;\" \/>\n<h2 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u9632\u8303\u63aa\u65bd<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u4ecb\u7ecd\u4e86\u653b\u51fb\u65b9\u6cd5\uff0c\u63a5\u7740\u8bb2\u89e3\u9632\u5fa1\u63aa\u65bd\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u811a\u672c\u8df3\u8f6c<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u4e8b\u5b9e\u4e0a\uff0c\u65e0\u8bba\u662f\u524d\u7aef\u52ab\u6301\u8fd8\u662f\u540e\u7aef\u8fc7\u6ee4\uff0c\u4ecd\u6709\u4e0d\u5c11\u7684\u7f51\u7ad9\u65e0\u6cd5\u6210\u529f\u3002\u4f8b\u5982\u4eac\u4e1c\u7684\u767b\u5f55\uff1a<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/38261413350584.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/38261413350584.png\" \/><\/p>\n<p style=\"color: #666666;\">\u5b83\u662f\u901a\u8fc7\u811a\u672c\u8df3\u8f6c\u5230 HTTPS \u5730\u5740\u7684\u3002\u800c\u6d4f\u89c8\u5668\u7684\u00a0<code>location<\/code>\u00a0\u662f\u4e2a\u53ca\u5176\u7279\u6b8a\u7684\u5c5e\u6027\uff0c\u5b83<a style=\"color: #238357;\" title=\"\" href=\"http:\/\/stackoverflow.com\/questions\/22290948\/stopping-script-from-changing-document-location-href\" target=\"_blank\">\u53ef\u4ee5\u88ab\u5c4f\u853d<\/a>\uff0c\u4f46\u65e0\u6cd5\u88ab\u91cd\u5199\u3002\u56e0\u6b64\u6211\u4eec\u96be\u4ee5\u63a7\u5236\u9875\u9762\u7684\u8df3\u8f6c\u60c5\u51b5\u3002<\/p>\n<p style=\"color: #666666;\">\u5982\u679c\u975e\u8981\u52ab\u6301\u4eac\u4e1c\u9875\u9762\uff0c\u6211\u4eec\u53ea\u80fd\u4f7f\u7528\u767d\u540d\u5355\u7684\u65b9\u5f0f\uff0c\u7279\u6b8a\u5bf9\u5f85\u8be5\u7ad9\u70b9\u3002\u4f46\u8fd9\u6837\u5c31\u5927\u5e45\u589e\u52a0\u4e86\u653b\u51fb\u6210\u672c\u3002<\/p>\n<h3 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u6df7\u6dc6\u660e\u6587<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u4e0d\u96be\u53d1\u73b0\u4eac\u4e1c\u7684\u767b\u5f55\u811a\u672c\u91cc\uff0cURL \u662f\u4ee5\u6700\u76f4\u767d\u7684\u660e\u6587\u51fa\u73b0\u7684\u3002\u6240\u4ee5\u6211\u4eec\u5229\u7528 SSLStrip \u7684\u65b9\u5f0f\uff0c\u5bf9\u811a\u672c\u91cc\u7684\u00a0<code>https:\/\/<\/code>\u00a0\u7684\u6587\u672c\u8fdb\u884c\u66ff\u6362\uff0c\u4e5f\u80fd\u8d77\u5230\u4e00\u5b9a\u7684\u4f5c\u7528\uff0c\u6bd5\u7adf\u5927\u591a\u811a\u672c\u90fd\u5bf9\u6b64\u6beb\u65e0\u9632\u5907\u3002<\/p>\n<p style=\"color: #666666;\">\u4f46\u5bf9\u4e8e\u7a0d\u5fae\u590d\u6742\u4e00\u70b9\u7684\u811a\u672c\uff0c\u4f8b\u5982\u901a\u8fc7\u5b57\u7b26\u4e32\u62fc\u63a5\u800c\u6210\u7684 URL\uff0c\u90a3\u4e48\u5c31\u96be\u4ee5\u5b9e\u65bd\u4e86\u3002<\/p>\n<p style=\"color: #666666;\">\u6240\u4ee5\u5728\u5b89\u5168\u9700\u8981\u8f83\u9ad8\u7684\u573a\u5408\uff0c\u4e0d\u59a8\u628a\u4e00\u4e9b\u91cd\u8981\u7684\u5730\u5740\u8fdb\u884c\u7b80\u5355\u7684\u5904\u7406\uff0c\u4e2d\u95f4\u4eba\u5c31\u65e0\u6cd5\u4f7f\u7528\u901a\u7528\u7684\u65b9\u5f0f\u6765\u653b\u51fb\u3002\u800c\u5fc5\u987b\u9488\u5bf9\u7ad9\u70b9\u8fdb\u884c\u7279\u6b8a\u5bf9\u5f85\uff0c\u4ece\u800c\u63d0\u9ad8\u653b\u51fb\u6210\u672c\u3002<\/p>\n<h3 id=\"-hsts\" style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u5c3d\u53ef\u80fd\u591a\u7684 HSTS<\/strong><\/span><\/h3>\n<p style=\"color: #666666;\">\u4e4b\u524d\u63d0\u5230\u00a0<code>HSTS<\/code>\u00a0\u5934\u3002\u53ea\u8981\u8fd9\u4e2a\u5b57\u6bb5\u51fa\u73b0\u8fc7\u4e00\u6b21\uff0c\u6d4f\u89c8\u5668\u5728\u5f88\u957f\u65f6\u95f4\u91cc\u90fd\u4f1a\u53ea\u7528 HTTPS \u8bbf\u95ee\u7ad9\u70b9\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5c3d\u53ef\u80fd\u591a\u7684\u5f00\u542f HSTS\u3002<\/p>\n<p style=\"color: #666666;\">\u73b0\u5b9e\u4e2d\u7684\u52ab\u6301\u5e76\u975e\u90fd\u662f 100% \u6210\u529f\u7684\uff0c\u4e0a\u8ff0\u63d0\u5230\uff0c\u4f7f\u7528\u811a\u672c\u8df3\u8f6c\u5f88\u5bb9\u6613\u51fa\u73b0\u9057\u6f0f\u3002\u6240\u4ee5\uff0c\u53ea\u8981\u902e\u4f4f\u7528\u6237\u4e00\u6b21\u9057\u6f0f\uff0cHSTS \u5c31\u53ef\u4ee5\u8ba9\u4e4b\u540e\u7684\u9875\u9762\u964d\u7ea7\u5f7b\u5e95\u5931\u6548\u4e86\u3002<\/p>\n<hr style=\"color: #666666;\" \/>\n<h2 style=\"color: #666666;\"><span style=\"color: #262626;\"><strong>\u653b\u51fb\u6f14\u793a<\/strong><\/span><\/h2>\n<p style=\"color: #666666;\">\u56e0\u4e3a\u662f\u524d\u7aef\u52ab\u6301\uff0c\u6240\u4ee5 Demo \u6709\u4e24\u4e2a\u6587\u4ef6\uff1a\u4e00\u4e2a\u524d\u7aef\u4ee3\u7801\uff0c\u53e6\u4e00\u4e2a\u540e\u7aef\u811a\u672c\uff08NodeJS\uff09\u3002<\/p>\n<p style=\"color: #666666;\">\u76f8\u5173\u6e90\u7801\uff1a<a style=\"color: #238357;\" title=\"\" href=\"https:\/\/github.com\/EtherDream\/https_hijack_demo\" target=\"_blank\">https:\/\/github.com\/EtherDream\/https_hijack_demo<\/a><\/p>\n<p style=\"color: #666666;\">\u76f8\u6bd4\u4e4b\u524d\u5199\u7684\u6d41\u91cf\u52ab\u6301\u6f14\u793a\uff0c\u8fd9\u91cc\u529f\u80fd\u66f4\u4e3a\u4e13\u4e00\uff0c\u4e0d\u518d\u63d0\u4f9b\u989d\u5916\u7684\u52ab\u6301\u9014\u5f84\uff08\u4f8b\u5982 DNS \u7b49\uff09\u3002<\/p>\n<p style=\"color: #666666;\">\u60f3\u6d4b\u8bd5\u5176\u5b9e\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u914d\u7f6e\u6d4f\u89c8\u5668\u4ee3\u7406\uff0c\u5373\u53ef\u6a21\u62df HTTP \u7684\u52ab\u6301\uff1a<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/3311413350586.png\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/3311413350586.png\" \/><\/p>\n<p style=\"color: #666666;\">\u4e0d\u5acc\u9ebb\u70e6\u7684\u8bdd\uff0c\u4e5f\u53ef\u4ee5\u5728 Linux \u5185\u6838\u7684\u7cfb\u7edf\u4e0a\u6d4b\u8bd5\uff0c\u8f6c\u53d1 80 \u5230\u672c\u673a\u5373\u53ef\u3002\u539f\u7406\u90fd\u662f\u4e00\u6837\u7684\u3002<\/p>\n<p style=\"color: #666666;\">\u6211\u4eec\u968f\u4fbf\u627e\u4e00\u4e2a\u00a0<code>HTTP -&gt; HTTPS<\/code>\u00a0\u7f51\u7ad9\u505a\u6d4b\u8bd5\u3002<\/p>\n<p style=\"color: #666666;\">\u5f97\u76ca\u4e8e\u524d\u7aef\u811a\u672c\u7684\u4f18\u52bf\uff0c\u6211\u4eec\u628a\u9f20\u6807\u653e\u5230\u767b\u5f55\u8d85\u94fe\u63a5\u4e0a\uff0c\u72b6\u6001\u680f\u663e\u793a\u7684\u4ecd\u662f\u539f\u59cb URL\uff1a<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/52291413350588.jpg\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/52291413350588.jpg\" \/><\/p>\n<p style=\"color: #666666;\">\u5728\u6211\u4eec\u70b9\u51fb\u7684\u77ac\u95f4\uff0c\u6697\u85cf\u9875\u9762\u4e2d\u7684 XSS \u94a9\u5b50\u89e6\u53d1\u4e86\uff0c\u6210\u529f\u628a\u6211\u4eec\u5e26\u5230\u4e2d\u95f4\u4eba\u865a\u62df\u7684 HTTP \u767b\u5f55\u9875\u9762\u91cc\u3002<\/p>\n<p style=\"color: #666666;\">\u5f53\u7136\uff0c\u7531\u4e8e URL \u53c2\u6570\u5f88\u591a\uff0c\u5730\u5740\u680f\u91cc\u7684\u90a3\u4e2a\u8bb0\u53f7\u770b\u4e0d\u5230\u4e86\u3002<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/40211413350590.jpg\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/40211413350590.jpg\" \/><\/p>\n<p style=\"color: #666666;\">\u5e86\u5e78\u7684\u662f\uff0c\u6dd8\u5b9d\u7684\u767b\u5f55\u9875\u9762\u672a\u8fdb\u884c\u5730\u5740\u5224\u65ad\uff0c\u88ab\u964d\u4f4e\u540e\u7684\u9875\u9762\u4ecd\u7136\u80fd\u767b\u5f55\u6210\u529f\uff01<\/p>\n<p style=\"color: #666666;\"><img decoding=\"async\" src=\"http:\/\/static.freebuf.com\/images\/ue\/39051413350593.jpg\" alt=\"\" data-original=\"http:\/\/static.freebuf.com\/images\/ue\/39051413350593.jpg\" \/><\/p>\n<p style=\"color: #666666;\">\u5f53\u7136\u4e4b\u524d\u4e5f\u8bf4\u4e86\uff0c\u5e76\u975e\u6240\u6709\u7684\u9875\u9762\u90fd\u80fd\u52ab\u6301\u6210\u529f\u3002<\/p>\n<p style=\"color: #666666;\">\u5982\u4eca\u8d8a\u6765\u8d8a\u591a\u7684\u7f51\u7ad9\u90fd\u5df2\u91cd\u89c6\uff0c\u56e0\u6b64\u524d\u7aef\u7684\u5b89\u5168\u6027\u68c0\u6d4b\u4e5f\u968f\u4e4b\u800c\u751f\u3002\u4ec5\u4ec5\u901a\u8fc7\u4e00\u4e2a\u5de5\u5177\uff0c\u5b9e\u73b0\u5927\u89c4\u6a21\u901a\u7528\u5316\u7684\u52ab\u6301\uff0c\u672a\u6765\u4f1a\u66f4\u52a0\u56f0\u96be\u3002<\/p>\n<p style=\"color: #666666;\">\u4f46\u5148\u6bd4\u4f20\u7edf\u7684\u7eaf\u540e\u7aef\u5b9e\u73b0\uff0c\u524d\u540e\u7ed3\u5408\u7684\u65b9\u6848\u80fd\u591f\u5e26\u6765\u66f4\u5927\u7684\u53d1\u6325\u7a7a\u95f4\u3002<\/p>\n<p style=\"color: #666666;\">\u539f\u6587\u94fe\u63a5\uff1a<a style=\"color: #238357;\" title=\"\" href=\"http:\/\/www.cnblogs.com\/index-html\/p\/ssl-frontend-hijack.html\" target=\"_blank\">http:\/\/www.cnblogs.com\/index-html\/p\/ssl-frontend-hijack.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u4f60\u603b\u8ba4\u4e3a\uff0c\u4f60\u5728\u8bbf\u95ee\u67d0\u7f51\u7ad9\u65f6\uff0c\u4e0a\u4f20\u4e0b\u8f7d\u7684\u6570\u636e\u6ca1\u6709\u4efb\u4f55\u4ef7\u503c\uff0c\u90a3\u4e3a\u4f55\u4ecd\u6709\u5982\u6b64\u591a\u6ef4\u9ed1\u5ba2\u602a\u8700\u9ecd\uff0c\u9189\u5fc3\u4e8eSSL\u52ab\u6301\uff1f  &#8230; <a title=\"SSL Strip\u7684\u672a\u6765\uff1aHTTPS \u524d\u7aef\u52ab\u6301\" class=\"read-more\" href=\"https:\/\/wx.wosign.com\/?p=1380\" aria-label=\"More on SSL Strip\u7684\u672a\u6765\uff1aHTTPS \u524d\u7aef\u52ab\u6301\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/posts\/1380"}],"collection":[{"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1380"}],"version-history":[{"count":1,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/posts\/1380\/revisions"}],"predecessor-version":[{"id":1381,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=\/wp\/v2\/posts\/1380\/revisions\/1381"}],"wp:attachment":[{"href":"https:\/\/wx.wosign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wx.wosign.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}