> 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/web-cache-poisoning-via-unkeyed-query-string.md).

# تسميم ذاكرة التخزين المؤقت للويب عبر سلسلة استعلام غير مُمفهرسة

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

يعرض هذا المختبر ثغرة في تسميم ذاكرة التخزين المؤقت للويب بسبب حقيقة أن **سلسلة الاستعلام غير مُضمنة في مفتاح ذاكرة التخزين المؤقت**. يقوم مستخدم شرعي بزيارة الصفحة الرئيسية للموقع بانتظام باستخدام **جوجل كروم**.

الهدف هو تسميم الصفحة الرئيسية بحيث تعيد استجابة تحتوي على **جافا سكريبت قيد التنفيذ `alert(1)`** في متصفح الضحية.

***

**الخطوة 1: اعتراض الصفحة الرئيسية**

يتم اعتراض الطلب إلى جذر الموقع (`/`) يتم اعتراضه. / في الاستجابة، نلاحظ وجود رابط أساسي **الرابط**، مما يشير إلى أن بعض عناصر عنوان URL يمكن عكسها في HTML.

***

**الخطوة 2: اختبار سلسلة الاستعلام**

تتم إضافة سلسلة استعلام عشوائية إلى عنوان URL:

```bash
/?test
```

القيمة منعكسة بشكل جيد **في الاستجابة**، مما يؤكد أن سلسلة الاستعلام تؤثر في المحتوى المُعاد.

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

**الخطوة 3: حقن HTML**

ثم يتم تعديل سلسلة الاستعلام لحقن HTML:

```bash
/?test'/><h1>JORDAN</h1>
```

الـ `<h1>` يتم تفسير الوسم بشكل صحيح بواسطة المتصفح، مما يثبت وجود \*\*حقن HTML\*\* قابل للاستخدام.

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

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

**الخطوة 4: حقن JavaScript (تسميم ذاكرة التخزين المؤقت)**

استبدل حقن HTML بحمولة JavaScript:

```bash
/?test'/><script>alert(1)</script>
```

تحتوي الإجابة الآن على السكربت، والذي \*\*يتم تشغيله بواسطة المتصفح\*\*.

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

**النتيجة**

بما أن سلسلة الاستعلام **غير مُضمنة في مفتاح ذاكرة التخزين المؤقت**، يتم تخزين الاستجابة المسمومة وتقديمها للمستخدمين الآخرين الذين يزورون الصفحة الرئيسية. / ثم يقوم الضحية تلقائيًا بتشغيل تنفيذ `alert(1)` أثناء زيارته، مما يثبت نجاح المختبر.

<figure><img src="/files/7a18604af4ccf3cf28757fdf1587b98b604fe0e2" 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/ar/web/cache-poisoning/web-cache-poisoning-via-unkeyed-query-string.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.
