Created
September 23, 2019 15:08
-
-
Save terjanq/0906a6364bf7939e9a6f6e3f924e0459 to your computer and use it in GitHub Desktop.
XSS Challenge DOM Clobbering
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
window.CONFIG = window.CONFIG || { | |
version: "v20190816", | |
test: false, | |
appName: "XSS Challenge", | |
} | |
function loadModule(moduleName) { | |
const scriptSrc = new URL(document.currentScript.src); | |
let url = ''; | |
if (CONFIG.test && window.testPath) { | |
url = window.testPath.protocol + '//' + window.testPath.host; | |
} else { | |
url = scriptSrc.origin; | |
} | |
url += `/xss/1/modules/${CONFIG.version}/${moduleName}.js`; | |
const sc = document.createElement('script'); | |
sc.src = url; | |
document.body.appendChild(sc); | |
} | |
loadModule('h1-magic'); | |
loadModule('tracker'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment