Created
July 8, 2017 00:22
-
-
Save gabrielizalo/5ccca26fa8b1b3deb33a885a97554915 to your computer and use it in GitHub Desktop.
.Net - Anti ClickJacking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body{display:none;} | |
</style> | |
<script> | |
if(self==top){ | |
document.getElementsByTagName("body")[0].style.display="block"; | |
}else{ | |
top.location=self.location; | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To prevent all framing of this content | |
response.addHeader("X-FRAME-OPTIONS", "DENY"); | |
// To allow framing of this content only by this site | |
response.addHeader("X-FRAME-OPTIONS", "SAMEORIGIN"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment