Detectionmediumtest

Gpscript Execution

Detects the execution of the LOLBIN gpscript, which executes logon or startup scripts configured in Group Policy

Open in Detection LabConvert ruleBuild Package
François HubautCreated 2022-05-16Updated 2023-06-141e59c230-6670-45bf-83b0-98903780607ewindows
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic3 selectors
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_*
False Positives

Legitimate uses of logon scripts distributed via group policy

Rule Metadata
Rule ID
1e59c230-6670-45bf-83b0-98903780607e
Status
test
Level
medium
Type
Detection
Created
2022-05-16
Modified
2023-06-14
Path
rules/windows/process_creation/proc_creation_win_lolbin_gpscript.yml
Raw Tags
attack.stealthattack.t1218
View on GitHub