Domain Policy Modification: Group Policy Modification

ID Name
T1484.001 Group Policy Modification
T1484.002 Domain Trust Modification

Adversaries may modify Group Policy Objects (GPOs) to subvert the intended discretionary access controls for a domain, usually with the intention of escalating privileges on the domain. Group policy allows for centralized management of user and computer settings in Active Directory (AD). GPOs are containers for group policy settings made up of files stored within a predicable network path \<DOMAIN>\SYSVOL\<DOMAIN>\Policies\.[1][2]

Like other objects in AD, GPOs have access controls associated with them. By default all user accounts in the domain have permission to read GPOs. It is possible to delegate GPO access control permissions, e.g. write access, to specific users or groups in the domain.

Malicious GPO modifications can be used to implement many other malicious behaviors such as Scheduled Task/Job, Disable or Modify Tools, Ingress Tool Transfer, Create Account, Service Execution, and more.[2][3][4][5][6] Since GPOs can control so many user and machine settings in the AD environment, there are a great number of potential attacks that can stem from this GPO abuse.[3]

For example, publicly available scripts such as New-GPOImmediateTask can be leveraged to automate the creation of a malicious Scheduled Task/Job by modifying GPO settings, in this case modifying <GPO_PATH>\Machine\Preferences\ScheduledTasks\ScheduledTasks.xml.[3][4] In some cases an adversary might modify specific user rights like SeEnableDelegationPrivilege, set in <GPO_PATH>\MACHINE\Microsoft\Windows NT\SecEdit\GptTmpl.inf, to achieve a subtle AD backdoor with complete control of the domain because the user account under the adversary's control would then be able to modify GPOs.[7]

ID: T1484.001
Sub-technique of:  T1484
Platforms: Windows
Permissions Required: Administrator, User
Contributors: Itamar Mizrahi, Cymptom; Tristan Bennett, Seamless Intelligence
Version: 1.0
Created: 28 December 2020
Last Modified: 09 February 2021

Procedure Examples

ID Name Description
S0554 Egregor

Egregor can modify the GPO to evade detection.[8] [9]

S0363 Empire

Empire can use New-GPOImmediateTask to modify a GPO that will install and execute a malicious Scheduled Task/Job.[10]

S0697 HermeticWiper

HermeticWiper has the ability to deploy through an infected system's default domain policy.[11]

G0119 Indrik Spider

Indrik Spider has used Group Policy Objects to deploy batch scripts.[12]

S0688 Meteor

Meteor can use group policy to push a scheduled task from the AD to all network machines.[13]

Mitigations

ID Mitigation Description
M1047 Audit

Identify and correct GPO permissions abuse opportunities (ex: GPO modification privileges) using auditing tools such as BloodHound (version 1.5.1 and later).[14]

M1018 User Account Management

Consider implementing WMI and security filtering to further tailor which users and computers a GPO will apply to.[3][15][16]

Detection

ID Data Source Data Component
DS0026 Active Directory Active Directory Object Creation
Active Directory Object Deletion
Active Directory Object Modification
DS0017 Command Command Execution

It is possible to detect GPO modifications by monitoring directory service changes using Windows event logs. Several events may be logged for such GPO modifications, including:

  • Event ID 5136 - A directory service object was modified
  • Event ID 5137 - A directory service object was created
  • Event ID 5138 - A directory service object was undeleted
  • Event ID 5139 - A directory service object was moved
  • Event ID 5141 - A directory service object was deleted

GPO abuse will often be accompanied by some other behavior such as Scheduled Task/Job, which will have events associated with it to detect. Subsequent permission value modifications, like those to SeEnableDelegationPrivilege, can also be searched for in events associated with privileges assigned to new logons (Event ID 4672) and assignment of user rights (Event ID 4704).

References