Last active
May 6, 2019 09:10
-
-
Save BombekeQuinten/047802dfb18000a89b94775ab84e59e7 to your computer and use it in GitHub Desktop.
Intigriti XSS Challenge
This file contains 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
<script> | |
const url = new URL(decodeURIComponent(document.location.hash.substr(1))).href.replace(/script|<|>/gi, "forbidden"); | |
const iframe = document.createElement("iframe"); iframe.src = url; document.body.appendChild(iframe); | |
iframe.onload = function(){ window.addEventListener("message", executeCtx, false);} | |
function executeCtx(e) { | |
if(e.source == iframe.contentWindow){ | |
e.data.location = window.location; | |
Object.assign(window, e.data); | |
eval(url); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment