Lab: Username enumeration via response timing
This lab is vulnerable to username enumeration using its response times. To solve the lab, enumerate a valid username, brute-force this user's password, then access their "My account" page.
Tip: To add to the challenge, the lab also implements a form of IP-based brute-force protection. However, this can be easily bypassed by manipulating HTTP request headers.
With Burp running, submit an invalid username and password, then send the
POST /loginrequest to Burp Repeater. Experiment with different usernames and passwords. Notice that your IP will be blocked if you make too many invalid login attempts.
Identify that the
X-Forwarded-Forheader is supported, which allows you to spoof your IP address and bypass the IP-based brute-force protection.
- Continue experimenting with usernames and passwords. Pay particular attention to the response times. Notice that when the username is invalid, the response time is roughly the same. However, when you enter a valid username (your own), the response time is increased depending on the length of the password you entered.
Send this request to Burp Intruder and select the attack type to "Pitchfork". Clear the default payload positions and add the
Add payload positions for the
X-Forwarded-Forheader and the
usernameparameter. Set the password to a very long string of characters (about 100 characters should do it).
- On the "Payloads" tab, select payload set 1. Select the "Numbers" payload type. Enter the range 1 - 100 and set the step to 1. Set the max fraction digits to 0. This will be used to spoof your IP.
- Select payload set 2 and add the list of usernames. Start the attack.
- When the attack finishes, at the top of the dialog, click "Columns" and select the "Response received" and "Response completed" options. These two columns are now displayed in the results table.
- Notice that one of the response times was significantly longer than the others. Repeat this request a few times to make sure it consistently takes longer, then take note of this username.
Create a new Burp Intruder attack for the same request. Add the
X-Forwarded-Forheader again and add a payload position to it. Insert the username that you just identified and add a payload position to the
- On the "Payloads" tab, add the list of numbers in payload set 1 and add the list of passwords to payload set 2. Start the attack.
- When the attack is finished, find the response with a 302 status. Take note of this password.
- Back in your browser, reload the login page so that you have a valid CSRF token. Then, log in using the username and password that you noted down.
- Click "My account" to access the victim's account page and solve the lab.