> 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/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.md).

# Обман кэша с помощью разделителей в пути

### Эксплуатация разделителей пути для обмана веб-кэша

#### Контекст

**Лаборатория:** Ограничения пути для обмана веб-кэша / **Цель:** получить \*\* API-ключ\*\* от пользователя **carlos**. / **Предоставленный доступ:** возможная связь с `wiener:peter`. / **Помощь:** список возможных разделителей предоставлен лабораторией.

<figure><img src="/files/93aef96488acf68f8bb3c825c59f231bce4fe6be" alt=""><figcaption></figcaption></figure>

#### Начальное наблюдение

* На **Мой аккаунт** странице мы видим знак, на котором явно отображается наш собственный API-ключ\*\*.
* В фоновом режиме обычный доступ вызывает запрос:

```bash
GET /my-account HTTP/2
```

В этом случае, **ответ не обслуживается из кэша** (нет видимого/интерпретируемого поведения кэша).

<figure><img src="/files/33f811b34d3455e4b9fbcb114423995b93dba708" alt=""><figcaption></figcaption></figure>

#### Тест разделителей

* Добавив \*\*точку с запятой\*\* `;` в путь, \*\* приложение по-прежнему интерпретирует маршрут\*\* к `my-account`, но на этот раз **с поведением кэша**.

Используя **Intruder**, мы проверяем несколько разделителей и обнаруживаем, что **точка с запятой работает**.

<figure><img src="/files/51c50b76ed2559903d99579ef3ac567ee04d7788" alt=""><figcaption></figcaption></figure>

Пример допустимого пути:

* `/my-account;test.js`

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

#### Эксплуатация

Цель: убедиться, что жертва посещает ловушечный URL, чтобы сделать **/my-account** ответ \*\* закэшированным\*\* а затем перечитать его с другой вариацией, чтобы получить **carlos** данные.

С**Exploit Server**, жертва перенаправляется на:

```javascript
<script>
    document.location="https://0a5e005c048218fb80a3f0ec00c2000d.web-security-academy.net/my-account/my-account;test.js";
</script>
```

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

#### Получение API-ключа

* Затем мы меняем URL и переходим по адресу:
* `/my-account;jordan.js`

Этот ответ затем содержит **API-ключ Карлоса**.

<figure><img src="/files/3f1b845c794f41d4f0c27ac7962c663a3e9c2242" 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/ru/web/web-cache-deception/cheating-the-cache-with-delimiters-in-the-path.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.
