> 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-cache-via-origin-server-side-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/cheating-cache-via-origin-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.
