Incident Response

Ransomware and Active Directory: Detect, Contain and Recover Cleanly

Ransomware Reverse Editorial TeamLast technical review: 9 min read

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.[3] In Windows environments that path almost always runs through Active Directory.

CISA puts it similarly: malicious actors often use domain controllers as a staging point to spread ransomware network-wide.[1] That has two consequences. First, AD is a target – whoever controls the domain controls sign-in to almost every system. Second, AD is a distribution hub – Group Policy, logon scripts or management tooling can push malicious code to hundreds of machines at once.

How a ransomware attack unfolds – and where you can stop it1. Initial access: Phishing, stolen credentials, unpatched VPN or firewall appliances, remote access without MFA. Countermeasure: MFA on all remote access, timely patching, monitoring of unusual sign-ins. 2. Persistence: Remote management tools, new accounts, scheduled tasks or web shells keep access open. Countermeasure: Alerts on new admin accounts and unknown remote management software. 3. Privilege escalation: Harvesting passwords and tickets up to taking over domain admin rights. Countermeasure: Act on EDR alerts, separate and protect privileged accounts. 4. Lateral movement: Moving via RDP, SMB and admin tools to servers, hypervisors and backup systems. Countermeasure: Network segmentation, monitoring of internal traffic. 5. Data theft: Copying sensitive data to cloud storage or attacker servers. Countermeasure: Monitoring outbound data volumes, alerts on large uploads. 6. Sabotaging recovery: Deleting shadow copies and snapshots, attacking backups, disabling security tools. Countermeasure: Immutable or offline backups, alerts on deletion and tamper commands. 7. Encryption and extortion: Encrypting servers, clients and VMs, ransom note, threat to publish data. Countermeasure: Isolate, engage incident response, assess recoverability. PhaseWhat attackers typically doYour chance to detect and respondInitial accessPhishing, stolen credentials, unpatchedVPN or firewall appliances, remote accesswithout MFAMFA on all remote access, timely patching,monitoring of unusual sign-insPersistenceRemote management tools, new accounts,scheduled tasks or web shells keep accessopenAlerts on new admin accounts and unknownremote management softwarePrivilege escalationHarvesting passwords and tickets up totaking over domain admin rightsAct on EDR alerts, separate and protectprivileged accountsLateral movementMoving via RDP, SMB and admin tools toservers, hypervisors and backup systemsNetwork segmentation, monitoring ofinternal trafficData theftCopying sensitive data to cloud storage orattacker serversMonitoring outbound data volumes, alertson large uploadsSabotaging recoveryDeleting shadow copies and snapshots,attacking backups, disabling security toolsImmutable or offline backups, alerts ondeletion and tamper commandsEncryption andextortionEncrypting servers, clients and VMs,ransom note, threat to publish dataIsolate, engage incident response, assessrecoverability1234567Preparation – often unnoticed (1–6)Visible at the latest here (7) © 2026 ransomware-reverse.de
How a ransomware attack unfolds – and where you can stop it1. Initial access: Phishing, stolen credentials, unpatched VPN or firewall appliances, remote access without MFA. Countermeasure: MFA on all remote access, timely patching, monitoring of unusual sign-ins. 2. Persistence: Remote management tools, new accounts, scheduled tasks or web shells keep access open. Countermeasure: Alerts on new admin accounts and unknown remote management software. 3. Privilege escalation: Harvesting passwords and tickets up to taking over domain admin rights. Countermeasure: Act on EDR alerts, separate and protect privileged accounts. 4. Lateral movement: Moving via RDP, SMB and admin tools to servers, hypervisors and backup systems. Countermeasure: Network segmentation, monitoring of internal traffic. 5. Data theft: Copying sensitive data to cloud storage or attacker servers. Countermeasure: Monitoring outbound data volumes, alerts on large uploads. 6. Sabotaging recovery: Deleting shadow copies and snapshots, attacking backups, disabling security tools. Countermeasure: Immutable or offline backups, alerts on deletion and tamper commands. 7. Encryption and extortion: Encrypting servers, clients and VMs, ransom note, threat to publish data. Countermeasure: Isolate, engage incident response, assess recoverability. Initial accessPhishing, stolen credentials, unpatched VPN orfirewall appliances, remote access without MFAMFA on all remote access, timely patching,monitoring of unusual sign-insPersistenceRemote management tools, new accounts,scheduled tasks or web shells keep access openAlerts on new admin accounts and unknownremote management softwarePrivilege escalationHarvesting passwords and tickets up to takingover domain admin rightsAct on EDR alerts, separate and protectprivileged accountsLateral movementMoving via RDP, SMB and admin tools to servers,hypervisors and backup systemsNetwork segmentation, monitoring of internaltrafficData theftCopying sensitive data to cloud storage orattacker serversMonitoring outbound data volumes, alerts onlarge uploadsSabotaging recoveryDeleting shadow copies and snapshots, attackingbackups, disabling security toolsImmutable or offline backups, alerts on deletionand tamper commandsEncryption and extortionEncrypting servers, clients and VMs, ransomnote, threat to publish dataIsolate, engage incident response, assessrecoverability1234567AttackerYour chance © 2026 ransomware-reverse.de
How a ransomware attack unfolds – and where you can stop it. Encryption is the last step. The phases before it are where detection really happens.

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.[3]

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.[2] The malware listed in the procedure examples includes LockBit 2.0 and LockBit 3.0 as well as Qilin.[2]

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.[3]

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.[8] More on this in Ransomware on VMware ESXi.

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?[3]

