Randomly Generated Scheduled Task Name

Original Source: [splunk source]
Name:Randomly Generated Scheduled Task Name
id:9d22a780-5165-11ec-ad4f-3e22fbd008af
version:4
date:2024-10-17
author:Mauricio Velazco, Splunk
status:experimental
type:Hunting
Description:The following analytic detects the creation of a Scheduled Task with a high entropy, randomly generated name, leveraging Event ID 4698. It uses the `ut_shannon` function from the URL ToolBox Splunk application to measure the entropy of the Task Name. This activity is significant as adversaries often use randomly named Scheduled Tasks for lateral movement and remote code execution, employing tools like Impacket or CrackMapExec. If confirmed malicious, this could allow attackers to execute arbitrary code remotely, potentially leading to further compromise and persistence within the network.
Data_source:
  • -Windows Event Log Security 4698
search:`wineventlog_security` EventCode=4698
| xmlkv Message
| lookup ut_shannon_lookup word as Task_Name
| where ut_shannon > 3
| table _time, dest, Task_Name, ut_shannon, Command, Author, Enabled, Hidden
| `randomly_generated_scheduled_task_name_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 as well as the URL ToolBox application are also required.
known_false_positives:Legitimate applications may use random Scheduled Task names.
References:
  -https://attack.mitre.org/techniques/T1053/005/
  -https://splunkbase.splunk.com/app/2734/
  -https://en.wikipedia.org/wiki/Entropy_(information_theory)
drilldown_searches:
  :
tags:
  analytic_story:
    - 'Active Directory Lateral Movement'
    - 'CISA AA22-257A'
    - 'Scheduled Tasks'
  asset_type:Endpoint
  confidence:50
  impact:90
  message:A windows scheduled task with a suspicious task name was created on $dest$
  mitre_attack_id:
    - 'T1053'
    - 'T1053.005'
  observable:
    name:'dest'
    type:'Endpoint'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'dest'
    - 'Task_Name'
    - 'Description'
    - 'Command'
  risk_score:45
  security_domain:endpoint

tests:
  :
manual_test:None