2022-01-19 22:06:48 -03:00
[ metadata ]
creation_date = "2021/11/08"
2023-02-02 16:22:44 -05:00
integration = [ "system" , "windows" ]
2022-01-19 22:06:48 -03:00
maturity = "production"
2025-03-26 20:34:14 +05:30
updated_date = "2025/03/20"
2022-01-19 22:06:48 -03:00
[ rule ]
author = [ "Elastic" ]
description = "" "
2023-01-04 09:30:07 -05:00
Detects the modification of Group Policy Object attributes to execute a scheduled task in the objects controlled by the
GPO.
2022-01-19 22:06:48 -03:00
" ""
2025-02-19 12:54:31 -03:00
index = [ "logs-system.security*" , "logs-windows.forwarded*" , "winlogbeat-*" ]
2024-08-09 13:11:27 -03:00
language = "eql"
2022-01-19 22:06:48 -03:00
license = "Elastic License v2"
name = "Scheduled Task Execution at Scale via GPO"
note = "" "## Triage and analysis
### Investigating Scheduled Task Execution at Scale via GPO
2023-01-09 08:28:10 -08:00
Group Policy Objects (GPOs) can be used by attackers to execute scheduled tasks at scale to compromise objects controlled by a given GPO. This is done by changing the contents of the `<GPOPath>\\Machine\\Preferences\\ScheduledTasks\\ScheduledTasks.xml` file.
2022-01-19 22:06:48 -03:00
2022-03-31 11:29:30 -03:00
#### Possible investigation steps
2023-01-09 08:28:10 -08:00
- This attack abuses a legitimate mechanism of Active Directory, so it is important to determine whether the activity is legitimate and the administrator is authorized to perform this operation.
- Retrieve the contents of the `ScheduledTasks.xml` file, and check the `<Command>` and `<Arguments>` XML tags for any potentially malicious commands or binaries.
2022-05-18 12:59:39 -03:00
- Investigate other alerts associated with the user/host during the past 48 hours.
- Scope which objects may be compromised by retrieving information about which objects are controlled by the GPO.
2022-03-31 11:29:30 -03:00
### False positive analysis
2022-01-19 22:06:48 -03:00
- Verify if the execution is allowed and done under change management, and if the execution is legitimate.
2022-03-31 11:29:30 -03:00
### Related rules
- Group Policy Abuse for Privilege Addition - b9554892-5e0e-424b-83a0-5aef95aa43bf
- Startup/Logon Script added to Group Policy Object - 16fac1a1-21ee-4ca6-b720-458e3855d046
2022-01-19 22:06:48 -03:00
2022-03-31 11:29:30 -03:00
### Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- The investigation and containment must be performed in every computer controlled by the GPO, where necessary.
- Remove the script from the GPO.
- Check if other GPOs have suspicious scheduled tasks attached.
2022-05-18 12:59:39 -03:00
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
2023-01-09 08:28:10 -08:00
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
2023-10-30 16:53:04 +05:30
" ""
references = [
"https://github.com/atc-project/atc-data/blob/master/docs/Logging_Policies/LP_0025_windows_audit_directory_service_changes.md" ,
"https://github.com/atc-project/atc-data/blob/f2bbb51ecf68e2c9f488e3c70dcdd3df51d2a46b/docs/Logging_Policies/LP_0029_windows_audit_detailed_file_share.md" ,
"https://labs.f-secure.com/tools/sharpgpoabuse" ,
"https://twitter.com/menasec1/status/1106899890377052160" ,
"https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_gpo_scheduledtasks.yml" ,
]
risk_score = 47
rule_id = "15a8ba77-1c13-4274-88fe-6bd14133861e"
2024-03-11 09:09:40 -03:00
setup = "" "## Setup
2022-01-19 22:06:48 -03:00
2022-03-01 21:39:30 -03:00
The 'Audit Detailed File Share' audit policy must be configured (Success Failure).
2024-03-11 09:09:40 -03:00
Steps to implement the logging policy with Advanced Audit Configuration:
2022-03-31 11:29:30 -03:00
2022-01-19 22:06:48 -03:00
```
2022-07-18 15:41:32 -04:00
Computer Configuration >
Policies >
Windows Settings >
Security Settings >
Advanced Audit Policies Configuration >
Audit Policies >
Object Access >
2022-01-19 22:06:48 -03:00
Audit Detailed File Share (Success,Failure)
```
2022-03-01 21:39:30 -03:00
The 'Audit Directory Service Changes' audit policy must be configured (Success Failure).
2024-03-11 09:09:40 -03:00
Steps to implement the logging policy with Advanced Audit Configuration:
2022-03-31 11:29:30 -03:00
2022-01-19 22:06:48 -03:00
```
2022-07-18 15:41:32 -04:00
Computer Configuration >
Policies >
Windows Settings >
Security Settings >
Advanced Audit Policies Configuration >
Audit Policies >
DS Access >
2022-01-19 22:06:48 -03:00
Audit Directory Service Changes (Success,Failure)
```
" ""
severity = "medium"
2023-01-04 09:30:07 -05:00
tags = [
2023-06-22 18:38:56 -03:00
"Domain: Endpoint" ,
"OS: Windows" ,
"Use Case: Threat Detection" ,
"Tactic: Privilege Escalation" ,
2023-10-15 18:12:20 -03:00
"Tactic: Lateral Movement" ,
2023-06-22 18:38:56 -03:00
"Data Source: Active Directory" ,
"Resources: Investigation Guide" ,
2024-05-23 00:45:10 +05:30
"Use Case: Active Directory Monitoring" ,
2025-02-19 12:54:31 -03:00
"Data Source: Windows Security Event Logs" ,
2023-01-04 09:30:07 -05:00
]
2022-01-19 22:06:48 -03:00
timestamp_override = "event.ingested"
2024-08-09 13:11:27 -03:00
type = "eql"
2022-01-19 22:06:48 -03:00
query = '' '
2024-08-09 13:11:27 -03:00
any where host.os.type == "windows" and event.code in ("5136", "5145") and
(
(
winlog.event_data.AttributeLDAPDisplayName : (
"gPCMachineExtensionNames",
"gPCUserExtensionNames"
) and
winlog.event_data.AttributeValue : "*CAB54552-DEEA-4691-817E-ED4A4D1AFC72*" and
winlog.event_data.AttributeValue : "*AADCED64-746C-4633-A97C-D61349046527*"
) or
(
winlog.event_data.ShareName : "\\\\*\\SYSVOL" and
winlog.event_data.RelativeTargetName : "*ScheduledTasks.xml" and
winlog.event_data.AccessList:"*%%4417*"
)
)
2022-01-19 22:06:48 -03:00
' ''
[ [ rule . threat ] ]
framework = "MITRE ATT&CK"
[ [ rule . threat . technique ] ]
id = "T1053"
name = "Scheduled Task/Job"
2023-01-04 09:30:07 -05:00
reference = "https://attack.mitre.org/techniques/T1053/"
[ [ rule . threat . technique . subtechnique ] ]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"
2022-01-19 22:06:48 -03:00
[ [ rule . threat . technique ] ]
id = "T1484"
2024-06-04 20:14:58 +05:30
name = "Domain or Tenant Policy Modification"
2023-01-04 09:30:07 -05:00
reference = "https://attack.mitre.org/techniques/T1484/"
[ [ rule . threat . technique . subtechnique ] ]
id = "T1484.001"
name = "Group Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/001/"
2022-01-19 22:06:48 -03:00
[ rule . threat . tactic ]
id = "TA0004"
name = "Privilege Escalation"
2023-01-04 09:30:07 -05:00
reference = "https://attack.mitre.org/tactics/TA0004/"
2023-10-15 18:12:20 -03:00
[ [ rule . threat ] ]
framework = "MITRE ATT&CK"
[ [ rule . threat . technique ] ]
id = "T1570"
name = "Lateral Tool Transfer"
reference = "https://attack.mitre.org/techniques/T1570/"
[ rule . threat . tactic ]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"
2024-05-23 00:45:10 +05:30