Web Attacks - Writeup
Web Attacks — Skill Assessment Writeup
Step 1: IDOR — User Enumeration
The application manages sessions using a uid cookie. Modifying this value allows impersonating other users.
While browsing profiles, an API call fetches user data via a URL parameter:
1 | GET /api/user?id=52 |
Using Burp Suite Intruder (Battering Ram) to enumerate user IDs and filtering responses for Administrator with grep:
1 | { |
Step 2: Understand the password-reset flow
The password reset function calls two endpoints:
- GET /api.php/token/52
- POST /reset.php
The first endpoint provides a token which we will need for the second one - the second endpoint is a POST request with the following body:
1 | uid=52&token=e51a85fa-17ac-11ec-8e51-e78234eb7b0c&password=test |
However after trying, we get a Access denied…
Step 3: HTTP Verb Tampering — Admin Password Reset
The password reset endpoint only restricted specific HTTP methods. Switching the verb allowed resetting the admin password.
Step 4: XXE — Local File Read
Logged in as admin, the Add Event feature sends an XML body:
1 | <root> |
The <name> field is reflected in the response. Using a PHP filter wrapper to base64-encode file contents avoids issues with newlines and special characters breaking reflection:
1 |
|
Response:
1 | Event '<base64string>' has been created. |
Decode:
1 | echo "<base64string>" | base64 -d |