T1484.001: Group Policy 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 predictable network path \<DOMAIN>\SYSVOL\<DOMAIN>\Policies\.

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

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

Positive Technologies products that cover the technique

MaxPatrol SIEM knowledge base

mitre_attck_defense_evasion: PT-CR-2706: Suspicious_File_Creation_In_Sysvol: A suspicious file was created in one of the following subdirectories of the Sysvol network share: Startup, Shutdown, Logon, Logoff, or Scripts. These subdirectories are used for storing executables and script files required for managing group policies and other settings in Active Directory. This could be an attacker's attempt to gain persistence in the system. active_directory_attacks: PT-CR-2437: GPO_Created_Or_Modified: A group policy object was created or modified. Attackers can modify group policy objects to escalate privileges in a domain. active_directory_attacks: PT-CR-2597: GPO_Schedule_Task_Modification: Modification of scheduledtasks.xml in a Group Policy object. An attacker can use a scheduled task to perform malicious actions.

Detection

IDDS0017Data source and componentCommand: Command ExecutionDescription

Monitor executed commands and arguments that 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.

IDDS0026Data source and componentActive Directory: Active Directory Object DeletionDescription

Monitor for unexpected deletion of an active directory object, such as Windows EID 5141.

IDDS0026Data source and componentActive Directory: Active Directory Object CreationDescription

Monitor for newly constructed active directory objects, such as Windows EID 5137.

IDDS0026Data source and componentActive Directory: Active Directory Object ModificationDescription

Monitor for changes made to AD settings for unexpected modifications to user accounts, such as deletions or potentially malicious changes to user attributes (credentials, status, etc.).

Mitigation

IDM1047NameAuditDescription

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

IDM1018NameUser Account ManagementDescription

Consider implementing WMI and security filtering to further tailor which users and computers a GPO will apply to.