Detection rules › Splunk

Rare Schedule Task Created (Windows Event Log)

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

Schedule tasks are often a form of persistence utilized by threat actors. This use case looks for rare occurrences for when a task is created

MITRE ATT&CK coverage

References

Event coverage

ProviderEventTitle
Security-AuditingEvent ID 4698A scheduled task was created.

Rule body yaml

id: '12931.18578'
title: Rare Schedule Task Created
description: 'Schedule tasks are often a form of persistence utilized by threat actors.
  This use case looks for rare occurrences for when a task is created. -- Threat Actor
  Association: APT-K-47/Mysterious Elephant, CL-STA-0043, Redfly, Turla (akaSecret
  Blizzard, KRYPTON, and UAC-0003) -- Software Association: BianLian, Play'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4698) OR
  "<EventID>4698<") | eval task_name=coalesce(Task_Name, TaskName)| table _time, host,
  user process, process_*, signature_id, parent_*, task_name | bin span=1s | stats
  values(*) as * by _time, host | eventstats count by task_name| where count < 5 '
techniques:
- execution:scheduled task/job:scheduled task
- persistence:scheduled task/job:scheduled task
- privilege-escalation:scheduled task/job:scheduled task
technique_id:
- T1053.005
data_category:
- Windows event logs
references:
- https://thedfirreport.com/2022/04/25/quantum-ransomware/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4698) OR "<EventID>4698<")

Stage 2: eval

| eval task_name=coalesce(Task_Name, TaskName)

Stage 3: table

| table _time, host, user process, process_*, signature_id, parent_*, task_name

Stage 4: bucket

| bin span=1s

Stage 5: stats

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

Stage 6: eventstats

| eventstats count by task_name

Stage 7: where

| where count < 5

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
  • 4698 corpus 14 (splunk 14)
countlt
  • 5

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>4698<"