On this page
Username Enumeration via Different Responses
Lab
Username enumeration via different responses · Apprentice
Solution
Given
This lab is vulnerable to username enumeration and password brute-force attacks. It has an account with a predictable username and password, which can be found in the following wordlists:
Candidate usernames
Candidate passwords
To solve the lab, enumerate a valid username, brute-force this user's password, then access their account page.
Analyzing the task
We're given wordlists of names and passwords. We need to set up a brute-force attack. First guess the name, then the password. To solve the lab we need to log into the victim's account.
Recon
Login goes through:
POST /login
username=VARIABLE&password=123
We've been given a list of names to enumerate. Copy it and create an Intruder attack. Make username a variable — 101 names to test. The server always responds with 200, so we filter by response length. Here's our candidate — asterix.
Second step — guess the password:
username=asterix&password=VARIABLE
Same way, take the list — 100 passwords. Launch, here we can rely on the 302 redirect:
HTTP/2 302 Found
Location: /my-account?id=asterix
That means the password worked. Password found — computer.
Lab solved.
More in this category
Arbitrary Object Injection in PHP (PortSwigger Lab)
Recovering leaked source code and injecting a serialized CustomTemplate object whose __destruct deletes an arbitrary file.
Using Application Functionality to Exploit Insecure Deserialization (PortSwigger Lab)
Tampering with the `avatar_link` field in the session object to delete an arbitrary file via the account-delete feature.
Modifying Serialized Data Types (PortSwigger Lab)
Abusing PHP loose comparison by changing the `access_token` type to integer `0` to bypass authentication.