Password brute-force via password change

Abdullah Hamza
6 min readJul 27, 2024

--

To access the lab visit the following link:

This lab’s password change functionality makes it vulnerable to brute-force attacks. To solve the lab, use the list of candidate passwords to brute-force Carlos’s account and access his “My account” page.

Click on the given button to access the lab:

On the Lab’s homepage we can see “My account” option. Let’s click on that to attempt login.

Lab homepage

Let’s login using correct username and password.

login using provided credentials

We are successfully logged in to the application and we can see change password option on the “My Account” page.

Change password option on My Account page

Let’s try to change password of Wiener and capture the request in burp HTTP History. In this case I used “test” as new password.

Case 1 Correct current password

As soon as we click on “Change Password” button it says Password changed successfully!. Let’s click on “back” to see if we are still logged in or not.

Password changed successfully

And we are still logged in after changing password of wiener.

Back to My Account page

Let’s change password of wiener again and this time we will use incorrect current password. In this case I used “peter” as current password as we have already changed it to “test”.

Case 2 Incorrect current password

As soon we click on “Change password” it redirects us to the login page. It means when we try to change password and we provide incorrect current password the application logs us out.

Logged out after trying case 2

Here is the POST request of case 2 in burp HTTP History.

POST request of case 2

Let’s login again by using correct credentials and it activates the account lock for the next one minute.

This means that when we provide an incorrect password while attempting to change the password of a user, it will activate the account lock mechanism. This mechanism is designed to prevent brute force attacks.

Account locked after trying case 2

Let’s login again after one minute and test for another scenario. This time we will provide incorrect current password and mismatched new passwords.

Case 3 with mismatched new passwords

Upon clicking “Change Password,” an error message stating “Current password is incorrect” is displayed. We can observe this response in Burp Suite’s HTTP History, and notably, we are not logged out this time.

Right click and send this request to repeater.

Case 3 scenario 1 request and response in burp suite

In the Repeater tab, let’s change the current password to the correct password while leaving the new passwords mismatched. When we send this request, it returns an error stating that the “new passwords do not match” and notably, we are still logged in. This means there is no brute force protection mechanism applied here.

Case 3 scenario 2request and response in burp suite

So we identified 2 scenarios in Case 3.

Scenario 1: Incorrect Current Password

If the current password is incorrect and the new passwords don’t match, the error message displayed is: “Current password is incorrect.”

Scenario 2: Correct Current Password

If the current password is correct but the new passwords don’t match, the error message displayed is: “New passwords do not match.”

These error messages help identify the specific issue with the password change attempt, allowing for precise troubleshooting. Given this functionality, we can attempt a brute force attack on the current password field without being logged out after each failed attempt. This allows us to repeatedly try different passwords until the correct one is found.

So let’s send this request to intruder. In intruder positions tab select Attack type to Sniper.

Change value of username to carlos.

Click on “Clear §” to remove all the automatic payload positions. Highlight the value of current-password.

Click on “Add §” to mark this value as a payload position. It will be surrounded by § symbols.

Intruder positions tab

We have the password list on the lab page.

Password list provided on lab page

Navigate to the “Payloads” tab in Intruder. you can see the Payload tab in the intruder section as shown below.

In the “Payloads” section, make sure “Payload set 1” is selected, corresponding to the position you marked.

Under “Payload sets”, select “Simple list”.

Copy the passwords provided and click on paste in intruder’s Payload section to add list.

Now that we have set the payload click on “start attack” button.

Passwords added to payload

Burp Suite will start sending requests with the corresponding payload defined in the list and display results in the Intruder tab.

Brute force results in intruder tab

Upon viewing the results we can differentiate unique requests based on length and we found a request with length, different than others.

unique request found

Let’s render the response of this request, and we can see it says “New passwords do not match.” This indicates that the current password provided in this request was the correct password for Carlos.

Response rendered

Let’s log out from Wiener’s account and attempt to log in to Carlos’ account using the password we identified.

Login using carlos credentials

As soon as we click on login, we successfully access Carlos’ “My Account” page, and the lab is marked as solved.

Congratulations! The walkthrough of Twelfth authentication lab finishes here.

You can see walkthrough of Thirteenth lab by clicking the following link:

--

--

Abdullah Hamza
Abdullah Hamza

Written by Abdullah Hamza

Developer | CEH | Penetration Tester | Red Team

No responses yet