Group Policy Objects (GPO) as Lateral Movement and Persistence Vectors
Concept
Section titled “Concept”A Group Policy Object (GPO) is a collection of configuration settings processed and applied automatically by the client-side Group Policy engine across domain-joined machines and users.
A GPO comprises two synchronized components:
- The Group Policy Container (GPC): An Active Directory object housed under
CN=Policies,CN=System,DC=domain,DC=local, containing version numbers, status flags, and extension GUIDs. - The Group Policy Template (GPT): A physical file directory hierarchy stored in the replicated share
\\domain\SYSVOL\domain\Policies\{GUID}, holding scripts, Group Policy Preference (GPP) XML files, and registry policies.
Why It Matters in DFIR
Section titled “Why It Matters in DFIR”GPO weaponization is a staple of human-operated ransomware operations in late-stage deployment:
- Asynchronous, Passive Execution: Unlike real-time network lateral movement (SMB/WMI/PsExec) that generates immediate network anomalies, GPO delivery is passive. The attacker modifies an XML file in
SYSVOL; client endpoints independently fetch, parse, and execute the payload during regular background refreshes. - Weak GPO Access Control Lists (ACLs): Attackers do not necessarily need
Domain Adminsprivileges to compromise a GPO. Delegated technicians or groups holdingGenericAll,WriteProperty, orWriteDaclover an existing policy can weaponize it. - Resilient Persistence: Scheduled tasks or services deployed via GPOs automatically re-install if a local responder attempts to remove them, until the policy itself is eradicated from
SYSVOL.
How It Works
Section titled “How It Works”GPO Weaponization Workflow
Section titled “GPO Weaponization Workflow”Attacker (Modifies SYSVOL / GPC) │ │ 1. Writes to \\domain\SYSVOL\Policies\{GUID}\... │ - Scheduled Tasks (Immediate Tasks) │ - Startup / Logon Scripts │ - Service Installation ▼[ Replicated SYSVOL Share on DC ] │ │ 2. DFSR Replication to all DCs ▼Client Workstations (Automatic background refresh every 90 mins) │ ├───────────────────────────────► 3. Pull updated policy XML │ from SYSVOL ▼Local Execution as "NT AUTHORITY\SYSTEM"(Disable Defender, Deploy Ransomware, Add Local Administrators)- Immediate Tasks: Through Group Policy Preferences (GPP), attackers configure an
Immediate Taskexecuted immediately underSYSTEMupon client policy evaluation. - Startup Scripts: Executed automatically during machine boot under the local machine
SYSTEMsecurity context. - Restricted Groups / Local Users and Groups: Enables an attacker to instruct all machines across the fleet to nest a compromised domain user into their local
Administratorssecurity group.
What Is Possible
Section titled “What Is Possible”- Disabling Endpoint Protection Fleet-Wide: Enforcing registry keys such as
DisableAntiSpywareandDisableRealtimeMonitoringvia a rogue policy. - Mass Payload Distribution Without Direct Inbound Connections: Endpoints independently pull executables directly from the DC’s
SYSVOLshare. - Automated GPO Misconfiguration Auditing with BloodHound: BloodHound maps attack edges like
CanGPO,WriteGpoOwner, andGenericAllleading to critical GPOs.
What Is Not Possible
Section titled “What Is Not Possible”- Applying Policies to Disconnected Endpoints: If an endpoint cannot communicate over SMB port 445 with a domain controller, it continues to run cached policies without executing the new GPO payload.
- Deploying Updates Without Incrementing Version Counters: For client machines to process modified GPO templates, the version counter in
GPT.INIand the directoryversionNumberattribute must match and increment. - Bypassing Security and WMI Filters: Policies bound by strict Security Filtering or WMI filters apply strictly to target objects satisfying those queries.
Common DFIR Confusions
Section titled “Common DFIR Confusions”| Frequent Confusion | Verifiable Forensic Reality |
|---|---|
| ”Deleting the scheduled task on the endpoint eradicated the threat.” | Error. If the task is pushed via GPO, the client will recreate it during the next background refresh cycle (maximum 90 minutes). |
| ”Only Enterprise Admins can edit GPOs.” | False. Members of Group Policy Creator Owners and any identity delegated permissions on target OUs can create or alter policies. |
| ”GPO modifications do not generate audit logs.” | File alterations in SYSVOL generate Event 4663 (if object auditing is active), and directory modifications to the GPC produce Event ID 5136 on DCs. |
Concrete Forensic Example
Section titled “Concrete Forensic Example”During an enterprise ransomware outbreak:
- 600 production servers simultaneously launch
locker.exeat 04:00 UTC. - Triage shows zero inbound SMB or WMI connections hitting those servers at that time.
- The DFIR analyst audits the primary DC’s
SYSVOLshare:- Folder
\\corp.local\SYSVOL\corp.local\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}(Default Domain Policy) was modified at 02:15 UTC. GPT.INIversion was incremented.- A new file
ScheduledTasks.xmlwas placed underMachine\Preferences\ScheduledTasks\. - The XML defined an Immediate Task executing a base64-encoded PowerShell script that disabled Windows Defender and invoked
\\corp.local\SYSVOL\corp.local\scripts\locker.exe.
- Folder
- DFIR Assessment: The threat actor weaponized the Default Domain Policy to coordinate automated, simultaneous fleet-wide execution.
Key Forensic Artefacts
Section titled “Key Forensic Artefacts”- Domain Controller Artefacts (SYSVOL & Active Directory):
- SYSVOL Files: XML preference files under
Machine\Preferences\, startup scripts inMachine\Scripts\Startup\,GPT.INI. - Event ID 5136 (Directory Service Object Modified): Changes to
versionNumberorgPCFileSysPathon GPC objects. - Event ID 4663: File system write operations within
SYSVOL.
- SYSVOL Files: XML preference files under
- Target Endpoint Security Logs:
- Event ID 4698 (Scheduled Task Created): Registration of the GPO-driven task.
- Microsoft-Windows-GroupPolicy/Operational (Event IDs 4004, 5312): GPO discovery and client evaluation details.
- Event ID 7045: Service installation if deployed via GPO.
Investigation Methods
Section titled “Investigation Methods”- Audit Modification Timestamps Across SYSVOL:
Recursively traverse
\\domain\SYSVOL\domain\Policiesand sort files byLastWriteTime. - Review GPO Modification Timestamps in Active Directory:
Run
Get-GPO -All | Sort-Object ModificationTime -Descending | Select-Object DisplayName, ModificationTime, Id. - Audit Delegation Permissions on All GPO Objects:
Hunt for weak access controls (
GenericAll,WriteProperty) granted to non-admin security principals.
Investigative Tooling
Section titled “Investigative Tooling”- PowerShell GroupPolicy Module:
Terminal window # List recently modified GPOsGet-GPO -All | Sort-Object ModificationTime -Descending | Select-Object -First 10 DisplayName, Id, ModificationTime - BloodHound:
Cypher queries for GPO compromise paths:
MATCH p=(u)-[:CanGPO]->(g:GPO) RETURN pMATCH p=(u)-[:GenericAll]->(g:GPO) RETURN p
Key Takeaways
Section titled “Key Takeaways”- GPOs deliver asynchronous, fleet-wide code execution under
SYSTEM. - Weaponized GPOs bypass network intrusion sensors because clients independently pull payloads over
SYSVOL. - Auditing
ScheduledTasks.xml,GPT.INI, andLastWriteTimetimestamps inSYSVOLis critical. - Full containment mandates cleaning the GPO in
SYSVOLbefore remediating client endpoints.
References & Further Reading
Section titled “References & Further Reading”- Microsoft Learn: Group Policy Overview
- Card 08 — NTFS Permissions, Share Permissions and ACLs
- Card 24 — Lateral Movement Across Active Directory Domains: Methods, Paths, and Constraints
- Card 28 — Domain Controllers as Lateral Movement Hubs
- Card 30 — Azure AD Connect / Entra ID Connect: The Hybrid Attack Bridge