Created
October 5, 2015 17:16
-
-
Save gabemarshall/54788bef54823e6a1c25 to your computer and use it in GitHub Desktop.
Dom based xss example
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
var debug = document.getElementById("subnav") | |
function _Debug_(p) { | |
p = p.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var r = new RegExp("[\\?&]" + p + "=([^&#]*)"), | |
results = r.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
if(location.search){ | |
debug.innerHTML += _Debug_("param")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment