Detection rules › Sigma
Gpscript Execution
Detects the execution of the LOLBIN gpscript, which executes logon or startup scripts configured in Group Policy
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | T1218 System Binary Proxy Execution |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
Rule body yaml
title: Gpscript Execution
id: 1e59c230-6670-45bf-83b0-98903780607e
status: test
description: Detects the execution of the LOLBIN gpscript, which executes logon or startup scripts configured in Group Policy
references:
- https://oddvar.moe/2018/04/27/gpscript-exe-another-lolbin-to-the-list/
- https://lolbas-project.github.io/lolbas/Binaries/Gpscript/
author: frack113
date: 2022-05-16
modified: 2023-06-14
tags:
- attack.stealth
- attack.t1218
logsource:
product: windows
category: process_creation
detection:
selection_img:
- Image|endswith: '\gpscript.exe'
- OriginalFileName: 'GPSCRIPT.EXE'
selection_cli:
CommandLine|contains:
- ' /logon'
- ' /startup'
filter_main_svchost:
ParentCommandLine: 'C:\windows\system32\svchost.exe -k netsvcs -p -s gpsvc'
condition: all of selection_* and not 1 of filter_main_*
falsepositives:
- Legitimate uses of logon scripts distributed via group policy
level: medium
Stages and Predicates
Stage 0: condition
all of selection_* and not 1 of filter_main_*Stage 1: selection_img
selection_img:
- Image|endswith: '\gpscript.exe'
- OriginalFileName: 'GPSCRIPT.EXE'
Stage 2: selection_cli
selection_cli:
CommandLine|contains:
- ' /logon'
- ' /startup'
Stage 3: not filter_main_svchost
filter_main_svchost:
ParentCommandLine: 'C:\windows\system32\svchost.exe -k netsvcs -p -s gpsvc'
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
ParentCommandLine | eq | C:\windows\system32\svchost.exe -k netsvcs -p -s gpsvc |
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 |
|---|---|---|
CommandLine | match |
|
Image | ends_with |
|
OriginalFileName | eq |
|