Windows Event ID 4697: A service was installed in the system
Written when a new service is installed on the system. Because services run with SYSTEM privileges and survive reboots, they are heavily used for persistence and lateral movement, making this a cornerstone detection event.
Overview
The subcategory is Audit Security System Extension. It is generated when a new service is registered, recording the service name (ServiceName), the executable path (ServiceFileName), and the registering account. Because a service resides with high privilege and can auto-run at startup, it is an attractive foothold for attackers.
How it is triggered
- Service registration via
sc.exe, the Service Control Manager API, PsExec, and so on. - PsExec creates a temporary service (such as
PSEXESVC) for remote execution, so 4697 is left behind during lateral movement too. - It also corresponds to System log Event ID 7045 (a new service).
Security review points
- It maps to MITRE ATT&CK
T1543.003 (Windows Service: creating or modifying services for persistence or privilege escalation). Strongly suspect it ifServiceFileNamecontainspowershell/cmd, a temp-folder or admin-share path, or encoded arguments. - Watch also for masquerading that mimics a legitimate service name (
T1036.004). Check the consistency of service name and executable path (whether a known service points to an unexpected path). - Remote service creation (the PsExec pattern) is a hallmark of lateral movement. Evaluate it together with the creating subject and source.
Notes for log review
- Service installation also happens in legitimate operation (installers, updates). Narrow down suspicious binaries and scripts by the path and arguments in
ServiceFileName. - A technique that writes directly to the registry
HKLM\SYSTEM\CurrentControlSet\Servicesmay, depending on configuration, not produce a 4697. Supplement it in layers with registry auditing 4657, Sysmon, and Event ID 7045.
MITRE ATT&CK mapping
| Technique | Tactic | What this event shows |
|---|---|---|
| T1543.003 Windows Service | Persistence, Privilege Escalation | Services created with ServiceFileName pointing to powershell / cmd / temp folders or admin shares |
| T1569.002 Service Execution | Execution | Remote service creation and execution, PsExec style |
| T1036.004 Masquerade Task or Service | Stealth | Names mimicking legitimate services with unexpected executable paths |
Mapping as of ATT&CK v19.2. ATT&CK detection strategies DET0552 (T1543.003), DET0421 (T1569.002) also list this event ID as a log source. To search by technique, see the ATT&CK reverse lookup.
Detection rules
SigmaHQ has 22 and Microsoft Sentinel has 1 public detection rules that use this event ID as a condition. General-purpose rules come first, ordered by severity; rules beyond the first 10 are collapsed.
Other rules (13)
| Rule | Type | Severity |
|---|---|---|
| Invoke-Obfuscation Via Use MSHTA - Security | Sigma | High |
| Invoke-Obfuscation Via Use Rundll32 - Security | Sigma | High |
| Metasploit Or Impacket Service Installation Via SMB PsExec | Sigma | High |
| Meterpreter or Cobalt Strike Getsystem Service Installation - Security | Sigma | High |
| PowerShell Scripts Installed as Services - Security | Sigma | High |
| Service Installed By Unusual Client - Security | Sigma | High |
| Gain Code Execution on ADFS Server via SMB + Remote Service or Scheduled Task | Sentinel analytics rule | Medium |
| Invoke-Obfuscation COMPRESS OBFUSCATION - Security | Sigma | Medium |
| Invoke-Obfuscation RUNDLL LAUNCHER - Security | Sigma | Medium |
| Remote Access Tool Services Have Been Installed - Security | Sigma | Medium |
| Windows Pcap Drivers | Sigma | Medium |
| Tap Driver Installation - Security | Sigma | Low |
| CosmicDuke Service Installation | Sigma (threat-specific) | Critical |
Rules are collected from SigmaHQ r2026-07-01 and from Azure-Sentinel as of 2026-10-09, limited to those whose conditions include this event ID. Sentinel rules are limited to those that query the SecurityEvent or WindowsEvent table. “Threat-specific” rules target a particular threat group or malware, and “needs setup” rules require values for your environment. Severity is the value each rule’s author assigned.
Key fields
| Field | Meaning |
|---|---|
Service Name | The registered service name |
Service File Name | The executable path and arguments; the most important focus |
Service Type / Service Start Type | The service type and start type (whether auto-start) |
Subject\Account Name | The account that performed the registration |
Glossary
- Persistence — techniques that keep an attacker’s code running across reboots and logoffs. Service registration is a prime example.