> 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

针对在 Windows 上提取 LSASS 和 SAM 的 Active Directory 安全笔记，涵盖枚举、Kerberos、凭据、ACL 滥用、横向移动、利用流程和验证步骤。

### 实验室中的执行

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

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-0c921cf7ce810d933c7c75a71a17cfe4117e800b%2F%7BF97C5D39-C7C3-4FB7-9D35-91D6C6B0DF0B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

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

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-a2b84e29b9cf64c8a59611a57710b342248f507c%2F%7B5FA0A2F7-2F2D-4D33-88A3-3A77A6B505B3%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

### 显示会话信息

在该工具中：

```powershell
sekurlsa::logonpasswords
```

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

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

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-193b4f9393c6aeaa2c24b573e1a54dd0eebe2973%2Fimage%20(3298).png?alt=media" alt=""><figcaption></figcaption></figure>

### 破解 NTLM 哈希

如果从实验室中获取了 NTLM 哈希，可以用 John 来测试：

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

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

<figure><img src="https://1574813340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e84c1395e4b2179c68336403fca7d1f3f7fb6080%2F%7B5281B1A9-6539-479E-B32F-E7940E736221%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/zh/active-directory/credentials/lsass-and-sam-dump-on-windows.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
