> 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/business-logic/inconsistent-handling-of-exceptional-input.md).

# Manejo inconsistente de entradas excepcionales

### Gestión inconsistente de entradas excepcionales

**Descripción del laboratorio**

Este laboratorio muestra una validación deficiente de las entradas del usuario en el proceso de registro. Esta falla lógica permite el acceso a funciones administrativas normalmente reservadas para los empleados. / Objetivo: acceder al panel de administración y eliminar usuario **carlos**.

<figure><img src="/files/192d4d94bb127549079ab499ed9dc6c99cf062c7" alt=""><figcaption></figcaption></figure>

**Observación inicial**

Al registrarse, se envía un correo de validación a la dirección proporcionada. / El servidor operativo recibe \*\* todos los correos\*\* asociados con el dominio y sus subdominios:

```bash
@exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

<figure><img src="/files/8d54102dc095358d768e4a4c28585c209be935af" alt=""><figcaption></figcaption></figure>

Así, cualquier dirección creada con este dominio o sus subdominios es admisible.

<figure><img src="/files/6cabe79355b5cd3f4f5b0bf90eff04c3d1c1807c" alt=""><figcaption></figcaption></figure>

**Comportamiento anómalo identificado**

Al crear una dirección de correo electrónico que contiene una cantidad muy grande de caracteres antes de la `@` símbolo, observamos que el campo \*\*

{% code overflow="wrap" %}

```bash
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

{% endcode %}

Este límite provoca una inconsistencia entre el valor realmente almacenado y el que se muestra o se utiliza para las comprobaciones de seguridad.

<figure><img src="/files/78b29da7fc4b3e84488155a8a25fbb9133b32c71" alt=""><figcaption></figcaption></figure>

**Funcionamiento del fallo**

El objetivo es forzar la truncación para que el correo registrado termine exactamente con la `dontwannacry.com` área de confianza.

Verificación de longitud:

{% code overflow="wrap" %}

```bash
eecho -n "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@dontwannacry.com" | wc -c
```

{% endcode %}

<figure><img src="/files/84d85e553d42f08e4378a3f419bb9ce966cd45ab" alt=""><figcaption></figcaption></figure>

Una vez alcanzados los 255 caracteres, la dirección final se construye de esta manera:

{% code overflow="wrap" %}

```bash
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@dontwannacry.com.exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

{% endcode %}

El servidor operativo recibe bien el correo, ya que acepta todos los subdominios.

<figure><img src="/files/8076652d5db346ec442c502fe5f6d57fde58f87a" alt=""><figcaption></figcaption></figure>

La aplicación, después de la truncación, interpreta la dirección como perteneciente al `dontwannacry.com` dominio.

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

La cuenta se considera interna o confiable. / Una vez conectado, se permite el acceso al **Panel de administración** sin control adicional.

<figure><img src="/files/4309cfef027e3dd9fa593f761f3beffa53242ae1" 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/business-logic/inconsistent-handling-of-exceptional-input.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.
