> 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/es/web/authentication/username-enumeration-via-response-timing.md).

# Enumeración de nombres de usuario mediante tiempos de respuesta

Notas sobre Enumeración de nombres de usuario mediante tiempos de respuesta para los laboratorios de PortSwigger Web Security Academy, incluido el flujo de explotación, pruebas de payload, validación en Burp Suite y contexto de mitigación.

### Enumeración de nombres de usuario mediante el tiempo de respuesta

Este laboratorio es vulnerable a la enumeración de nombres de usuario basada en el tiempo de respuesta. Para resolverlo, necesitas identificar un nombre de usuario válido, realizar un ataque de fuerza bruta contra tu contraseña y luego acceder a la página de tu cuenta.

```bash
Tus credenciales: wiener:peter
```

### **Análisis inicial**

Al probar una gran cantidad de contraseñas, la aplicación muestra un mensaje de error que indica que se ha detectado un número excesivo de intentos.

<figure><img src="https://754079710-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>

Para eludir esta protección, se añade el siguiente encabezado:

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

### **Medición del tiempo de respuesta**

Envía una solicitud con una **contraseña** para el usuario `wiener`:

{% code overflow="wrap" %}

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

{% endcode %}

Entonces se observa que la respuesta tarda aproximadamente **3 segundos** en llegar.

Por otro lado, si la misma solicitud se envía con un nombre de usuario inválido\*\*, la respuesta es **casi instantánea**:

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

Esta diferencia, por lo tanto, permite distinguir un usuario válido **nombre de usuario** de uno inválido.

#### **Lista con Intruder**

En Intruder, usamos la **Pitchfork** técnica.

* Primera posición: lista de **nombres de usuario** para probar

<figure><img src="https://754079710-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>

Segunda posición: lista de **diferentes direcciones IP** enviadas a `X-Forwarded-For`

<figure><img src="https://754079710-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://754079710-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>

El campo **respuesta completada** se analiza:

Las respuestas asociadas a un usuario válido tienen un tiempo significativamente mayor (Apache indica un valor mucho más alto).

<figure><img src="https://754079710-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>

Esto permite identificar al usuario correcto.

#### \*\*Fuerza bruta de la contraseña\*\*

Después de encontrar el nombre de usuario válido, inicias el ataque sobre tu contraseña.

<figure><img src="https://754079710-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>

Observamos que el intento con la contraseña **chelsea** produce una respuesta diferente: un **302 Found**, señal de que la autenticación es exitosa.

<figure><img src="https://754079710-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>

A continuación se confirma el acceso a la cuenta.

<figure><img src="https://754079710-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/es/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.
