> 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-management-of-exceptional-entries.md).

# 对异常条目的不一致管理

对异常条目的不一致管理，PortSwigger Web Security Academy 实验笔记，包括利用流程、载荷测试、Burp Suite 验证以及修复上下文。

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

**实验描述**

此实验室展示了注册过程中对用户输入验证不足。这个逻辑缺陷使得可以访问通常只保留给员工的管理功能。/ 目的：访问管理面板并删除用户 **carlos**.

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e4a529e2bc653e3fe5ba0cccc3d7114956f7b102%2F%7BF003D286-BE02-4F2A-A816-581F8D5EEF6F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**初步观察**

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

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d8344705c03e2f692e4bd0c5a87cb3460647bd02%2F%7B063204D9-9DAA-44FD-87D3-B28E73186EE9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-829269752bb8c018da9d2f097e055255937c3a54%2F%7B73C4204C-B05E-4969-9F0E-374462F4F4DE%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

{% code overflow="wrap" %}

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

{% endcode %}

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6458d90e182103302637ff5b65065df70258bb69%2F%7BDE810C79-066D-481B-A041-FDD7561AE051%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**故障运作方式**

目标是强制发生截断，使注册的电子邮件最终精确以 `dontwannacry.com` 置信区域。

长度验证：

{% code overflow="wrap" %}

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

{% endcode %}

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ba30042f34b216d452854ad38593a28b71fc2bee%2F%7B74ECAC2C-F3D0-4129-A380-21927E7EFF8B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

{% code overflow="wrap" %}

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

{% endcode %}

操作服务器能够正常接收该邮件，因为它接受所有子域。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ace3340e0a7a6742be84850375e76f11e62f9a95%2F%7B5754FFC3-BB9A-493B-93FC-4DCE114D9A0F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

该应用程序在截断后会将该地址解释为属于 `dontwannacry.com` 域中存在的应用创建一个清单。

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9f8f0b0cd19e23b39fd8836377ce8dd0f6208deb%2F%7B93850A5C-CF01-4546-B764-B99452FC0F3B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7970720e563c151a759f90b50cd4deac274c5ebd%2F%7BC6B8D516-BD7F-4F2B-9990-8657AE424C98%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/web/business-logic/inconsistent-management-of-exceptional-entries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