Typical warning signs admins should watch for:

SignalPossible meaning
New or modified Group Policy with scripts or scheduled tasksPreparing distribution (T1484.001)[2]
New members in Domain Admins, Enterprise Admins or other privileged groupsPrivilege escalation
Newly created groups with telling names such as "ESX Admins"Takeover of connected systems[8]
DCSync or pass-the-hash alertsCredential theft[3]
Privileged accounts signing in on workstations or unusual serversAbuse or poor admin hygiene
Security services disabled or logs cleared on many systems at onceImminent 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.[3] The steps below follow recommendations from Microsoft Incident Response and CISA. They belong in the hands of an experienced team, because mistakes in AD can significantly delay recovery.

  • 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.[4]

Double reset: wait or rapid succession?

Two Microsoft sources differ here, and admins should know both:

SituationApproach per MicrosoftTrade-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.[4]Minimizes authentication issues but leaves forged tickets usable for longer
Acute containment during an active attackReset 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.[3]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.[4]

Which other accounts need resetting

If the failure was caused by an attack, Microsoft's recovery guidance lists, among others:[5]

  • 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.[6]

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.[6]

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.[6]

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.[6] With ransomware this matters, because attackers are often in the network long before encryption.

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.[6] The first restored DC runs without a connection to the production network – for virtual machines, for example, through an isolated virtual network adapter.[5] Further DCs follow only after the data has been verified and the password resets are done.[5]

Preparation decides

For a forest recovery you need the password of a domain admin account for each domain and the DSRM password.[6] If that information is missing, or there is no tested backup of the domain controllers kept apart from the production network, recovery becomes much harder. Backup fundamentals are covered in Ransomware backup recovery.

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:[3][7]

Plane (new)FormerlyScope
Control planeTier 0Central identity systems such as AD and services that control them
Management planePart of Tier 1Enterprise-wide IT management, monitoring, security
Data/workload planePart of Tier 1Applications and application servers
User access / app accessTier 2Access by users, partners and applications

The hierarchy is what counts: a lower plane must not be able to control a higher one.[7] Microsoft Incident Response adds that each plane should have its own administrative workstations, with accounts from other planes denied access through user rights assignments. A compromised user account then only has access to its own plane.[3]

Further post-incident measures recommended by Microsoft Incident Response:[3]

  • 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.[1] How AD ties in with cloud identities is covered in Ransomware in Microsoft 365.

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

Read next

Sources and further reading

  1. [1]CISA – #StopRansomware Guide cisa.gov
  2. [2]MITRE ATT&CK – T1484.001: Domain or Tenant Policy Modification: Group Policy Modification attack.mitre.org
  3. [3]Microsoft Learn – Microsoft Incident Response ransomware approach and best practices learn.microsoft.com
  4. [4]Microsoft Learn – AD Forest Recovery: Reset the krbtgt password learn.microsoft.com
  5. [5]Microsoft Learn – Active Directory Forest Recovery: Perform initial recovery learn.microsoft.com
  6. [6]Microsoft Learn – Active Directory Forest Recovery: Determine how to recover the forest learn.microsoft.com
  7. [7]Microsoft Learn – Securing privileged access: Enterprise access model learn.microsoft.com
  8. [8]Microsoft Security Blog – Ransomware operators exploit ESXi hypervisor vulnerability for mass encryption microsoft.com