Rebuilding a Compromised Active Directory Domain Controller

A compromised Windows Active Directory domain controller must be treated as an identity-system breach, not simply a damaged server. Attackers may steal the KRBTGT secret, abuse DCSync, alter Group Policy, implant remote-access tools or abuse certificate services. Rebuilding the host removes malware and untrusted configuration, but it does not invalidate credentials already stolen or restore trust in every domain controller.

The recovery should produce a supported, hardened host that can rejoin the domain through a controlled path while privileged identities, replication and dependent services are checked. For Australian teams, that scope often includes hybrid Microsoft Entra ID and Microsoft 365 estates in Sydney and Melbourne, line-of-business applications, and operations supported by local managed service providers.

Establish the true scope of the compromise

Begin with an incident-led assessment rather than a server-led rebuild. Record the first known compromise time, affected accounts, network paths and any suspected persistence. Collect relevant EDR telemetry, Windows event logs, network records, domain-controller logs and Active Directory replication metadata. If the system is still running, capture volatile evidence and create a forensic image before altering it. If active harm is escalating, network isolation takes priority over perfect evidence collection.

Expand the scope beyond the affected machine. Check other writable domain controllers, read-only domain controllers, administrative workstations, privileged access hosts, AD CS servers, Entra Connect appliances, backup systems and management agents for the same tools or misuse. Review DCSync rights, delegation, group nesting, service accounts and privileged access paths. A record of attacker actions matters more than a list of modified files because replication can carry harmful changes across the domain.

Then decide whether the incident is host-level or domain-wide. Stolen domain administrator rights or the KRBTGT password usually mean every domain controller and many administrative systems must be treated as compromised. In that case, replacing one host is only a containment step; credential rotation, removal of attacker-created objects and often a wider clean rebuild are required before the domain can regain a defensible baseline.

Contain the attacker while preserving useful evidence

Containment should occur from a known-clean administrative environment. Isolate the server from production networks, block confirmed command-and-control traffic, stop affected replication paths and prevent unmanaged reconnection. Reset access through a trusted emergency account, revoke exposed sessions where supported, and rotate privileged credentials after the attacker’s access is removed. Resetting one service account without checking dependencies can break critical applications, so every rotation needs an owner and rollback path.

Preserve what the rebuild will not capture: memory artefacts, EDR timelines, DNS logs, firewall records, registry data and copies of SYSVOL content. Keep forensic copies offline, hash them and document chain of custody. Do not copy the old server’s configuration wholesale into the replacement. Each restored Group Policy object, scheduled task and logon script should be inspected against an authoritative baseline.

For Australian organisations, incident handling also intersects with the Privacy Act 1988 and the Office of the Australian Information Commissioner’s notifiable data breach process. A cyber incident does not automatically create a reportable breach, but the investigation should record whether personal information was accessed and whether notification thresholds are met. Entities may also have sector-specific reporting duties, while organisations subject to the Privacy Act need to consider the Australian Privacy Principles and, where applicable, the Australian Protective Data Security Regulations. The ASD Essential Eight provides a useful national control baseline throughout the response.

Build a trusted recovery path

Create a recovery build that has no inherited trust from the suspect environment. Use supported hardware or virtualisation, a current patched Windows release, a minimal administration model and a fresh local administrator credential. Build it on an isolated network, connect only approved management tools and avoid introducing it to production until validation succeeds. Specialist input can provide independent recovery planning when the team needs to challenge assumptions about backup integrity, sequencing and downtime.

Select the data source according to what can be trusted. A domain-controller system-state backup taken before the intrusion can support restoration, provided its contents, topology and security history have been assessed. If no trustworthy backup exists, a clean-room approach may involve creating a new forest, extracting authoritative objects and directories, and then migrating applications and users. Do not copy NTDS.dit manually or treat SYSVOL as harmless file storage; both database and policy files require validation.

Rebuild dependent identity components deliberately. Recreate sites, subnets, DNS and service locations; transfer Flexible Single Master Operation roles one at a time only after replication is healthy. Deploy Microsoft Entra Connect cleanly, rotate connector certificates and validate the privileged sync account. This broader approach reflects CARM Security’s coordinated view of remediation, where a clean server must be paired with sound identity, endpoint and certificate controls.

Treat Active Directory Certificate Services as a separate incident if it was exposed. Unauthorised certificate templates, weak issuance policies or stolen CA credentials require revocation, reconfiguration and reissuance before that CA is trusted again. The rebuilt domain controller should never be connected to an exposed certificate authority merely to maintain application access.

Restore the domain’s cryptographic trust last. The KRBTGT password is shared across the domain, so a controlled reset affects every domain controller and must be followed by sufficient replication and Kerberos ticket aging before the second reset. If the attacker acted with domain administrator rights, KRBTGT rotation alone is insufficient. Reset privileged identities, machine and service secrets as applicable, remove unauthorised software and review ACLs and delegation before allowing normal administration to resume.

Compare the practical recovery routes

The recovery route determines cost, downtime and assurance. Choose a host rebuild when the surrounding domain remains trustworthy, a domain-wide rebuild when administrative privileges escaped the original server, and clean-room recovery when both the domain and its backups are suspect. A new domain controller can provide temporary service, but adding it to a compromised domain without correcting root causes may distribute risk rather than reduce it.

Use the comparison below to test each option against the earliest known clean time, available backups, application dependencies and required recovery time. In practice, a hybrid route is often strongest: isolate and rebuild trusted components first, then reconstruct identity data from the cleanest available source while old systems remain offline.

Recovery route Best fit Essential prerequisites Principal limitation
Rebuild one host from a known-good installation Compromise is contained and domain data remains trustworthy Fresh patched build, isolated network, trusted administrative path and validated configuration Does not remove domain-wide persistence or stolen secrets
Restore a controller from a pre-intrusion system-state backup A trustworthy backup and compatible topology are available Forensic validation, consistent backup, controlled restore and replication plan A compromised database or SYSVOL can carry hidden persistence into recovery
Clean-room forest rebuild Domain-wide compromise, unusable backups or uncertain integrity New forest, authoritative data extraction, application migration and client redirection Longest disruption and highest complexity because every dependency must be reconnected
Temporary replacement or staged coexistence Business services must return while definitive recovery is designed Secure isolation, short life, full monitoring and explicit shutdown criteria Can prolong exposure and must never be treated as final assurance

Restore services and make the recovery repeatable

Bring the replacement into service gradually. Confirm Kerberos authentication, referrals, DNS resolution, Group Policy, replication, event logging, backup protection and application access from representative locations in Sydney, Melbourne, Brisbane and Perth. Include remote staff and hybrid sign-ins from personal mobile devices, since conditional access and device registration can hide failures that a server-side test will miss. Monitor the rebuilt host closely during the first full business cycle and retain heightened logging until confidence is established.

Before closing the recovery, validate Entra Connect synchronisation, privileged access workstations, administrative tiering, AD CS publication and CRL distribution, EDR coverage and the restoration of business-critical applications. Compare directory, DNS, Group Policy and configuration data with an approved baseline. Record what was rebuilt, what was migrated and what was intentionally retired, then update the incident record and disaster-recovery runbook with the lessons that materially changed the design.

The practical takeaway is to treat recovery as a trust rebuild: the server may be running, but the domain is only restored when authentication, replication, privileged operations and dependent services all return from a clean, documented baseline.