> 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 el tiempo de respuesta

### 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 sobre 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="/files/795d8c853f2123103d6d959712635248a2f6583a" 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 extremadamente larga **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 se envía la misma solicitud con un nombre de usuario\*\* inválido, la respuesta es **casi instantánea**:

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

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

#### **Lista con Intruder**

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

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

<figure><img src="/files/e92209290f283d18a273786ee970bf382921e251" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/d0c37e66bcf37e232f8d549c71f1187a7ada6508" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/983b3e32b13c3bd36de51bb38c96c938eadfc00c" alt=""><figcaption></figcaption></figure>

El campo **respuesta completada** se analiza:

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

<figure><img src="/files/6c89a14187f48a100d7bed348b22b8d4b187b861" 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, comienzas el ataque sobre tu contraseña.

<figure><img src="/files/5a5a42b2a39626108fc33f32d64d8c3cf4efa3aa" 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 se ha realizado con éxito.

<figure><img src="/files/9371a9530f0e57bb9035ab632df79efbf8c76008" alt=""><figcaption></figcaption></figure>

Entonces se confirma el acceso a la cuenta.

<figure><img src="/files/602fb5c2b3f4daed02f6ae69b018d7ba0b79f0ad" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
