DSRM and Skeleton Key
Two techniques for maintaining backdoor access to domain controllers without relying on domain accounts. DSRM survives complete domain credential resets; Skeleton Key provides a universal password for all domain accounts until the DC reboots. Use both for layered persistence after domain takeover.
DSRM: Directory Services Restore Mode backdoor
Every DC has a local DSRM Administrator account separate from domain accounts. It is set during DC promotion and almost never changed. By resetting the DSRM password to one you control and enabling network logon, you get a local admin account on the DC that survives full domain credential resets — even if every domain account is wiped.
By default, DSRM logon is only available in recovery mode. Setting DsrmAdminLogonBehavior = 2 in the registry makes it available over the network at all times.
SAMKey : ... RID : 000001f4 (500) User : Administrator Hash NTLM: 8c6976e5b5410415bde908bd4dee15df
Administrator:500:aad3b435b51404eeaad3b435b51404ee:8c6976e5b5410415bde908bd4dee15df:::
Store the DSRM NT hash. After domain-wide credential reset, all domain accounts lose their hashes — the DSRM account is unaffected because it is local to the DC, not stored in NTDS.dit.
SMB 10.10.10.10 445 DC01 [+] DC01\Administrator:$DSRM_NTHASH (Pwn3d!)
Skeleton Key
Skeleton Key patches the LSASS process on the DC to accept a universal password for every domain account. The real password continues to work — a second master password is added alongside it. Any user can now authenticate with either their real password or the skeleton password.
Non-persistent: the patch lives in LSASS memory and resets on DC reboot. For multi-DC environments, patch each DC separately. Most EDR and AV solutions detect the LSASS patch.
[KDC] data [KDC] struct [KDC] keys patch OK [RC4] functions [RC4] init patch OK [RC4] decrypt patch OK
SMB 10.10.10.10 445 DC01 [+] corp.local\administrator:mimikatz (Pwn3d!)
Skeleton Key is the more detectable option but useful for short operations where you need to move fast across many systems without managing individual hashes. DSRM is the durable persistence — use it as the long-term fallback after Skeleton Key resets on reboot.
Remove DSRM persistence when done: set DsrmAdminLogonBehavior back to 0 and reset the DSRM password to something unknown.
References
-
Mimikatz (GitHub)github.com/gentilkiwi/mimikatz (opens in new tab)
misc::skeleton for Skeleton Key injection, lsadump::sam for DSRM hash extraction
-
Impacket (GitHub)github.com/fortra/impacket (opens in new tab)
secretsdump -sam for remote DSRM hash extraction
-
DSRM Persistence — ired.teamwww.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/t1207-dsrm-credentials-for-persistence (opens in new tab)
DsrmAdminLogonBehavior registry key and attack chain
Was this helpful?
Your feedback helps improve this page.