> 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/de/web/authentication/brute-forcing-a-stay-logged-in-cookie.md).

# Brute-Forcing eines persistenten Session-Cookies

### Brute-Forcing eines Stay-logged-in-Cookies

Dieses Labor ermöglicht es Benutzern, auch dann verbunden zu bleiben, nachdem sie ihren Browser geschlossen haben. Der für diese Funktion verwendete Cookie ist anfällig für Brute-Force-Angriffe. / Um das Labor zu lösen, müssen Sie Carlos’ Cookie per Brute-Force ermitteln, um auf seine My-account-Seite zuzugreifen.

**Bereitgestellte Zugangsdaten:** `wiener:peter`/ \*\* Name des Opfers:\*\* `carlos`

### \*\*Analyse des Mechanismus

Wenn Sie die Option für automatische Wiederverbindung aktivieren, wird die folgende Anfrage gesendet:

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

<figure><img src="/files/114e6d54d0a72a3b7c9608183a236c72b6d7e040" alt=""><figcaption></figcaption></figure>

Der Server gibt dann einen Cookie mit dem Namen **stay-logged-in**, dessen Inhalt in Base64 kodiert ist:

```bash
d2llbmVyOjUxZGMzMGRkYzQ3M2Q0M2E2MDExZTllYmJhNmNhNzcw
```

<figure><img src="/files/2f85fcda40b4725b5daf48e86eca9567aaf1a5a3" alt=""><figcaption></figcaption></figure>

Nach der Dekodierung erhalten wir:

```bash
wiener:51dc30ddc473d43a6011e9ebba6ca770
```

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

Die Struktur des Cookies ist daher:

Durch Prüfen des Hashs über CrackStation entdecken wir, dass er dem Wert **peter** in MD5 entspricht.

<figure><img src="/files/5efc4562f38e5e33671a3f46ed1dfb9b6cade7be" alt=""><figcaption></figcaption></figure>

### **Brute-Force-Einrichtung**

1. Senden Sie die Cookie-Anfrage an **Burp Intruder** und wählen Sie den Cookie-Wert als Injektionsbereich aus.

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

In der Payload-Verarbeitung:

* eine Transformation hinzufügen, die einen Hash erzeugt **MD5**;

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

* einen Präfix hinzufügen: `carlos:`

<figure><img src="/files/35790a6bf228bb86d996861f1a38610e1e3ecbba" alt=""><figcaption></figcaption></figure>

* alles in **Base64**.

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

1. Laden Sie die Passwortliste in den Payload-Einstellungen.

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

Während des Angriffs zeigt eine Antwort **200** den richtigen Cookie für Carlos an.

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

Der erhaltene Cookie lautet:

```bash
Y2FybG9zOjdkOGJjNWYxYThkMzc4N2QwNmVmMTFjOTdkNDY1NWRm
```

Dekodierung

{% code overflow="wrap" %}

```bash
echo -n "Y2FybG9zOjdkOGJjNWYxYThkMzc4N2QwNmVmMTFjOTdkNDY1NWRm" | base64 -d ;echo
```

{% endcode %}

* carlos:7d8bc5f1a8d3787d06ef11c97d4655df

Durch Prüfen dieses Hashs auf CrackStation stellen wir fest, dass das zugehörige Passwort **taylor**.

<figure><img src="/files/063c33ff979b9ba372daa7acf3c6292fa90f93ae" 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/de/web/authentication/brute-forcing-a-stay-logged-in-cookie.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.
