Detection rules › Splunk

Short Lived Scheduled Task

Status
production
Severity
low
Group by
Command, RunLevel, dest, task_name, user
Author
Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

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 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.

Known false positives

  • Although uncommon, legitimate applications may create and delete a Scheduled Task within 30 seconds. Filter as needed.

MITRE ATT&CK coverage

Telemetry coverage

Rule body

name: Short Lived Scheduled Task
id: 6fa31414-546e-11ec-adfa-acde48001122
version: 12
creation_date: '2021-12-03'
modification_date: '2026-07-07'
author: Mauricio Velazco, Splunk
status: production
type: Anomaly
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 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.
data_source:
    - Windows Event Log Security 4698
    - Windows Event Log Security 4699
search: |-
    `wineventlog_security`
    EventCode IN (4698, 4699)
    | xmlkv object_attrs
    | transaction TaskName dest startswith=(EventCode=4698) endswith=(EventCode=4699) maxspan=30s
    | stats count min(_time) AS firstTime
                  max(_time) AS lastTime
        by Command TaskName user dest RunLevel
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | `short_lived_scheduled_task_filter`
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.
references:
    - https://attack.mitre.org/techniques/T1053/005/
    - https://docs.microsoft.com/en-us/windows/win32/taskschd/about-the-task-scheduler
intermediate_findings:
    entities:
        - field: dest
          type: system
          score: 20
          message: A windows scheduled task [$TaskName$] with the command [$Command$] was created by [$user$] and deleted in less than 30 seconds on [$dest$]
analytic_story:
    - Active Directory Lateral Movement
    - CISA AA22-257A
    - CISA AA23-347A
    - Compromised Windows Host
    - Scheduled Tasks
asset_type: Endpoint
mitre_attack_id:
    - T1053.005
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`wineventlog_security`
EventCode IN (4698, 4699)

Stage 2: xmlkv

| xmlkv object_attrs

Stage 3: transaction

| transaction TaskName dest startswith=(EventCode=4698) endswith=(EventCode=4699) maxspan=30s

Stage 4: stats

| stats count min(_time) AS firstTime
              max(_time) AS lastTime
    by Command TaskName user dest RunLevel

Stage 5: search

| `security_content_ctime(firstTime)`

Stage 6: search

| `security_content_ctime(lastTime)`

Stage 7: search

| `short_lived_scheduled_task_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodein
  • 4698 corpus 13 (splunk 13)
  • 4699
field:"EventID" kind:in