> 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/logical-flaw-allowing-you-to-generate-infinite-money.md).

# ثغرة منطقية تسمح لك بتوليد أموال لا نهائية

### ثغرة منطقية في المال اللامتناهي

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

تحتوي هذه المختبر على خلل منطقي في عملية الشراء. من خلال استغلال تفاعل سيئ بين \*\* بطاقات الهدايا\*\* و\*\* القسائم الترويجية\*\* و **تأكيد الطلب**، يمكن توليد رصيد بلا حدود، ثم شراء السترة الجلدية Lightweight l33t.

المعرّف المزوَّد:

* **المستخدم**: wiener
* **كلمة المرور**: peter

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

### مبدأ الخلل

بعد التسجيل في النشرة البريدية، يتم منح قسيمة ترويجية:

* **قسيمة** : `SIGNUP30`

<figure><img src="/files/1e18c28af253c05659633ffeafe4e80b56788998" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/14b519990a80de96866c15c63b8103ca35178dc6" alt=""><figcaption></figcaption></figure>

في المتجر، يمكن شراء \*\* بطاقات الهدايا\*\*.

المشكلة هي أنه يمكن تطبيق القسيمة عند شراء هذه البطاقات.

<figure><img src="/files/9e43668a6ca7eaab554f6b6b4946cecfb052f6e4" alt=""><figcaption></figcaption></figure>

#### مثال أولي على الاستغلال

* شراء بطاقة هدايا بقيمة **$10**
* تطبيق القسيمة `SIGNUP30`
* السعر النهائي المدفوع: **$7**

<figure><img src="/files/0bfb1734c41f38f619f381e096529ccf441d2564" alt=""><figcaption></figcaption></figure>

* استلام **رمز بطاقة الهدايا** (مثال: `DbWseYFi2v`)

<figure><img src="/files/780166a363382a984aad90c1ac1b1569f261800d" alt=""><figcaption></figcaption></figure>

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

عند استخدام هذا الرمز في قسم بطاقات الهدايا، يزداد رصيد الحساب بمقدار **10$** بينما لم يُنفق سوى **7$** تم إنفاقه.

إذًا الربح الصافي هو **$3**، مما يزيد الرصيد الإجمالي إلى **$103**.

<figure><img src="/files/1b22d929c099e6c6a55a497359d38ff8b858ae7c" alt=""><figcaption></figcaption></figure>

### المشكلات المنطقية المحددة

1. يمكن استخدام القسيمة **عدة مرات** لشراء بطاقات الهدايا.
2. رصيد بطاقات الهدايا **يُطبَّق بالكامل**، بغض النظر عن السعر المدفوع فعليًا.
3. تأكيد الطلب عبر نقطة النهاية:

   ```bash
   /cart/order-confirmation?order-confirmed=true
   ```

يسمح بالاسترجاع الديناميكي لرمز بطاقة الهدايا.

لا يوجد أي قيد يمنع أتمتة هذه العملية.

<figure><img src="/files/18abe9847bf9ecb5b4e94e3eb2b7d8a6499e4962" alt=""><figcaption></figcaption></figure>

### أتمتة الهجوم (ماكرو)

لاستغلال الخلل على نطاق واسع، يتم إنشاء **ماكرو Burp Suite** يتم تنفيذه.

<figure><img src="/files/1a266f21db14a97d95609fb523dbdac6b4d1a329" alt=""><figcaption></figcaption></figure>

#### الطلبات المعترَضة في الماكرو

1. إضافة منتج **بطاقة هدايا** إلى سلة التسوق
2. تطبيق قسيمة النشرة البريدية (`SIGNUP30`)
3. التحقق من صحة الطلب (`إتمام الطلب`)
4. استرجاع استجابة تأكيد الطلب
5. تسجيل بطاقة الهدايا في حساب المستخدم

<figure><img src="/files/153f0b38068a26b796e97a092e73b2f18bf2bad4" alt=""><figcaption></figcaption></figure>

#### النقاط الرئيسية في الماكرو

* الـ **رمز بطاقة الهدايا** يتم استخراجه ديناميكيًا من `سلة التسوق/تأكيد الطلب` الاستجابة.

<figure><img src="/files/5076a8615cc847e213c94bff5be112ed203ce4fe" alt=""><figcaption></figcaption></figure>

* ثم يُعاد حقن هذا الرمز عبر طلب POST إلى نقطة نهاية إدارة بطاقات الهدايا.
* مخصص **المعلمة** يتم ضبطه في استعلام GET لتخزين قيمة الرمز.

<figure><img src="/files/11bbfee7f3ae52d550bd48dc04bc1f0daf4277ed" alt=""><figcaption></figcaption></figure>

تستعيد القسيمة المطبقة قيمتها من استعلام سابق، مما يسمح بإعادة استخدامها تلقائيًا.

<figure><img src="/files/336072dc8cc9f4e4105486b324d07c1907b4c1ae" alt=""><figcaption></figcaption></figure>

### التنفيذ الجماعي

بمجرد إعداد الماكرو:

جميع الطلبات الخاصة بـ **نطاق عنوان URL** تُشغِّل الماكرو تلقائيًا.

* ملف **Intruder** يُرسل الاستعلام إلى جذر الموقع.
* الإعدادات:
* **500 طلب**
* **الحمولة null**

<figure><img src="/files/49f16a5fd77611789d1d915bbb0b31e0bc30027e" alt=""><figcaption></figcaption></figure>

**مجمع الموارد** محدود بـ **طلب متزامن واحد**

<figure><img src="/files/1c4bd880289f0aa7daad07421748b91d600de1f1" alt="" width="364"><figcaption></figcaption></figure>

يتيح هذا النهج ربط عمليات الشراء والتأكيدات وأرصدة بطاقات الهدايا دون انقطاع.

#### النتيجة

يزداد رصيد الحساب إلى ما لا نهاية. / بمجرد تراكم رصيد كافٍ، يصبح شراء الـ **السترة الجلدية Lightweight l33t** ممكناً دون قيود مالية.

<figure><img src="/files/97181df1683e72147123a1ea36a0b110fa66f87a" alt="" width="375"><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/logical-flaw-allowing-you-to-generate-infinite-money.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.
