Detection rules › Splunk
Windows Service Created with Suspicious Service Path
The following analytic detects the creation of a Windows Service with a binary path located in uncommon directories, using Windows Event ID 7045. It leverages logs from the wineventlog_system to identify services installed outside typical system directories. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.
Known false positives
- Legitimate applications may install services with uncommon services paths.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Service-Control-Manager | Event ID 7045: A service was installed in the system. |
Rule body
name: Windows Service Created with Suspicious Service Path
id: 429141be-8311-11eb-adb6-acde48001122
version: 20
creation_date: '2022-08-26'
modification_date: '2026-05-13'
author: Teoderick Contreras, Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects the creation of a Windows Service with a binary path located in uncommon directories, using Windows Event ID 7045. It leverages logs from the `wineventlog_system` to identify services installed outside typical system directories. This activity is significant as adversaries, including those deploying Clop ransomware, often create malicious services for lateral movement, remote code execution, persistence, and execution. If confirmed malicious, this could allow attackers to maintain persistence, execute arbitrary code, and potentially escalate privileges, posing a severe threat to the environment.
data_source:
- Windows Event Log System 7045
search: '`wineventlog_system` EventCode=7045 ImagePath = "*.exe" NOT (ImagePath IN ("*:\\Windows\\*", "*:\\Program File*", "*:\\Programdata\\*", "*%systemroot%\\*")) | stats count min(_time) as firstTime max(_time) as lastTime by EventCode ImagePath ServiceName ServiceType StartType Computer UserID | rename Computer as dest| `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_service_created_with_suspicious_service_path_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: Legitimate applications may install services with uncommon services paths.
references:
- https://www.mandiant.com/resources/fin11-email-campaigns-precursor-for-ransomware-data-theft
- https://blog.virustotal.com/2020/11/keep-your-friends-close-keep-ransomware.html
finding:
title: A service $ImagePath$ was created from a non-standard path using $ServiceName$ on $dest$
entity:
field: dest
type: system
score: 50
threat_objects:
- field: ImagePath
type: service
analytic_story:
- PlugX
- Qakbot
- China-Nexus Threat Activity
- CISA AA23-347A
- Flax Typhoon
- Derusbi
- Salt Typhoon
- Active Directory Lateral Movement
- Snake Malware
- Clop Ransomware
- Crypto Stealer
- Brute Ratel C4
- APT37 Rustonotto and FadeStealer
- Gh0st RAT
asset_type: Endpoint
mitre_attack_id:
- T1569.002
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
Stages and Predicates
Stage 1: search
`wineventlog_system` EventCode=7045 ImagePath = "*.exe" NOT (ImagePath IN ("*:\\Windows\\*", "*:\\Program File*", "*:\\Programdata\\*", "*%systemroot%\\*"))
Stage 2: stats
| stats count min(_time) as firstTime max(_time) as lastTime by EventCode ImagePath ServiceName ServiceType StartType Computer UserID
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_service_created_with_suspicious_service_path_filter`
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
ImagePath | in | "*%systemroot%\\*", "*:\\Program File*", "*:\\Programdata\\*", "*:\\Windows\\*" | excludes:ImagePath |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"7045" |
ImagePath | eq |
| field:"ImagePath" kind:eq |