New service installed in SCM database. ServiceName, ServiceFileName, ServiceType, ServiceStartType, ServiceAccount are key.
Service persistence (T1543.003). PsExec installs a service on the remote host. Ransomware installs as a service. Key indicators: ServiceFileName in temp/user paths. ServiceAccount=LocalSystem for a user-installed service.
Alert: ServiceFileName in %TEMP%, %APPDATA%, C:\Users\, or UNC paths. Alert: service installed by non-SYSTEM. Correlate with System log 7045 which also captures service installs.
ServiceNameServiceFileNameServiceTypeServiceStartType | Tactic | Technique |
|---|---|
| Persistence | Windows Service (T1543.003) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
title: Suspicious Service Installation
status: stable
description: Service installed from suspicious path
author: theadminstack.com
date: 2026/05/16
logsource:
product: windows
service: security
detection:
selection:
EventID: 4697
filter_legit:
ServiceFileName|startswith:
- 'C:\\Windows\\'
- 'C:\\Program Files\\'
- 'C:\\Program Files (x86)\\'
condition: selection and not filter_legit
falsepositives:
- Software installers
- IT management agents
level: high
tags:
- attack.persistence
- attack.t1543.003
SecurityEvent
| where EventID == 4697 // A service was installed in the system
| project TimeGenerated, Computer, ServiceName, ServiceFileName, ServiceType, ServiceStartType
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4697
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# A service was installed in the system — add EventData fields: ServiceName, ServiceFileName, ServiceType, ServiceStartType`
A service was installed in the system. New service installed in SCM database. ServiceName, ServiceFileName, ServiceType, ServiceStartType, ServiceAccount are key.
Event 4697 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'System Security' subcategory (Success and/or Failure).
Event 4697 is associated with: Windows Service (T1543.003).
Alert: ServiceFileName in %TEMP%, %APPDATA%, C:\Users\, or UNC paths. Alert: service installed by non-SYSTEM. Correlate with System log 7045 which also captures service installs.