Detection: Randomly Generated Scheduled Task Name

EXPERIMENTAL DETECTION

This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.

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.

1`wineventlog_security` EventCode=4698 
2| xmlkv Message 
3| lookup ut_shannon_lookup word as Task_Name 
4| where ut_shannon > 3 
5| table  _time, dest, Task_Name, ut_shannon, Command, Author, Enabled, Hidden 
6| `randomly_generated_scheduled_task_name_filter`

Data Source

Name Platform Sourcetype Source Supported App
Windows Event Log Security 4698 Windows icon Windows 'xmlwineventlog' 'XmlWinEventLog:Security' N/A

Macros Used

Name Value
wineventlog_security eventtype=wineventlog_security OR Channel=security OR source=XmlWinEventLog:Security
randomly_generated_scheduled_task_name_filter search *
randomly_generated_scheduled_task_name_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 Scheduled Task/Job Execution
T1053.005 Scheduled Task Persistence
KillChainPhase.EXPLOITAITON
KillChainPhase.INSTALLATION
NistCategory.DE_AE
Cis18Value.CIS_10
Earth Lusca
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

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.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
A windows scheduled task with a suspicious task name was created on $dest$ 45 90 50
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 Not Applicable N/A N/A N/A
Unit ❌ Failing N/A N/A N/A
Integration ❌ Failing N/A N/A N/A

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