Finding and exploiting an unused API endpoint
Description
To solve the lab, exploit a hidden API endpoint to buy a Lightweight l33t Leather Jacket. You can log in to your own account using the following credentials: wiener:peter
.
Approach
After accessing the lab, I enabled the FoxyProxy extension to proxy all my requests through Burp Suite to monitor any interactions with an API. I found this request which retrieves the price of a product:
First, I wanted to see if changing the HTTP method would alter its behavior. I sent the request to Burp Intruder and added a payload marker at the HTTP method. In the payloads tab, I chose the HTTP verbs
list (note: adding lists is available in Burp Suite Pro, but you can manually build your own list if needed).
After sending the attack, I filtered the responses by length and found one with a different length using the PATCH
HTTP method. The response indicated that the content should be sent as JSON:
I used the Content-Type Converter extension to change the content type to JSON and resent the request. A new error message indicated that a parameter named price
was missing. I added this parameter and resent the request:
The response was:
I set the price to 0
and sent the request again, which resulted in a 200 response:
After reloading the page, I saw that the leather jacket was now priced at $0. I bought it and solved the lab.