Detection rules › Sigma
Startup/Logon Script Added to Group Policy Object
Detects the modification of Group Policy Objects (GPO) to add a startup/logon script to users or computer objects.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | T1547 Boot or Logon Autostart Execution |
| Privilege Escalation | T1484.001 Domain or Tenant Policy Modification: Group Policy Modification, T1547 Boot or Logon Autostart Execution |
| Defense Impairment | T1484.001 Domain or Tenant Policy Modification: Group Policy Modification |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 5136 | A directory service object was modified. |
| Security-Auditing | Event ID 5145 | A network share object was checked to see whether client can be granted desired access. |
Rule body yaml
title: Startup/Logon Script Added to Group Policy Object
id: 123e4e6d-b123-48f8-b261-7214938acaf0
status: test
description: |
Detects the modification of Group Policy Objects (GPO) to add a startup/logon script to users or computer objects.
references:
- https://www.elastic.co/guide/en/security/current/startup-logon-script-added-to-group-policy-object.html
author: Elastic, Josh Nickels, Marius Rothenbücher
date: 2024-09-06
tags:
- attack.persistence
- attack.privilege-escalation
- attack.defense-impairment
- attack.t1484.001
- attack.t1547
logsource:
product: windows
service: security
definition: 'The advanced audit policy setting "Object Access > Audit Detailed File Share" must be configured for Success/Failure'
detection:
selection_eventid:
EventID:
- 5136
- 5145
selection_attributes_main:
AttributeLDAPDisplayName:
- 'gPCMachineExtensionNames'
- 'gPCUserExtensionNames'
AttributeValue|contains: '42B5FAAE-6536-11D2-AE5A-0000F87571E3'
selection_attributes_optional:
AttributeValue|contains:
- '40B6664F-4972-11D1-A7CA-0000F87571E3'
- '40B66650-4972-11D1-A7CA-0000F87571E3'
selection_share:
ShareName|endswith: '\SYSVOL'
RelativeTargetName|endswith:
- '\scripts.ini'
- '\psscripts.ini'
AccessList|contains: '%%4417'
condition: selection_eventid and (all of selection_attributes_* or selection_share)
falsepositives:
- Legitimate execution by system administrators.
level: medium
Stages and Predicates
Stage 0: condition
selection_eventid and (all of selection_attributes_* or selection_share)Stage 1: selection_eventid
selection_eventid:
EventID:
- 5136
- 5145
Stage 2: selection_attributes_main
selection_attributes_main:
AttributeLDAPDisplayName:
- 'gPCMachineExtensionNames'
- 'gPCUserExtensionNames'
AttributeValue|contains: '42B5FAAE-6536-11D2-AE5A-0000F87571E3'
Stage 3: selection_attributes_optional
selection_attributes_optional:
AttributeValue|contains:
- '40B6664F-4972-11D1-A7CA-0000F87571E3'
- '40B66650-4972-11D1-A7CA-0000F87571E3'
Stage 4: selection_share
selection_share:
ShareName|endswith: '\SYSVOL'
RelativeTargetName|endswith:
- '\scripts.ini'
- '\psscripts.ini'
AccessList|contains: '%%4417'
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
AccessList | match |
|
AttributeLDAPDisplayName | eq |
|
AttributeValue | match |
|
RelativeTargetName | ends_with |
|
ShareName | ends_with |
|