博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
被嵌套到iframe里面强制跳转方法,防止强制跳转方法
阅读量:2389 次
发布时间:2019-05-10

本文共 360 字,大约阅读时间需要 1 分钟。

自动判断当前的location是否是顶层的,即是否被嵌套到iframe里面了,如果是,则强制跳转。

 

防止强制跳转方法:即增加两个:security="restricted" sandbox="",前者是IE的禁止js的功能,后者是HTML5的功能。刚好就可以让IE,Chrome,Firefox这三大浏览器都实现了禁止iframe的自动跳转。但这样iframe里面的所有js也不能用了。

 

sandbox 属性

 

"" 应用以下所有的限制。

allow-same-origin 允许 iframe 内容被视为与包含文档有相同的来源。
allow-top-navigation 允许 iframe 内容从包含文档导航(加载)内容。
allow-forms 允许表单提交。
allow-scripts 允许脚本执行。

其它方法:

转载地址:http://ybaab.baihongyu.com/

你可能感兴趣的文章
Modifying SSH to Capture Login Credentials from Attackers
查看>>
nikto 2.1 coming
查看>>
How to own a Windows Domain
查看>>
Longcat – multi-protocol stress testing tool
查看>>
数据流0day原理+实践
查看>>
淺談以STIX實現網路威脅情報標準化框架
查看>>
Top IT management trends - the next 5 years
查看>>
推荐 OWASP - Transport Layer Protection Cheat Sheet
查看>>
AutoNessus v1.3.2 released
查看>>
hack tools
查看>>
rhel5中管理swap空间
查看>>
/proc filesystem allows bypassing directory permissions on Linux
查看>>
nginx dos
查看>>
RASP解决方案包括开源方案
查看>>
Linux下共享文件系统文件传输的简单设计(转载)
查看>>
点评Ubuntu下的文件安全删除工具
查看>>
数据可视化
查看>>
Security Ressources Sites
查看>>
mysql的比较运算
查看>>
Data Breach Report
查看>>