Windows Registry Delete Task SD
Description
The following analytic detects a process attempting to delete a scheduled task's Security Descriptor (SD) from the registry path of that task. It leverages the Endpoint.Registry data model to identify registry actions performed by the SYSTEM user, specifically targeting deletions of the SD value. This activity is significant as it may indicate an attempt to remove evidence of a scheduled task for defense evasion. If confirmed malicious, it suggests an attacker with privileged access trying to hide their tracks, potentially compromising system integrity and security.
Query · spl
| tstats `security_content_summariesonly`
count min(_time) as firstTime
max(_time) as lastTime
FROM datamodel=Endpoint.Registry where
Registry.registry_path IN ("*\\Schedule\\TaskCache\\Tree\\*")
Registry.user="SYSTEM"
(
Registry.registry_value_name="SD"
OR
Registry.registry_key_name="SD"
)
Registry.action=deleted
by Registry.action Registry.dest Registry.process_guid
Registry.process_id Registry.registry_hive
Registry.registry_path Registry.registry_key_name
Registry.registry_value_data Registry.registry_value_name
Registry.registry_value_type Registry.status Registry.user
Registry.vendor_product
| `drop_dm_object_name(Registry)`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_registry_delete_task_sd_filter`
Implementation guide
To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the Endpoint datamodel in the Registry node. In addition, confirm the latest CIM App 4.20 or higher is installed and the latest TA for the endpoint product.
Known false positives
- False positives should be limited as the activity is not common to delete ONLY the SD from the registry.
Analyst notes
Known false positives: False positives should be limited as the activity is not common to delete ONLY the SD from the registry.