> 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/authentication/password-reset-poisoning-via-middleware.md).

# تسميم إعادة تعيين كلمة المرور عبر الوسيط البرمجي

### تسميم إعادة تعيين كلمة المرور عبر البرمجية الوسيطة

هذا المختبر عرضة لهجوم من نوع **تسميم إعادة تعيين كلمة المرور**. / المستخدم **carlos** ينقر بشكل منهجي على الروابط الموجودة في رسائل البريد الإلكتروني التي يتلقاها.

الهدف النهائي: **الوصول إلى حساب كارلوس**.

* بيانات اعتماد صالحة:
* `wiener:peter`
* يمكن الوصول إلى رسائل البريد الإلكتروني المرسلة إلى حسابنا عبر \*\*عميل البريد الإلكتروني لخادم الاستغلال\*\*.

<figure><img src="/files/063652178401a7f22572691dba7756235e952673" alt=""><figcaption></figcaption></figure>

ميزة إعادة تعيين كلمة المرور متاحة وتسمح بإدخال اسم مستخدم.

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

عندما تبدأ طلب إعادة تعيين باستخدام حسابنا نفسه (`wiener`)، يتم إرسال بريد إلكتروني يحتوي على رابط من هذا النوع:

{% code overflow="wrap" %}

```bash
https://0a45005104c7f2228168b62400a90036.web-security-academy.net/forgot-password?temp-forgot-password-token=wadsb5f13habt0byz2ifrf68srpga96p
```

{% endcode %}

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

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

<figure><img src="/files/891e10a637ed96cb6b72c102272c91726980c26c" alt=""><figcaption></figcaption></figure>

**اختبار التلاعب عبر Burp Suite**

من خلال اعتراض طلب إعادة تعيين كلمة المرور باستخدام **Burp Suite**، نضيف ترويسة HTTP التالية:

```http
X-Forwarded-Host: test.com

username=wiener
```

لا تزال الرسالة الإلكترونية المستلمة تحتوي على الرمز المميز الصالح، ولكن \*\*l

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

يشير هذا إلى أن التطبيق \*\* يثق بـ `X-Forwarded-Host`\*\* الترويسة لإنشاء رابط إعادة التعيين.

```http
X-Forwarded-Host: exploit-0af100e80420f2c381b0b5a301a8008c.exploit-server.net

username=carlos
```

**الاستغلال على الضحية**

كرر الهجوم، وهذه المرة مستهدفًا **carlos** واستخدم عنوان URL الخاص بـ **خادم الاستغلال**

يتم إرسال بريد إلكتروني إلى كارلوس يحتوي على رابط إعادة تعيين **مستضاف على خادم الاستغلال الخاص بنا**، مع رمز صالح **رمز**:

```bash
/forgot-password?temp-forgot-password-token=r5jf8u0c48zh54pgoqx8jol619pboi3i
```

<figure><img src="/files/50cdf0b033edb5861ef7a7cbbfaeb84c1ca164ea" 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/authentication/password-reset-poisoning-via-middleware.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.
