> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/web/authentication/username-enumeration-via-response-timing.md).

# Username Enumeration via Response Timing

Username Enumeration via Response Timing notes for PortSwigger Web Security Academy labs, including exploitation workflow, payload testing, Burp Suite validation, and remediation context.

### Username Enumeration via Response Timing

This lab is vulnerable to user name enumeration based on response time. To resolve it, you need to identify a valid user name, perform a raw force attack on your password, and then access your account page.

```bash
Your credentials: wiener:peter
```

### **Initial Analysis**

When testing a large number of passwords, the application displays an error message indicating that an excessive number of attempts has been detected.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-18e4eee134747be67f320dc7e8362dc65968a908%2F%7B94C85D5E-85D5-4FD4-A779-8BCC8351A49E%7D.png?alt=media" alt="" width="477"><figcaption></figcaption></figure>

To circumvent this protection, the following header is added:

```bash
X-Forwarded-For: 127.0.0.2
```

### **Response Time Measurement**

Send a request with an extremely long **password** for user `wiener`:

{% code overflow="wrap" %}

```bash
username=wiener&password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
```

{% endcode %}

It is then observed that the answer takes about **3 seconds** to arrive.

On the other hand, if the same request is sent with an invalid user name\*\*, the answer is **quasi instant**:

```bash
username=dwdwd&password=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
```

This difference therefore makes it possible to distinguish a valid **username** from a invalid.

#### **List with Intruder**

In Intruder, we use the **Pitchfork** technique.

* First position: list of **usernames** to be tested

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-197dcb9591365ae17191442c5a8886be433599ac%2F%7B6B917060-177C-43FB-BC6C-A9A265F7CEFA%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Second position: list of **different IP addresses** sent to `X-Forwarded-For`

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d04b41d186f46f44b1b240c2812a9c6587bb362f%2F%7B4501EB8A-7BA4-4D12-A530-6A2BCF8616AF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-bb65673524388490f1db31021b3246baa6780b5a%2F%7B0E72DC9F-1194-4CC3-BE7B-27566B70ACC9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

The field **response completed** is analyzed:

Responses associated with a valid user have significantly higher time (Apache indicates a much larger value).

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-c15e53d3534008714c11158246a43fbb571d8cc5%2F%7B863369CA-5117-4A5C-8AE6-F62933497E92%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

This allows to identify the correct user.

#### \*\* Brute Password Strength\*\*

After finding the valid user name, you start the attack on your password.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-4748af9aab774dc58ed5e790387038593c0c6afb%2F%7BC272F45E-E8D1-463F-9DD9-995AB7B1B41C%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

We note that the attempt with the password **chelsea** produces a different answer: a **302 Found**, sign that authentication is successful.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-aaa7587356864b4fb30b590ba5c9c9a4b5027b5b%2F%7B122670AB-B019-411C-BF83-2B4DA65EB3EF%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Access to the account is then confirmed.

<figure><img src="https://131707722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e6e8b8d15f2bf424b2259fea3884765f23561860%2F%7B815C9DA3-77D7-4CCE-8B13-27F346874840%7D.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/web/authentication/username-enumeration-via-response-timing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
