Password in Group Policy Preferences (GPP) Compromise
Introduction
Group Policy Preferences (GPP) is a feature in Microsoft Active Directory that allows administrators to configure and deploy system settings, including mapped drives, scheduled tasks, and local user accounts, across domain-joined computers. GPP once supported the deployment of local accounts with embedded passwords stored in the policy files. However, these passwords were encrypted using a weak AES key that was published publicly by Microsoft.
Attackers can exploit this vulnerability to extract plaintext passwords from GPP files, potentially gaining unauthorised access to sensitive systems. This technique is categorised under the Credential Access tactic in the MITRE ATT&CK Framework (ID: T1552.006).
How Password in GPP Compromise Works
Group Policy Preferences and Passwords:
GPP allowed administrators to configure local user accounts or services with passwords stored in XML files within the SYSVOL directory (
\\<domain>\SYSVOL\<domain>\Policies\
).These XML files were encrypted using a fixed AES key, which Microsoft included in their documentation.
Attack Workflow:
Reconnaissance:
Attackers gain access to the domain and enumerate GPP files in the SYSVOL share.
These files are accessible to all domain-authenticated users due to the default permissions on SYSVOL.
Decryption:
Attackers extract the encrypted password from GPP XML files and decrypt it using the publicly available AES key.
Credential Abuse:
The decrypted password may belong to an administrative account, allowing attackers to escalate privileges or move laterally within the network.
GPP Password Files of Interest:
Groups.xml: Local group accounts and passwords.
Services.xml: Service accounts and passwords.
Scheduledtasks.xml: Task-related accounts and passwords.
Risks of GPP Compromise
Wide Access:
Any domain-authenticated user can read the SYSVOL share and access GPP files.
Privilege Escalation:
The compromised credentials may belong to accounts with administrative privileges, enabling further exploitation.
Lateral Movement:
Attackers can use the extracted credentials to access other systems or escalate privileges.
Persistence:
Compromised credentials can be reused later, especially if not regularly rotated.
Indicators of GPP Compromise
Unusual Access to SYSVOL:
Unexpected or unauthorised access to SYSVOL, particularly to GPP XML files.
Enumeration of GPP Files:
Commands or scripts targeting files like
Groups.xml
,Services.xml
, orScheduledtasks.xml
.
Use of Known Attack Tools:
Use of tools like PowerShell, Impacket, or Mimikatz to query SYSVOL for GPP files.
New Local Accounts or Privilege Changes:
Creation of new local administrator accounts on systems using credentials extracted from GPP.
Mitigation Strategies
Audit and Remove GPP Passwords:
Search for and remove any passwords stored in GPP XML files:
Rotate Credentials:
Reset passwords for any accounts found in GPP files to prevent further misuse.
Restrict SYSVOL Access:
Limit SYSVOL access to authorised users wherever possible without breaking AD functionality.
Disable Local Administrator Accounts:
Disable or remove unnecessary local administrator accounts to reduce attack surfaces.
Monitor SYSVOL Access:
Enable auditing on the SYSVOL directory to detect unauthorised access attempts.
Detection Strategies
Monitor for SYSVOL Enumeration:
Look for file access patterns targeting GPP XML files in the SYSVOL share.
Use Windows Event ID 5145 (A file was accessed) to track file access activity.
Detect Decryption Activity:
Monitor for tools or scripts using the known AES decryption key for GPP files.
Analyse Lateral Movement:
Look for logons or authentications from accounts with credentials found in GPP.
Monitor Suspicious Commands:
Track commands used to query GPP files:
dir \\<domain>\SYSVOL\<domain>\Policies
findstr "cpassword"
Detection Query Examples
PowerShell for Finding GPP Passwords:
Windows Event Query:
Search for Event ID 5145 for file access activity on \\<domain>\SYSVOL
.
The use of passwords in Group Policy Preferences is a significant security risk, especially in environments where older configurations persist. Organisations must actively search for and remove these passwords, rotate compromised credentials, and monitor access to the SYSVOL share to prevent exploitation. By implementing proper detection and mitigation measures, you can significantly reduce the risks associated with this type of compromise.
KQL Detection Queries
To detect potential Password in Group Policy Preferences (GPP) compromise in Microsoft Sentinel using KQL, we need to monitor access to the SYSVOL share, specifically for activity involving files like Groups.xml
, Services.xml
, or Scheduledtasks.xml
. Additionally, we can search for the cpassword field in these files, which indicates a password stored in GPP.
KQL Query to Detect GPP Password Enumeration
This query identifies suspicious access to GPP XML files and potential enumeration in the SYSVOL share
Query Breakdown
Target Event ID 5145:
Event ID 5145 logs file access on shared resources, including SYSVOL.
Filter SYSVOL Access:
Looks for access to
\\SYSVOL
and specifically targets XML files or entries containingcpassword
.
Aggregate Activity:
Tracks:
AccessCount
: Total file access attempts.AccessedFiles
: The set of accessed XML files.UniqueUsers
andAccounts
: Number of unique users accessing the files.FirstSeen
andLastSeen
: Time range of activity.
Threshold for Suspicious Activity:
Flags activity with more than 10 file access attempts, assigning a SuspiciousActivity score:
High: Over 50 accesses.
Medium: Over 10 accesses.
Output Details:
Displays key information for investigation, such as the computer, source IP, accounts involved, and files accessed.
Splunk Detection Queries
To detect Password in Group Policy Preferences (GPP) compromise in Splunk, you can focus on file access events within the SYSVOL share, particularly targeting .xml
files like Groups.xml
, Services.xml
, or Scheduledtasks.xml
where passwords might be stored. Additionally, you can identify the presence of the cpassword field in these files.
Splunk Query for GPP Password Compromise Detection
Query Breakdown
Target Event ID 5145:
EventCode 5145 logs file access on shared resources, including the SYSVOL directory.
Focus on GPP Files:
Filters for access to
.xml
files in the SYSVOL share, especially files likeGroups.xml
,Services.xml
, andScheduledtasks.xml
.
Aggregate Suspicious Activity:
Groups file access events by
ComputerName
and aggregates key metrics:AccessCount: Total file access attempts.
AccessedFiles: Specific files accessed.
UniqueUsers: Number of distinct users involved.
UniqueIPs and SourceIPs: IP addresses accessing the files.
Apply Suspicious Thresholds:
Assigns a SuspiciousScore based on the volume of file access:
High: Over 50 accesses.
Medium: Over 20 accesses.
Output Details:
Displays key data for investigation, including accessed files, user accounts, source IPs, and time range.
Reference
Last updated