ID | Technique | Tactic |
---|---|---|
T1053.005 | Scheduled Task | Execution |
Detection: Short Lived Scheduled Task
Description
The following analytic detects the creation and deletion of scheduled tasks within a short time frame (less than 30 seconds) using Windows Security EventCodes 4698 and 4699. This behavior is identified by analyzing Windows Security Event Logs and leveraging the Windows TA for parsing. Such activity is significant as it may indicate lateral movement or remote code execution attempts by adversaries. If confirmed malicious, this could lead to unauthorized access, data exfiltration, or execution of malicious payloads, necessitating prompt investigation and response by security analysts.
Search
1`wineventlog_security` EventCode=4698 OR EventCode=4699
2| xmlkv Message
3| transaction Task_Name startswith=(EventCode=4698) endswith=(EventCode=4699)
4| eval short_lived=case((duration<30),"TRUE")
5| search short_lived = TRUE
6| rename ComputerName as dest
7| table _time, dest, Account_Name, Command, Task_Name, short_lived
8| `short_lived_scheduled_task_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
Windows Event Log Security 4698 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:Security' |
Windows Event Log Security 4699 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:Security' |
Macros Used
Name | Value |
---|---|
wineventlog_security | eventtype=wineventlog_security OR Channel=security OR source=XmlWinEventLog:Security |
short_lived_scheduled_task_filter | search * |
short_lived_scheduled_task_filter
is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
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 Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
To successfully implement this search, you need to be ingesting Windows Security Event Logs with 4698 EventCode enabled. The Windows TA is also required.
Known False Positives
Although uncommon, legitimate applications may create and delete a Scheduled Task within 30 seconds. Filter as needed.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
A windows scheduled task was created and deleted in 30 seconds on $dest$ | 81 | 90 | 90 |
References
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | WinEventLog:Security |
WinEventLog |
Integration | ✅ Passing | Dataset | WinEventLog:Security |
WinEventLog |
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: 4