Skip to content

Instantly share code, notes, and snippets.

@BombekeQuinten
Last active May 6, 2019 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BombekeQuinten/047802dfb18000a89b94775ab84e59e7 to your computer and use it in GitHub Desktop.
Save BombekeQuinten/047802dfb18000a89b94775ab84e59e7 to your computer and use it in GitHub Desktop.
Intigriti XSS Challenge
<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