<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Group-Policy — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/group-policy/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/group-policy/feed.xml" rel="self" type="application/rss+xml"/><item><title>GPO Scheduled Task or Service Creation/Modification</title><link>https://feed.craftedsignal.io/briefs/2024-01-gpo-scheduled-task-modification/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-gpo-scheduled-task-modification/</guid><description>Detection of the creation or modification of new Group Policy based scheduled tasks or services, which can be abused by attackers with domain admin permissions to execute malicious payloads remotely on domain-joined machines, leading to privilege escalation and persistence.</description><content:encoded><![CDATA[<p>Attackers with domain administrator privileges can abuse Group Policy Objects (GPOs) to deploy malicious payloads across a Windows domain. By creating or modifying scheduled tasks or services via GPOs, an attacker can achieve both privilege escalation and persistence. This involves modifying files such as <code>ScheduledTasks.xml</code> or <code>Services.xml</code> within the SYSVOL share. The modifications are replicated to domain-joined machines when the GPO is applied. This technique allows for remote code execution and control over a significant number of systems from a central point, making it a powerful tool for adversaries targeting enterprise environments. The described rule detects file modifications within specific GPO paths, excluding changes made by the <code>dfsrs.exe</code> process to reduce false positives. The rule is designed to detect suspicious activities related to scheduled tasks and services within Group Policy settings, helping security teams identify and respond to potential threats originating from compromised domain administrator accounts.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains domain administrator privileges through compromised credentials or exploiting a vulnerability.</li>
<li>Attacker navigates to the SYSVOL share, typically located at <code>\\&lt;domain&gt;\SYSVOL\&lt;domain&gt;\Policies\</code>.</li>
<li>Attacker identifies a GPO to modify or creates a new GPO.</li>
<li>Attacker modifies the <code>ScheduledTasks.xml</code> or <code>Services.xml</code> file within the GPO&rsquo;s directory (<code>&lt;GPO_GUID&gt;\MACHINE\Preferences\ScheduledTasks\</code> or <code>&lt;GPO_GUID&gt;\MACHINE\Preferences\Services\</code>).</li>
<li>The modified XML file contains instructions to create a scheduled task or service that executes a malicious payload.</li>
<li>The Group Policy Management Console (GPMC) or other tools are used to link the GPO to an organizational unit (OU) containing target computers.</li>
<li>Target machines within the OU receive the updated GPO settings during the next Group Policy refresh cycle (or forced via <code>gpupdate /force</code>).</li>
<li>The scheduled task or service is created on the target machine, executing the attacker&rsquo;s malicious payload and achieving persistence or privilege escalation.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>A successful attack can lead to widespread compromise across the domain. Attackers can execute arbitrary code on numerous systems, potentially leading to data exfiltration, ransomware deployment, or disruption of critical services. The impact can range from minor inconveniences to complete operational shutdown, depending on the nature of the malicious payload and the attacker&rsquo;s objectives. Without proper detection and response mechanisms, such attacks can persist for extended periods, causing significant damage to the organization.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Deploy the Sigma rule <code>Detect GPO Scheduled Task/Service Modification via File Event</code> to detect unauthorized modifications to <code>ScheduledTasks.xml</code> and <code>Services.xml</code> files within GPO paths.</li>
<li>Enable Sysmon file creation and modification logging to provide the necessary data for the Sigma rules to function effectively.</li>
<li>Review and harden GPO management access controls to limit the potential for abuse by compromised accounts, based on the observed T1484.001 technique.</li>
<li>Investigate any alerts generated by the deployed rules, focusing on the user accounts and processes involved in the file modifications as described in the overview.</li>
<li>Monitor for process execution from unusual locations based on service creation or scheduled task as described in the TTPs.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>group-policy</category><category>privilege-escalation</category><category>persistence</category><category>windows</category></item><item><title>GPO Scheduled Task Abuse for Privilege Escalation and Lateral Movement</title><link>https://feed.craftedsignal.io/briefs/2024-01-gpo-scheduled-task-abuse/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-gpo-scheduled-task-abuse/</guid><description>Attackers abuse Group Policy Objects by modifying scheduled task attributes to execute malicious commands across objects controlled by the GPO, potentially leading to privilege escalation and lateral movement.</description><content:encoded><![CDATA[<p>Attackers can abuse Group Policy Objects (GPOs) to execute scheduled tasks at scale, compromising objects controlled by a given GPO. This involves modifying the contents of the <code>&lt;GPOPath&gt;\\Machine\\Preferences\\ScheduledTasks\\ScheduledTasks.xml</code> file. By altering the XML file to include malicious commands, attackers can achieve privilege escalation or lateral movement within the domain. This technique leverages a legitimate Active Directory mechanism, making it essential to differentiate between authorized administrative actions and malicious activities. The modification can be identified through changes to <code>gPCMachineExtensionNames</code> or <code>gPCUserExtensionNames</code> attributes within Active Directory.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker gains initial access to a system with permissions to modify GPOs.</li>
<li>Attacker modifies the <code>ScheduledTasks.xml</code> file within the SYSVOL share of a targeted GPO (<code>\\\\*\\SYSVOL</code>).</li>
<li>The attacker changes the contents of the XML file to include a malicious <code>&lt;Command&gt;</code> and <code>&lt;Arguments&gt;</code> tag.</li>
<li>The modified GPO is replicated to domain controllers.</li>
<li>Target systems receive the updated GPO during regular group policy refresh cycles.</li>
<li>The scheduled task defined in the modified <code>ScheduledTasks.xml</code> is executed on the target systems.</li>
<li>The malicious command executes, potentially escalating privileges or facilitating lateral movement.</li>
<li>Attacker achieves desired objective, such as installing malware, creating new accounts, or exfiltrating data.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows attackers to execute arbitrary code on systems managed by the modified GPO. The scope of impact depends on the targeted GPO and the permissions of the scheduled task. This can lead to widespread compromise, affecting numerous systems and users within the domain. The modification of GPOs can be difficult to detect without proper monitoring, potentially allowing attackers to maintain persistence and control over the environment.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable and monitor Windows audit policies for &ldquo;Audit Directory Service Changes&rdquo; and &ldquo;Audit Detailed File Share&rdquo; to detect modifications to GPOs and file share access, as outlined in the <a href="#setup">setup</a> section.</li>
<li>Deploy the Sigma rule &ldquo;Scheduled Task Execution via GPO Attribute Modification&rdquo; to detect modifications to the <code>gPCMachineExtensionNames</code> or <code>gPCUserExtensionNames</code> attributes (rule: <code>Scheduled Task Execution via GPO Attribute Modification</code>).</li>
<li>Deploy the Sigma rule &ldquo;Scheduled Task XML File Modification in SYSVOL&rdquo; to detect modifications to the ScheduledTasks.xml file in SYSVOL shares (rule: <code>Scheduled Task XML File Modification in SYSVOL</code>).</li>
<li>Review and validate any changes to GPOs, specifically those related to scheduled tasks, to ensure they are authorized and legitimate.</li>
<li>Monitor for the execution of unexpected or malicious commands originating from scheduled tasks created or modified via GPOs.</li>
<li>Regularly audit and review GPO configurations to identify any potential weaknesses or misconfigurations that could be exploited.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>group-policy</category><category>scheduled-task</category><category>privilege-escalation</category><category>lateral-movement</category></item><item><title>GPO Modification to Add Startup/Logon Scripts</title><link>https://feed.craftedsignal.io/briefs/2024-01-gpo-ini-script-modification/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-gpo-ini-script-modification/</guid><description>This rule detects the modification of Group Policy Objects (GPO) to add a startup or logon script to user or computer objects, enabling attackers to achieve privilege escalation and persistence by executing arbitrary commands at scale.</description><content:encoded><![CDATA[<p>Attackers may abuse Group Policy Objects (GPOs) to execute malicious commands at startup, logon, shutdown, and logoff by modifying the <code>scripts.ini</code> or <code>psscripts.ini</code> files. This involves adding or modifying these files within the <code>&lt;GPOPath&gt;\\Machine\\Scripts\\</code> or <code>&lt;GPOPath&gt;\\User\\Scripts\\</code> directories. Such modifications can lead to privilege escalation by running commands with elevated privileges when users log on or systems start. Successful exploitation allows the attacker to maintain persistent access and control over the targeted systems within the Active Directory environment. This activity is often used in post-exploitation scenarios after initial access has been gained through other means, such as phishing or exploiting vulnerabilities. The goal is to achieve widespread command execution across multiple systems within the domain.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains initial access to a system with sufficient privileges to modify GPOs, often through compromised credentials or exploiting a vulnerability.</li>
<li>The attacker identifies a target GPO to modify, typically one that applies to a large number of users or computers.</li>
<li>The attacker modifies either the <code>scripts.ini</code> or <code>psscripts.ini</code> file within the <code>Machine\\Scripts</code> or <code>User\\Scripts</code> directory of the targeted GPO.</li>
<li>The modification involves adding a new script entry or modifying an existing one to point to a malicious script or command. This script can be a batch file, PowerShell script, or executable.</li>
<li>The attacker links the GPO to an Organizational Unit (OU) containing the target computers or users, or modifies the existing GPO link.</li>
<li>When targeted users log on or computers start up, the GPO settings are applied, and the malicious script is executed.</li>
<li>The malicious script performs actions such as installing malware, adding user accounts with elevated privileges, or modifying system configurations.</li>
<li>The attacker achieves persistence and/or elevated privileges across the targeted systems, enabling further malicious activities.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows attackers to execute arbitrary commands with elevated privileges across numerous systems within the targeted domain. This can result in widespread malware infection, data theft, or complete system compromise. The impact can range from operational disruption to significant financial loss and reputational damage, affecting potentially hundreds or thousands of machines. Since this attack leverages legitimate Active Directory functionalities, detection can be challenging without proper monitoring and alerting mechanisms in place.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Enable &ldquo;Audit Directory Service Changes&rdquo; and &ldquo;Audit Detailed File Share&rdquo; Windows audit policies to generate the events required for detection, as described in the <a href="https://ela.st/audit-directory-service-changes">setup instructions</a> and <a href="https://ela.st/audit-detailed-file-share">audit detailed file share instructions</a>.</li>
<li>Deploy the Sigma rule &ldquo;Detect GPO Modification for Startup/Logon Scripts&rdquo; to your SIEM to detect modifications to GPOs that add or modify startup/logon scripts.</li>
<li>Monitor Windows Security Event Logs for Event IDs 5136 and 5145 related to GPO modifications.</li>
<li>Regularly review GPO settings to identify any unauthorized or suspicious scripts.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>group-policy</category><category>privilege-escalation</category><category>persistence</category><category>windows</category></item></channel></rss>