javascript clickjacking framebusting

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript clickjacking framebusting相关的知识,希望对你有一定的参考价值。

<style id="antiClickjack">body{display:none !important;}</style>
<script type="text/javascript">
//clickjacking framebusting
  (function() {
    "use strict"
    function unlock() {
      var antiClickjack = document.getElementById("antiClickjack");
      antiClickjack.parentNode.removeChild(antiClickjack);
    }
    if (top == self) { // page is not embedded
      unlock();
    } else { // page embedded, check for same domain
      try { // try to access a property of parent to check same domain
        var loc = parent.location.href;
        unlock();
      } catch (e) { } // fail gracefully and stay hidden
    }
  })();
</script>

以上是关于javascript clickjacking framebusting的主要内容,如果未能解决你的问题,请参考以下文章

Django之clickjacking攻击

Clickjacking(点击劫持)

点击劫持(ClickJacking)漏洞挖掘及实战案例全汇总

点击劫持(ClickJacking)

php Clickjack保护

点击劫持(ClickJacking)