> 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/username-enumeration-via-different-responses.md).

# Username enumeration via different responses

## Lab description

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FvFIAchoW8Ub1nV2BVtXP%2Fimage.png?alt=media&amp;token=67040c69-309b-4e53-a724-e29575b01177" alt=""><figcaption></figcaption></figure>

## Solution

### Step 1: Capturing the Login Request

The first step is to capture the login request using an interception with Burp Suite.\
As shown in the request, there are two parameters: `username` and `password`.

### Step 2: Enumerating the Username

* **Send the Intercepted Request to Intruder**:\
  In Burp Suite, send the captured request to Intruder. Clear all the selected positions and mark only the `username` field as a payload position.
* **Configure Payloads**:\
  In the Payloads tab, paste the provided list of usernames.
* **Start the Attack**:\
  Initiate the attack to test each username.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2F58FERoBSjXNX2UXsAIKx%2Fimage.png?alt=media&amp;token=234a2ce9-5740-4fb1-9089-d5b5ce1b68cf" alt=""><figcaption></figcaption></figure>

### &#x20;Step 3: Identifying the Valid Username

* **Analyze the Responses**:\
  After the attack is completed, look at the response lengths.
  * One of the usernames will have a **different response length** compared to the others.
  * Upon reviewing the rendered page, this username will also display a **different error message**, confirming it as valid.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FcVKuASM6TQUQiJY7lXX3%2Fimage.png?alt=media&amp;token=d758a61c-c33a-4c67-a3e1-bfda6b057368" alt=""><figcaption></figcaption></figure>

Upon getting the correct Username, we proceed to brute force the passwords as follows

### Step 4: Brute-Forcing the Password

* **Set Up the Password Attack**:\
  Repeat the same process, but this time mark the `password` field as the payload position. Use the provided password list as payloads.
* **Start the Attack**:\
  Launch the attack to test each password.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FkOEcHZeIuWaBalZF6OPh%2Fimage.png?alt=media&amp;token=539b0813-5086-4423-b0dd-631fd266a099" alt=""><figcaption></figcaption></figure>

### Step 5: Identifying the Correct Password

* **Analyze the Responses**:\
  Once the attack is complete, look for a response with:
  * A **different length** from the others.
  * A **status code 302** or a success message in the response, indicating a successful login.
* **Result**:
  * The username and password pair is now verified, and you can use them to access the account.

<figure><img src="https://2387347627-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F47EuhANOY5sIuDySBX97%2Fuploads%2FBFVnPowtDUvHX0cMqVzR%2Fimage.png?alt=media&amp;token=090d7f95-fd1d-4696-9f7b-79cfe913bfca" alt=""><figcaption></figcaption></figure>
