Lab Covered
This write-up focuses on the following APPRENTICE-level lab from the PortSwigger Web Security Academy:
1 Exploiting an API endpoint using documentation
This lab demonstrates how attackers can take advantage of publicly available API documentation to uncover and exploit sensitive endpoints. It emphasizes the importance of not exposing functionality that should remain private.
LAB 1 - Exploiting an API endpoint using documentation
Lab Description :
Solution :
Login as Wiener with the provided credentials - wiener:peter.
Now when we change the email of wiener, the browser sends the folowing PATCH request to /api/user/wiener
So we remove wiener form request to see what will happen and we can see below it is giving us Malformed url error
If we remove user/wiener and send the request, the server responds with a 302 redirect. Following the redirect leads us to the REST API documentation.
Now we can delete the user carlos by sending a DELETE request to /api/user/carlos.
Now we have deleted carlos’s account & thus solved the lab.