> 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/credentials/lsass-and-sam-dump-on-windows.md).

# Windows 上的 LSASS 和 SAM 提取

### 在实验室中执行

在实验室中，我们打开多个 PowerShell 会话：

* 两个使用本地管理员的会话；
* 一个使用域管理员的会话。

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

然后，我们从本地管理员的 PowerShell 中启动该工具：

```bash
./mimikats.exe
```

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

### 显示会话信息

在该工具中：

```powershell
sekurlsa::logonpasswords
```

此命令会显示内存中存在的身份验证会话相关信息。

根据上下文，我们可以看到如下信息：

* 连接的用户；
* 域；
* 身份验证类型；
* 哈希；
* 与 Kerberos 相关的票据或项目；
* 交互式或网络会话。

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

### 破解 NTLM 哈希

如果从实验室中获取到 NTLM 哈希，可以使用 John 进行测试：

```bash
john --format=NT admin.hash
```

这有助于说明弱密码或重复使用密码的风险。

<figure><img src="/files/7e18b531709686b3879c081551e04719ed88f4bb" 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/credentials/lsass-and-sam-dump-on-windows.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.
