Detection: WinEvent Windows Task Scheduler Event Action Started

Description

The following analytic detects the execution of tasks registered in Windows Task Scheduler by monitoring EventID 200 (action run) and 201 (action completed) from the Task Scheduler logs. This detection leverages Task Scheduler logs to identify potentially suspicious or unauthorized task executions. Monitoring these events is significant for a SOC as it helps uncover evasive techniques used for persistence, unauthorized code execution, or other malicious activities. If confirmed malicious, this activity could lead to unauthorized access, data exfiltration, or the execution of harmful payloads, posing a significant threat to the environment.

1`wineventlog_task_scheduler` EventCode IN ("200","201")  
2| stats count min(_time) as firstTime max(_time) as lastTime by TaskName dest EventCode 
3| `security_content_ctime(firstTime)` 
4| `security_content_ctime(lastTime)` 
5| `winevent_windows_task_scheduler_event_action_started_filter`

Data Source

Name Platform Sourcetype Source Supported App
Windows Event Log TaskScheduler 200 Windows icon Windows 'wineventlog' 'WinEventLog:Microsoft-Windows-TaskScheduler/Operational' N/A

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
winevent_windows_task_scheduler_event_action_started_filter search *
winevent_windows_task_scheduler_event_action_started_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1053.005 Scheduled Task Execution
KillChainPhase.EXPLOITAITON
KillChainPhase.INSTALLATION
NistCategory.DE_AE
Cis18Value.CIS_10
APT-C-36
APT29
APT3
APT32
APT33
APT37
APT38
APT39
APT41
BITTER
BRONZE BUTLER
Blue Mockingbird
Chimera
Cobalt Group
Confucius
Dragonfly
FIN10
FIN13
FIN6
FIN7
FIN8
Fox Kitten
GALLIUM
Gamaredon Group
HEXANE
Higaisa
Kimsuky
Lazarus Group
LuminousMoth
Machete
Magic Hound
Molerats
MuddyWater
Mustang Panda
Naikon
OilRig
Patchwork
Rancor
Silence
Stealth Falcon
TA2541
ToddyCat
Wizard Spider
menuPass

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event False
This configuration file applies to all detections of type hunting.

Implementation

Task Scheduler logs are required to be collected. Enable logging with inputs.conf by adding a stanza for [WinEventLog://Microsoft-Windows-TaskScheduler/Operational] and renderXml=false. Note, not translating it in XML may require a proper extraction of specific items in the Message.

Known False Positives

False positives will be present. Filter based on ActionName paths or specify keywords of interest.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
A Scheduled Task was scheduled and ran on $dest$. 80 80 100
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset XmlWinEventLog:Security XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Security XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 3