⚗️Lab: Finding and exploiting an unused API endpoint
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.
Solutions
METHOD ONE:
Open Burp Suite
Visit the target URL
Login username as wiener and password as peter
View the specified product
Send the
API/products/1/pricerequest to repeaterChange the GET method to PATCH
Add a
Content-Typeheader asapplication/jsonAdd a json object
{"price":0}Send the request
Add the product to the cart
Place order

METHOD TWO
In Burp's browser, access the lab and click on a product.
In Proxy > HTTP history, notice the API request for the product. For example,
/api/products/3/price.Right-click the API request and select Send to Repeater.
In the Repeater tab, change the HTTP method for the API request from
GETtoOPTIONS, then send the request. Notice that the response specifies that theGETandPATCHmethods are allowed.Change the method for the API request from
GETtoPATCH, then send the request. Notice that you receive anUnauthorizedmessage. This may indicate that you need to be authenticated to update the order.In Burp's browser, log in to the application using the credentials
wiener:peter.Click on the Lightweight "l33t" Leather Jacket product.
In Proxy > HTTP history, right-click the
API/products/1/pricerequest for the leather jacket and select Send to Repeater.In the Repeater tab, change the method for the API request from
GETtoPATCH, then send the request. Notice that this causes an error due to an incorrectContent-Type. The error message specifies that theContent-Typeshould beapplication/json.Add a
Content-Typeheader and set the value toapplication/json.Add an empty JSON object
{}as the request body, then send the request. Notice that this causes an error due to the request body missing apriceparameter.Add a
priceparameter with a value of0to the JSON object{"price":0}. Send the request.In Burp's browser, reload the leather jacket product page. Notice that the price of the leather jacket is now
$0.00.Add the leather jacket to your basket.
Go to your basket and click Place order to solve the lab.
Last updated
Was this helpful?