> 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-by-path-manipulation.md).

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

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

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

استخراج \*\*مفتاح API\*\* من المستخدم **carlos**. / بيانات الاعتماد المقدمة: **wiener:peter**.

#### الملاحظات

* في **حسابي** (my-account)، يظهر \*\*مفتاح API\*\* **بشكل واضح** لحساب المستخدم الخاص بنا.

<figure><img src="/files/6e3adbe2e9e0b26dc6717bfe14bbc052b7c63f1a" alt=""><figcaption></figcaption></figure>

* في البداية، لا توجد إشارة مباشرة (في الإجابة) إلى وجود **التخزين المؤقت**.

<figure><img src="/files/134c2f4583d2ade0265aaeaef11249e8a7d66f57" alt=""><figcaption></figcaption></figure>

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

الأمثلة المختبرة:

* `/my-account/TESTTTTTT` → يتعامل التطبيق دائمًا مع هذا على أنه **my-account**

<figure><img src="/files/169b162b629d6ccf0a2bf4336e2f2945bba518d8" alt=""><figcaption></figcaption></figure>

* `/my-account/TESTTT.js` → الامتداد **.js** يتم قبوله وتفسيره (مفيد لخداع قواعد ذاكرة التخزين المؤقت)

<figure><img src="/files/6c165951bba12bc9d4883541a109a4cdbb701cf7" alt=""><figcaption></figcaption></figure>

من**خادم الاستغلال**، وأجبر الضحية على تحميل عنوان URL من نوع "static" يشير إلى my-account:

{% code overflow="wrap" %}

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

{% endcode %}

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

1. عند زيارة:

* `/my-account/jordan.js`/ نحصل على إجابة تعرض \*\*مفتاح API الخاص بـ carlos\*\*.

#### النتيجة

مفتاح API الخاص بـ **carlos** يُعرض عبر عنوان URL مُموَّه (مع `.js` الامتداد) مما يسمح لك بالاستفادة من سلوك التخزين المؤقت/توجيه المسارات (`/my-account/<quelque_chose>.js`).

<figure><img src="/files/4b8c5bda910254698b9bce8248568bf06dfca2a3" 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-by-path-manipulation.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.
