> For the complete documentation index, see [llms.txt](https://kruknight.gitbook.io/daemon-of-hacking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kruknight.gitbook.io/daemon-of-hacking/writeups/portswigger-labs/authentication/broken-brute-force-protection-multiple-credentials-per-request.md).

# Broken brute-force protection, multiple credentials per request

## Lab Description

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FovjmcZQ0bGUlo2l7ZJqG%2Fimage.png?alt=media&amp;token=27a6ee65-7d00-416b-9b6b-3ffc6f81413c" alt=""><figcaption></figcaption></figure>

## Walkthrough

### **Step 1: Analyzing the Behavior**

After logging in with the provided credentials (`wiener:peter`), I attempted to brute-force the login by iterating through the candidate passwords. However, I encountered an account lockout message, indicating a brute-force protection mechanism was in place.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FcyXDSfNCQjW4E4ALoyA9%2Fimage.png?alt=media&amp;token=101e2071-09aa-446b-876e-8b8f02b61017" alt=""><figcaption></figcaption></figure>

Upon inspecting the login request in Burp Suite, I noticed that the `username` and `password` were sent in JSON format:

This hinted that the server might accept an array of passwords instead of a single password.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FLldq01x4g8L8FXeC9tIO%2Fimage.png?alt=media&amp;token=607c7d8a-b06c-46a5-85ae-4aa1566f6c0a" alt=""><figcaption></figcaption></figure>

### **Step 2: Bypassing the Protection**

To exploit this vulnerability:

1. I modified the `password` field to include an array of candidate passwords:

The server responded with a `302 Found`, redirecting me to Carlos's account. This confirmed that one of the passwords in the array was correct, and the system did not block the request due to brute-force protection.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2Fr7Z4G8MOqF8TBhTayblN%2Fimage.png?alt=media&amp;token=4816e9f0-3379-407c-81f7-8de332793e61" alt=""><figcaption></figcaption></figure>

### **Step 3: Verifying the Password**

Since the exact password was not revealed in the response:

1. I forwarded the request to the browser using Burp Suite's "Request in browser in original session" feature.
2. I logged in successfully to Carlos's account.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FdkDfq6tkCs9Vyl4nH0PQ%2Fimage.png?alt=media&amp;token=f85d97e7-94d7-41c9-a5b9-9c248446c37f" alt=""><figcaption></figcaption></figure>
