Detection rules › Splunk
Windows Event For Service Disabled
The following analytic detects when a Windows service is modified from a start type to disabled. It leverages system event logs, specifically EventCode 7040, to identify this change. This activity is significant because adversaries often disable security or other critical services to evade detection and maintain control over a compromised host. If confirmed malicious, this action could allow attackers to bypass security defenses, leading to further exploitation and persistence within the environment.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Defense Impairment | T1685 Disable or Modify Tools |
Event coverage
| Provider | Event |
|---|---|
| Service-Control-Manager | Event ID 7040 |
Rule body splunk
name: Windows Event For Service Disabled
id: 9c2620a8-94a1-11ec-b40c-acde48001122
version: 11
creation_date: '2022-02-23'
modification_date: '2026-05-13'
author: Teoderick Contreras, Splunk
status: production
type: Hunting
description: The following analytic detects when a Windows service is modified from a start type to disabled. It leverages system event logs, specifically EventCode 7040, to identify this change. This activity is significant because adversaries often disable security or other critical services to evade detection and maintain control over a compromised host. If confirmed malicious, this action could allow attackers to bypass security defenses, leading to further exploitation and persistence within the environment.
data_source:
- Windows Event Log System 7040
search: |-
`wineventlog_system` EventCode=7040 EventData_Xml="*disabled*"
| stats count min(_time) as firstTime max(_time) as lastTime
BY Computer EventCode Name
UserID service ServiceName
| rename Computer as dest
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `windows_event_for_service_disabled_filter`
how_to_implement: To successfully implement this search, you need to be ingesting logs with the Service name, Service File Name Service Start type, and Service Type from your endpoints.
known_false_positives: Windows service update may cause this event. In that scenario, filtering is needed.
references:
- https://blog.talosintelligence.com/2018/02/olympic-destroyer.html
analytic_story:
- Windows Defense Evasion Tactics
- RedLine Stealer
asset_type: Endpoint
mitre_attack_id:
- T1685
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
tests:
- name: True Positive Test
attack_data:
- data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.001/windows_excessive_disabled_services_event/windows-xml.log
source: XmlWinEventLog:System
sourcetype: XmlWinEventLog
test_type: unit
Stages and Predicates
Stage 1: search
`wineventlog_system` EventCode=7040 EventData_Xml="*disabled*"
Stage 2: stats
| stats count min(_time) as firstTime max(_time) as lastTime
BY Computer EventCode Name
UserID service ServiceName
Stage 3: rename
| rename Computer as dest
Stage 4: search
| `security_content_ctime(firstTime)`
Stage 5: search
| `security_content_ctime(lastTime)`
Stage 6: search
| `windows_event_for_service_disabled_filter`
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
EventData_Xml | eq |
|