> 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/race-conditions/single-endpoint-race-condition.md).

# حالة سباق في نقطة نهاية واحدة

### حالات سباق لنقطة نهاية واحدة

### سياق المختبر

تحتوي ميزة تغيير عنوان البريد الإلكتروني على **حالة سباق** تتيح لك ربط عنوان عشوائي بحسابنا.

لدى مستخدم بعنوان **<carlos@ginandjuice.shop>** لديه **دعوة معلّقة** ليصبح مشرفًا، ولكن **لم ينشئ حسابًا بعد**. / لذا إذا تمكن أحدهم من **إعادة بيع هذا العنوان**، فإنه يسترجع تلقائيًا **صلاحيات المشرف**.

### الهدف

1. اعثر على حالة سباق للاستحواذ على عنوان بريد إلكتروني عشوائي.
2. غيّر بريد الحساب الإلكتروني إلى **<carlos@ginandjuice.shop>**.
3. الوصول إلى **لوحة الإدارة**.
4. حذف المستخدم **carlos**.

بيانات الاعتماد المقدَّمة: **wiener:peter**/ الوصول إلى عميل بريد إلكتروني للعناوين **@exploit-...exploit-server.net**.

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

المحاولة الأولى هي تغيير البريد الإلكتروني إلى عنوان نتحكم به:

* العنوان الجديد:/ `wiener@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net`

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

استجابة التطبيق:

> «يرجى النقر على الرابط في بريدك الإلكتروني لتأكيد تغيير البريد الإلكتروني إلى …»

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

يصل بريد إلكتروني يتضمن رابط تأكيد، على سبيل المثال:/ `/confirm-email?user=wiener&token=ob0dI7AMlwX2Y2uw`

بمجرد النقر على الرابط:

> «تم تحديث بريدك الإلكتروني بنجاح»

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

في الخلفية، يبدو الطلب كالتالي:

```bash
email=wiener%40exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk
```

### اختبار أساسي بدون سباق

نرسل عدة طلبات لتغيير البريد الإلكتروني، باستخدام عناوين مختلفة (test1، test2،... test20)، كلٌّ منها على حدة، وتتوافق التأكيدات المستلمة جيدًا مع العناوين المطلوبة.

<figure><img src="/files/890835948718a58d7fc06ebc4a527babe906aa04" alt=""><figcaption></figcaption></figure>

```bash

email=test1@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test2@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test3@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test4@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test5@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test6@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test7@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk

email=test8@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk
.....

email=test20@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk
```

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

ولكن عندما تنفّذ هذه الطلبات نفسها **بالتوازي**، يظهر سلوك غير متوقع: أحيانًا تتلقى تأكيدات لا تطابق المستلم الصحيح.

<figure><img src="/files/d676130a8f66c51c01b0cca7df25581fb3b12d54" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="/files/471acd9bae99405dae8a958284fcf085fbea5af6" alt=""><figcaption></figcaption></figure>

### تحليل حالة السباق

تشير السلوكيات الملحوظة إلى معالجة على مرحلتين\*\*:

1. مرحلة تقوم بـ **تجهّز/تكتب** بريد التأكيد الإلكتروني
2. مرحلة تقوم بـ **تحدد أي عنوان** إرسال البريد الإلكتروني

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

المبدأ: أرسل بالتوازي مزيجًا من الطلبات يحتوي على:

جزء يحتوي على:

```bash
email=carlos@ginandjuice.shop&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk
```

الجزء الآخر بعنوان نتحكم به:

```bash
email=test@exploit-0a10009b04efd21981a1bafc0102005d.exploit-server.net&csrf=UoUvroZsYvL6IJPN7GKumJSoEuLFdBYk
```

النتيجة: نتلقى بريدًا إلكترونيًا يقول:

> «لتأكيد تغيير بريدك الإلكتروني إلى **<carlos@ginandjuice.shop>**، انقر على الرابط أدناه»

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

وهكذا نحصل على **رابط التأكيد** لعنوان كارلوس ويمكننا إتمام تغيير البريد الإلكتروني إلى **<carlos@ginandjuice.shop>**.

<figure><img src="/files/e464436e171865dcb0a15c1f363c315ca51be898" 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/race-conditions/single-endpoint-race-condition.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.
