Skip to content

Group Policy Objects (GPO) as Lateral Movement and Persistence Vectors

Density:

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:

  1. 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.
  2. 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.

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 Admins privileges to compromise a GPO. Delegated technicians or groups holding GenericAll, WriteProperty, or WriteDacl over 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.

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)
  1. Immediate Tasks: Through Group Policy Preferences (GPP), attackers configure an Immediate Task executed immediately under SYSTEM upon client policy evaluation.
  2. Startup Scripts: Executed automatically during machine boot under the local machine SYSTEM security context.
  3. 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 Administrators security group.

  • Disabling Endpoint Protection Fleet-Wide: Enforcing registry keys such as DisableAntiSpyware and DisableRealtimeMonitoring via a rogue policy.
  • Mass Payload Distribution Without Direct Inbound Connections: Endpoints independently pull executables directly from the DCโ€™s SYSVOL share.
  • Automated GPO Misconfiguration Auditing with BloodHound: BloodHound maps attack edges like CanGPO, WriteGpoOwner, and GenericAll leading to critical GPOs.

  • 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.INI and the directory versionNumber attribute 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.

Frequent ConfusionVerifiable 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.

During an enterprise ransomware outbreak:

  1. 600 production servers simultaneously launch locker.exe at 04:00 UTC.
  2. Triage shows zero inbound SMB or WMI connections hitting those servers at that time.
  3. The DFIR analyst audits the primary DCโ€™s SYSVOL share:
    • Folder \\corp.local\SYSVOL\corp.local\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9} (Default Domain Policy) was modified at 02:15 UTC.
    • GPT.INI version was incremented.
    • A new file ScheduledTasks.xml was placed under Machine\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.
  4. DFIR Assessment: The threat actor weaponized the Default Domain Policy to coordinate automated, simultaneous fleet-wide execution.

  1. Domain Controller Artefacts (SYSVOL & Active Directory):
    • SYSVOL Files: XML preference files under Machine\Preferences\, startup scripts in Machine\Scripts\Startup\, GPT.INI.
    • Event ID 5136 (Directory Service Object Modified): Changes to versionNumber or gPCFileSysPath on GPC objects.
    • Event ID 4663: File system write operations within SYSVOL.
  2. 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.

  1. Audit Modification Timestamps Across SYSVOL: Recursively traverse \\domain\SYSVOL\domain\Policies and sort files by LastWriteTime.
  2. Review GPO Modification Timestamps in Active Directory: Run Get-GPO -All | Sort-Object ModificationTime -Descending | Select-Object DisplayName, ModificationTime, Id.
  3. Audit Delegation Permissions on All GPO Objects: Hunt for weak access controls (GenericAll, WriteProperty) granted to non-admin security principals.

  • PowerShell GroupPolicy Module:
    Terminal window
    # List recently modified GPOs
    Get-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 p
    • MATCH p=(u)-[:GenericAll]->(g:GPO) RETURN p

  • 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, and LastWriteTime timestamps in SYSVOL is critical.
  • Full containment mandates cleaning the GPO in SYSVOL before remediating client endpoints.