Secur1ty just lik3 a girl. B0th of th3m h4ve s0me h0les. Y0u alw4ys try to t0uch the h0le, but n0t 3very tim3 y0u c4n 3xpl0it it!
查看文章 |
IE 8 对ClickJacking 的防御
2009-02-01 11:27
对Clickjacking 还不明白的可以先google 最近IE 8 RC1 发布了,也多了一个新特性,对ClickJacking的防御。 具体可以参考: http://blogs.msdn.com/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx 由于IE是个浏览器,所以微软就大方的发挥了浏览器的先天优势,造了一个 HTTP 头来防御ClickJacking X-FRAME-OPTIONS 具体用法摘录原文如下: Web developers can send a HTTP response header named X-FRAME-OPTIONS with HTML pages to restrict how the page may be framed. If the X-FRAME-OPTIONS value contains the token DENY, IE8 will prevent the page from rendering if it will be contained within a frame. If the value contains the token SAMEORIGIN, IE will block rendering only if the origin of the top level-browsing-context is different than the origin of the content containing the X-FRAME-OPTIONS directive. For instance, if http://shop.example.com/confirm.asp contains a DENY directive, that page will not render in a subframe, no matter where the parent frame is located. In contrast, if the X-FRAME-OPTIONS directive contains the SAMEORIGIN token, the page may be framed by any page from the exact http://shop.example.com origin. 不喜欢看鸟语的,可以看我的小结: 1. 返回的HTTP 头中,如果是 X-Frame-OPTIONS: DENY ,那么这个页面就不能被嵌入在iframe里面,IE会报告个错误提示 2. 返回的HTTP 头中,如果是 X-Frame-OPTIONS: SAMEORIGIN ,那么这个页面只能被嵌入在 ”与TOP 页面同源“ 的页面中。(熟悉同源策略的应该很好理解) 对于程序员来说:就是要在重要的页面,加上这个HTTP返回头。 能够起到同样效果的,有frame busting 的技巧 我们经常可以看到这样一段JS: <script type="text/javascript">if (top!=self) top.location.href=self.location.href;</script> |
最近读者:

