Skip to main content

Overview

SeRestorePrivilege grants write to any file/folder, bypassing NTFS ACLs (it also grants implicit WRITE_DAC/WRITE_OWNER). Effectively arbitrary write as SYSTEM: overwrite protected binaries, plant DLLs in System32, modify scheduled tasks. Default on Administrators (elevated), Backup Operators, SYSTEM, and Server Operators on a DC.

Check if Enabled

Shows Disabled? Still usable — enable it in the token at runtime (AdjustTokenPrivileges, see PowerShell method).

Replace Accessibility Binary — SYSTEM Shell at Login

Accessibility binaries launch as SYSTEM from the lock/login screen. Replace with cmd.exe.
Trigger: lock screen (Win+L) → click Ease of Access → SYSTEM shell. Works pre-auth over RDP (xfreerdp3 /v:TARGET /cert:ignore). Same technique for every accessibility binary: Cleanup: restore the .bak.
Defender/AMSI may flag overwriting these. Check first: sc query WinDefend. On 10 1809+, WRP may block copy — use the PowerShell backup-semantics method below.

Overwrite Service Binary


DLL Hijack — System32 / PATH

Write a malicious DLL where a SYSTEM service expects one. Find missing DLLs with Procmon (Result = NAME NOT FOUND, ends .dll).

Scheduled Task Hijack

Task XML lives in C:\Windows\System32\Tasks. Overwrite a SYSTEM task’s command.

Modify hosts File

C:\Windows\System32\drivers\etc\hosts is normally protected. Redirect internal hostnames to a Responder host to capture Net-NTLMv2.

Write SSH authorized_keys

If OpenSSH Server is installed (sc query sshd), plant your key for passwordless access.

PowerShell Method (Backup Semantics)

When copy fails due to WRP, enable the privilege at runtime and write via .NET with FILE_FLAG_BACKUP_SEMANTICS (0x02000000). Enable the privilege with the standard AdjustTokenPrivileges P/Invoke (see the snippet on SeCreateTokenPrivilege), then:

Combine with SeBackupPrivilege

Backup Operators hold both → arbitrary read AND write. Dump SAM/NTDS.dit (read) then plant a backdoor (write). Read side documented in SeBackupPrivilege.

Quick Reference