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

# 对异常输入的不一致处理

### 不一致的异常输入处理

**实验说明**

该实验室显示出在注册过程中对用户输入验证不充分。这个逻辑缺陷允许访问通常仅保留给员工的管理功能。/ 目的：访问管理面板并删除用户 **carlos**.

<figure><img src="/files/21c459e6329c8535e7f672bf1270961def686cbe" alt=""><figcaption></figcaption></figure>

**初步观察**

在注册时，会向所提供的地址发送验证邮件。/ 操作服务器接收与该域及其子域相关的\*\*所有邮件\*\*：

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

<figure><img src="/files/0518168097386fee7ea9f80f8938fdb9da2315b9" alt=""><figcaption></figcaption></figure>

因此，使用该域或其子域创建的任何地址都可被接受。

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

**识别到的异常行为**

通过创建一个在“之前包含大量字符的电子邮件地址 `@` 符号，我们发现该字段 \*\*

{% code overflow="wrap" %}

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

{% endcode %}

此限制导致实际存储的值与显示或用于安全检查的值之间不一致。

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

**故障的运作**

目标是强制截断，使注册的电子邮件最终正好以 `dontwannacry.com` 可信区域。

长度验证：

{% code overflow="wrap" %}

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

{% endcode %}

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

一旦达到255个字符，最终地址将按如下方式构造：

{% code overflow="wrap" %}

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

{% endcode %}

操作服务器很好地接收了该邮件，因为它接受所有子域。

<figure><img src="/files/17fd48612b9f133fd71e75d3ba1d21749060b38b" alt=""><figcaption></figcaption></figure>

应用程序在截断后，将该地址解释为属于 `dontwannacry.com` 该域。

<figure><img src="/files/3f063d358cd06eba441548e27faa3c57a842a726" alt=""><figcaption></figcaption></figure>

该账户被视为内部或可信。/ 一旦连接，即可访问 **管理面板** ，且无需额外控制即可被允许。

<figure><img src="/files/a8758a50169fbdf55e28298f8a528aeaf198d494" 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/zh/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.
