Skip to content

Instantly share code, notes, and snippets.

@carlosvillasanchez
Created October 30, 2021 09:18
Show Gist options
  • Save carlosvillasanchez/c3a56cacb23ba4754bb77f0efd43f41e to your computer and use it in GitHub Desktop.
Save carlosvillasanchez/c3a56cacb23ba4754bb77f0efd43f41e to your computer and use it in GitHub Desktop.
window.addEventListener("DOMContentLoaded", function () {
jsCode = `)]}'` + new URL(location.href).searchParams.get("xss");
lastElementOfBody = document.getElementById("body").lastElementChild;
if (lastElementOfBody.id === "intigriti") {
lastElementOfIntigriti = lastElementOfBody.lastElementChild;
htmlOfLastElementOfIntigriti = lastElementOfIntigriti.innerHTML.trim();
jsPrefix = htmlOfLastElementOfIntigriti.substr(htmlOfLastElementOfIntigriti.length - 4);
jsCode = jsPrefix + jsCode;
}
let scriptTag = document.createElement("script");
scriptTag.type = "text/javascript";
scriptTag.appendChild(document.createTextNode(jsCode));
document.body.appendChild(scriptTag);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment