Detection rules › Splunk

Create_Modify Schtasks (Windows Event Log)

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

Detects possible persistent backdoor access using schtasks -- Threat Group Association: Actinium/Gamaredon/Primitive Bear, Alloy Taurus/Gallium, APT29/Nobelium/Cozy Bear, APT31, APT33, APT34/OilRig, APT35/Phosphorus/Magic Hound, APT41, APT43, BlackByte, BlackCat, Blind Eagle/APT-C-36, Evilnum, FIN7, FIN12, Gamaredon Group/Shuckworm, GoldenJackal, Lazarus, Memento Team, MuddyWater, Redfly, TA428, Turla (akaSecret Blizzard, KRYPTON, and UAC-0003), Vice Society, WinterVivern/UAC-0114, WIRTE, Witchetty

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '1071.1106'
title: Create_Modify Schtasks
description: 'Detects possible persistent backdoor access using schtasks -- Threat
  Group Association: Actinium/Gamaredon/Primitive Bear, Alloy Taurus/Gallium, APT29/Nobelium/Cozy
  Bear, APT31, APT33, APT34/OilRig, APT35/Phosphorus/Magic Hound, APT41, APT43, BlackByte,
  BlackCat, Blind Eagle/APT-C-36, Evilnum, FIN7, FIN12, Gamaredon Group/Shuckworm,
  GoldenJackal, Lazarus, Memento Team, MuddyWater, Redfly, TA428, Turla (akaSecret
  Blizzard, KRYPTON, and UAC-0003), Vice Society, WinterVivern/UAC-0114, WIRTE, Witchetty
  - Software Association: Blackbyte, Black Basta, BianLian, Cactus, Conti, GoMet,
  HermeticWiper/Trojan.Killdisk, Lockbit, Lorenz, LV, NanoCore, Play, Prestige, Prometheus/Spook,
  Rhysida, Trickbot, XingLocker - Atomics T1036.004 Test #1 Atomics T1053.005 Test#1
  Atomics T1053.005 Test#2 Atomics T1053.005 Test#3 Atomics T1053.005 Test#4 - #TrendingThreat
  #Russia #Ukraine'
logic_format: Splunk
logic: ' `get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<") ("schtasks" AND ("/create" OR "/change")) | table _time, host,
  user session_id, parent_process_name, parent_process_path, process, process_name,
  process_path, process_id, src_user | bin span=60s | stats values(*) as * by _time,
  host, session_id | where len(parent_process_name) > 0 AND match(process, "(?i)/create|/change") '
techniques:
- execution:scheduled task/job:scheduled task
- persistence:scheduled task/job:scheduled task
technique_id:
- T1053.005
data_category:
- Windows event logs
references:
- https://attack.mitre.org/techniques/T1053/005/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<") ("schtasks" AND ("/create" OR "/change"))

Stage 2: table

| table _time, host, user session_id, parent_process_name, parent_process_path, process, process_name, process_path, process_id, src_user

Stage 3: bucket

| bin span=60s

Stage 4: stats

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

Stage 5: where

| where len(parent_process_name) > 0 AND match(process, "(?i)/create|/change")

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.

FieldKindValues
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
processmatch
  • "(?i)/create|/change"

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4688<"
1"schtasks"
1"/create"
1"/change"