Try in Splunk Security Cloud

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.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2024-05-17
  • Author: Mauricio Velazco, Splunk
  • ID: 6fa31414-546e-11ec-adfa-acde48001122

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1053.005 Scheduled Task Execution, Persistence, Privilege Escalation
Kill Chain Phase
  • Installation
  • Exploitation
NIST
  • DE.CM
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
7
8
 `wineventlog_security` EventCode=4698 OR EventCode=4699 
| xmlkv Message 
| transaction Task_Name  startswith=(EventCode=4698) endswith=(EventCode=4699) 
| eval short_lived=case((duration<30),"TRUE") 
| search  short_lived = TRUE 
| rename ComputerName as dest
| table _time, dest, Account_Name, Command, Task_Name, short_lived 
| `short_lived_scheduled_task_filter`

Macros

The SPL above uses the following Macros:

:information_source: short_lived_scheduled_task_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • dest
  • ComputerName
  • Account_Name
  • Task_Name
  • Description
  • Command

How To Implement

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

RBA

Risk Score Impact Confidence Message
81.0 90 90 A windows scheduled task was created and deleted in 30 seconds on $dest$

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Reference

Test Dataset

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 | version: 2