Windows gpscript.exe Executes Group Policy Logon/Startup Scripts

Flags gpscript.exe running with /logon or /startup, suggestive of Group Policy script execution abuse.

FreeReviewedSigma · Medium · v2
Product
windows
Category
process_creation
Author
frack113 (SigmaHQ), DRL 1.1
Published
2022-05-16
Updated
2026-07-31
title: Windows gpscript.exe Executes Group Policy Logon/Startup Scripts
id: e6c0aacc-29de-4af4-a049-a20db74e7d8a
status: test
description: This rule identifies execution of gpscript.exe where the command line includes /logon or /startup, indicating that Group Policy–configured scripts are being run. Attackers can abuse this LOLBIN behavior to execute arbitrary script payloads at user logon or system startup. Detection relies on Windows process creation telemetry, matching the executable name and the specific command-line flags, and excluding cases where the parent command line matches the gpsvc svchost context.
references:
  - https://oddvar.moe/2018/04/27/gpscript-exe-another-lolbin-to-the-list/
  - https://lolbas-project.github.io/lolbas/Binaries/Gpscript/
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_lolbin_gpscript.yml
author: frack113, Huntrule Team
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
license: DRL-1.1
related:
  - id: 1e59c230-6670-45bf-83b0-98903780607e
    type: derived