WinEvent Scheduled Task Created Within Public Path
Description
The following analytic detects the creation of scheduled tasks within user-writable paths using Windows Security EventCode 4698. It identifies tasks registered via schtasks.exe or TaskService that execute commands from directories like Public, ProgramData, Temp, and AppData. This behavior is significant as it may indicate an attempt to establish persistence or execute unauthorized commands. If confirmed malicious, an attacker could maintain long-term access, escalate privileges, or execute arbitrary code, posing a severe threat to system integrity and security.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-16
- Author: Michael Haag, Splunk
- ID: 5d9c6eee-988c-11eb-8253-acde48001122
Annotations
ATT&CK
Kill Chain Phase
- Installation
- Exploitation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
5
6
`wineventlog_security` EventCode=4698 TaskContent IN ("*\\users\\public\\*", "*\\programdata\\*", "*\\temp\\*", "*\\Windows\\Tasks\\*", "*\\appdata\\*", "*\\perflogs\\*")
| stats count min(_time) as firstTime max(_time) as lastTime by Computer, TaskName, TaskContent
| rename Computer as dest
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `winevent_scheduled_task_created_within_public_path_filter`
Macros
The SPL above uses the following Macros:
winevent_scheduled_task_created_within_public_path_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
- 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
False positives are possible if legitimate applications are allowed to register tasks in public paths. Filter as needed based on paths that are used legitimately.
Associated Analytic Story
- Industroyer2
- Ryuk Ransomware
- Scheduled Tasks
- AsyncRAT
- Winter Vivern
- Ransomware
- Windows Persistence Techniques
- Active Directory Lateral Movement
- Prestige Ransomware
- IcedID
- Data Destruction
- CISA AA23-347A
- CISA AA22-257A
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
70.0 | 70 | 100 | A windows scheduled task was created (task name=$TaskName$) on $dest$ |
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
- https://research.checkpoint.com/2021/irans-apt34-returns-with-an-updated-arsenal/
- https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4698
- https://redcanary.com/threat-detection-report/techniques/scheduled-task-job/
- https://docs.microsoft.com/en-us/windows/win32/taskschd/time-trigger-example–scripting-?redirectedfrom=MSDN
- https://app.any.run/tasks/e26f1b2e-befa-483b-91d2-e18636e2faf3/
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: 4