In many ransomware attacks on organizations, Active Directory is the key: anyone with domain admin rights can push ransomware across the network via Group Policy or domain controllers. After an attack, privileged accounts, service accounts and the krbtgt account must be treated as compromised. Depending on the situation, a targeted cleanup is enough or a full AD forest recovery from a clean backup is required.
Key takeaways
- Disable all privileged accounts except a few needed for recovery, and secure at least one clean domain controller per domain.
- Close the attackers' access first and only then reset the krbtgt account twice, otherwise they will simply read the new key again.
- Besides krbtgt, reset all admin accounts, gMSAs and trust passwords, and if compromise is suspected, the passwords of all users.
- If the integrity of the domain controllers can no longer be demonstrated, restore the forest from a trusted backup, isolated from the production network.
- Separate privilege levels according to the enterprise access model so that no higher level can be controlled from a lower one.
Active Directory: target and distribution hub
Modern ransomware attacks are not automated infections but human-operated intrusions. Microsoft Incident Response states the attackers' goal plainly: obtain credentials with administrative control over highly available servers, then deploy the ransomware.
CISA puts it similarly: malicious actors often use domain controllers as a staging point to spread ransomware network-wide.
For recovery this means: as long as it is unclear whether and how deeply AD was compromised, any restart is risky. Microsoft refers to the "control plane", which is typically AD DS – if it is compromised, a dedicated compromise recovery process is needed to remove the attackers' control.
How attackers use AD to spread ransomware
Group Policy (GPO)
MITRE ATT&CK tracks Group Policy Object modification as its own technique (T1484.001). Modified GPOs can be used to create scheduled tasks, disable security tools, transfer tools, create accounts, execute services and more.
For defenders this means: a new or modified GPO shortly before encryption is a key indicator – and a malicious GPO that is overlooked can cause damage again after an apparent cleanup.
Privileged and service accounts
Domain admins, enterprise admins and service accounts with broad rights are the real prize. According to Microsoft, Defender for Identity alerts on activity such as DCSync and pass-the-hash attacks – typical techniques for obtaining exactly those credentials.
From AD to virtualization
AD rights often reach beyond Windows. In 2024 Microsoft described how domain-joined ESXi hosts treated members of an AD group named "ESX Admins" as administrators by default; attackers created that group and then encrypted the hypervisors.
Detection: warning signs in the directory
Many attacks show up in AD before encryption starts. At the start of every investigation, Microsoft Incident Response asks questions such as: which accounts were used at the time of the incident, which new accounts have been created since then, and is there any indication that the actor is still accessing systems?
Typical warning signs admins should watch for:
| Signal | Possible meaning |
|---|---|
| New or modified Group Policy with scripts or scheduled tasks | Preparing distribution (T1484.001) |
| New members in Domain Admins, Enterprise Admins or other privileged groups | Privilege escalation |
| Newly created groups with telling names such as "ESX Admins" | Takeover of connected systems |
| DCSync or pass-the-hash alerts | Credential theft |
| Privileged accounts signing in on workstations or unusual servers | Abuse or poor admin hygiene |
| Security services disabled or logs cleared on many systems at once | Imminent encryption |
Signs outside AD are covered on the detect ransomware page.
Containment: first steps in the directory
Containment can only happen once you know what needs to be contained.
- Assess scope: Which user accounts, devices and applications are affected?
[3] - Disable privileged accounts: Microsoft recommends disabling all privileged accounts except a small number used to restore AD integrity. Disable suspected compromised accounts immediately.
[3] - Isolate compromised systems, don't power them off: Microsoft recommends disconnecting affected systems from the network without shutting them down.
[3] This also preserves volatile evidence in memory. - Secure clean domain controllers: Disconnect or shut down at least one, ideally two, known good domain controllers per domain. If all DCs are virtual, back up the virtualization platform's system and data drives to offline external media.
[3] - Restrict domain admin sign-in: Use Group Policy to prevent Domain Admins from signing in anywhere except domain controllers and dedicated privileged admin workstations.
[3] - Protect external access: Every externally facing application, including VPN, should require MFA.
[3] - Communicate out of band: Do not coordinate over email or chat systems that may be compromised.
[1]
Credential reset: krbtgt, admins, service accounts
After an attack with domain admin rights, assume the attackers have harvested password hashes and keys. A simple password change for a handful of accounts is not enough.
Why krbtgt matters so much
The krbtgt account signs the domain's Kerberos tickets. Anyone who knows its key can issue their own tickets. According to Microsoft, the account's password history holds the two most recent passwords. Only a double reset removes the old password entirely, so no other DC can replicate using the old password.
Double reset: wait or rapid succession?
Two Microsoft sources differ here, and admins should know both:
| Situation | Approach per Microsoft | Trade-off |
|---|---|---|
| Planned recovery (forest recovery) | Reset twice and wait 10 hours between resets – the default maximum lifetime for user and service tickets. If the ticket lifetime has been changed, the wait must exceed the configured value. | Minimizes authentication issues but leaves forged tickets usable for longer |
| Acute containment during an active attack | Reset twice in rapid succession, ideally with a scripted, repeatable process; the krbtgt lifetime can be reduced before the first reset. All domain controllers you plan to keep must be online. | Invalidates forged tickets faster but can cause sign-in disruption |
Read-only domain controllers (RODCs) have their own krbtgt accounts in the format krbtgt_number. Microsoft notes that these should not be deleted if RODCs are to be recovered as part of the forest recovery.
Which other accounts need resetting
If the failure was caused by an attack, Microsoft's recovery guidance lists, among others:
- all administrative accounts, including members of Enterprise Admins, Domain Admins, Schema Admins, Server Operators and Account Operators,
- the krbtgt account with a complete (double) reset,
- the computer account of the restored domain controller (twice),
- trust passwords when the recovery responds to a security breach,
- group managed service accounts (gMSA), since attackers may have obtained details of their password generation,
- if user accounts may be compromised: a password reset for all users in the domain.
If the AD database of a writable DC is compromised, Microsoft additionally recommends creating a new KDS root key and recreating gMSAs depending on the scenario.
AD forest recovery: when cleanup is not enough
If the integrity of the domain controllers can no longer be demonstrated, recovering the entire forest is the safer route. Microsoft describes it as restoring at least one domain controller in every domain from backup, which returns each domain to its state at the time of the last trusted backup.
What you lose
All objects added after the last trusted backup, all later updates to existing objects, and changes to the configuration and schema partitions.
Choosing the right backup
Microsoft recommends restoring DCs from backups taken a few days before the failure. There is a trade-off: a more recent backup recovers more data but increases the risk of reintroducing dangerous data into the restored forest.
Recover in isolation
The preferred approach is to shut down all writable domain controllers before the first restored DC goes back into production, so no dangerous data replicates back.
Preparation decides
For a forest recovery you need the password of a domain admin account for each domain and the DSRM password.
Which route fits your situation?
Tiering: making AD more resilient for the long term
After the incident, the goal is to prevent a repeat. The core is separating privilege levels. Microsoft has evolved the classic AD tier model into the enterprise access model:
| Plane (new) | Formerly | Scope |
|---|---|---|
| Control plane | Tier 0 | Central identity systems such as AD and services that control them |
| Management plane | Part of Tier 1 | Enterprise-wide IT management, monitoring, security |
| Data/workload plane | Part of Tier 1 | Applications and application servers |
| User access / app access | Tier 2 | Access by users, partners and applications |
The hierarchy is what counts: a lower plane must not be able to control a higher one.
Further post-incident measures recommended by Microsoft Incident Response:
- passwordless authentication or MFA, starting with the highest-impact administrators,
- LAPS for unique local administrator passwords on workstations and servers,
- protecting critical systems and backups against deletion or encryption by attackers, with regular testing,
- rapid detection of common attacks on endpoints, email and identity.
CISA also recommends restricting access to domain controllers to the Administrators group.
Whether tiering and hardening work can be verified with an Active Directory penetration test that specifically looks for paths from a normal user account to domain admin rights.
Conclusion
Active Directory determines the scale of a ransomware attack and the path back. Attackers use it as both target and distribution hub, for example via Group Policy. Rebuilding systems after an incident without cleaning up AD risks the attackers returning with stolen keys.
Sequence matters: contain and close access first, then reset passwords and krbtgt, and if integrity can no longer be demonstrated, restore the forest from a clean backup in isolation. This work requires experience with forensics and AD recovery – it should not be improvised under time pressure. The overall process is described in The ransomware incident response process.
Frequently asked questions
Why is Active Directory so central to ransomware attacks?
Active Directory controls who can sign in where and which policies apply to machines. Anyone who obtains domain admin rights can push software to practically every domain-joined system, disable security features and reach backups. CISA describes domain controllers as a common staging point for spreading ransomware network-wide.
Do I need to reset the krbtgt password after a ransomware attack?
If the attackers had domain admin rights, yes. Otherwise the krbtgt key can still be used to forge valid Kerberos tickets. Microsoft recommends resetting the password twice because the account keeps its two most recent passwords. Timing and method should be agreed with the incident response team.
How long should I wait between the two krbtgt resets?
Microsoft's forest recovery guidance specifies at least 10 hours, matching the default maximum ticket lifetime. For acute containment, however, Microsoft Incident Response describes two resets in rapid succession, ideally using a script that minimizes authentication issues. The right approach depends on whether attackers are still active and how much disruption operations can tolerate.
When is a full AD forest recovery necessary?
When the integrity of the domain controllers can no longer be assured, for example because attackers made extensive changes, planted backdoors or encrypted the domain controllers themselves. At least one domain controller per domain is then restored from a trusted backup in an isolated environment. Changes made after the backup are lost.
Should I shut down all domain controllers immediately?
Not as a blanket rule. Microsoft Incident Response recommends isolating compromised systems without turning them off, and disconnecting or shutting down at least one, ideally two, known good domain controllers per domain to prevent ransomware from spreading to these critical systems. This also preserves a trustworthy state for recovery.
Is it enough to change the domain admin passwords?
Usually not. For recovery after an attack, Microsoft lists all administrative accounts, including Enterprise Admins, Domain Admins, Schema Admins, Server Operators and Account Operators, plus krbtgt, domain controller computer accounts, trust passwords and, where relevant, group managed service accounts. If user accounts may be compromised, plan a password reset for all users.
How does a tiering model help against ransomware?
A tiering or plane model prevents highly privileged accounts from being used on less protected systems, where attackers could harvest their credentials. A compromised user account then only has access to its own plane. Microsoft has evolved the legacy AD tier model into the enterprise access model with a control plane, management plane and data/workload plane.
Related ransomware profiles
- Lockbit 3.0
.lockbit - Qilin (Agenda)
- Akira
.akira - BlackBasta
.basta
Read next
Sources and further reading
- [1]CISA – #StopRansomware Guide cisa.gov
- [2]MITRE ATT&CK – T1484.001: Domain or Tenant Policy Modification: Group Policy Modification attack.mitre.org
- [3]Microsoft Learn – Microsoft Incident Response ransomware approach and best practices learn.microsoft.com
- [4]Microsoft Learn – AD Forest Recovery: Reset the krbtgt password learn.microsoft.com
- [5]Microsoft Learn – Active Directory Forest Recovery: Perform initial recovery learn.microsoft.com
- [6]Microsoft Learn – Active Directory Forest Recovery: Determine how to recover the forest learn.microsoft.com
- [7]Microsoft Learn – Securing privileged access: Enterprise access model learn.microsoft.com
- [8]Microsoft Security Blog – Ransomware operators exploit ESXi hypervisor vulnerability for mass encryption microsoft.com