Detection rules › Splunk

Git Spawns System32 Process (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries with the help of Git hooks. These interfaces and languages provide ways of interacting with computer systems and are a common feature across many different platforms. Most systems come with some built-in command-line interface and scripting capabilities, for example, Windows installations include the Windows Command Shell and PowerShell. This use case detects Git hooks spawning a System32 process. Note: for best rule fidelity, Windows Event or Sysmon process creation logs are recommended due to their detailed parent process path information. Vulnerability reference: CVE-2024-32002

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '32312.57469'
title: Git Spawns System32 Process
description: 'Adversaries may abuse command and script interpreters to execute commands,
  scripts, or binaries with the help of Git hooks. These interfaces and languages
  provide ways of interacting with computer systems and are a common feature across
  many different platforms. Most systems come with some built-in command-line interface
  and scripting capabilities, for example, Windows installations include the Windows
  Command Shell and PowerShell. This use case detects Git hooks spawning a System32
  process. Note: for best rule fidelity, Windows Event or Sysmon process creation
  logs are recommended due to their detailed parent process path information. Vulnerability
  reference: CVE-2024-32002'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM(git) OR TERM(gh)) "C:\\Windows\\system32"
  | where match(process, "(?i)C:\x5cWindows\x5csystem32") and match(parent_process_path,
  "(?i)\x5cgit\x5c") and not match(process, "(?i)\x5c\?\?\x5cC:\x5cWindows\x5csystem32\x5cconhost\.exe\s+0xffffffff\s+-ForceV1")
  | table _time, host, user, parent_process_name, parent_process_path, process_path,
  process | bin span=1s | stats values(*) as * by _time, host '
techniques:
- execution:command and scripting interpreter
technique_id: 
- T1059
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://amalmurali.me/posts/git-rce/
- https://github.com/amalmurali47/git_rce/tree/main
- https://nvd.nist.gov/vuln/detail/CVE-2024-32002

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(git) OR TERM(gh)) "C:\\Windows\\system32"

Stage 2: where

| where match(process, "(?i)C:\x5cWindows\x5csystem32") and match(parent_process_path, "(?i)\x5cgit\x5c") and not match(process, "(?i)\x5c\?\?\x5cC:\x5cWindows\x5csystem32\x5cconhost\.exe\s+0xffffffff\s+-ForceV1")

Stage 3: table

| table _time, host, user, parent_process_name, parent_process_path, process_path, process

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
processregex_match"(?i)\x5c??\x5cC:\x5cWindows\x5csystem32\x5cconhost.exe\s+0xffffffff\s+-ForceV1"excludes:process

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
parent_process_pathregex_match
  • "(?i)\x5cgit\x5c" corpus 2 (splunk 2)
field:"parent_process_name" kind:regex_match
processregex_match
  • "(?i)C:\x5cWindows\x5csystem32" corpus 3 (splunk 3)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1git
1gh
1"C:\\Windows\\system32"