Written by Ruben Selby, founder and penetration tester at Wolfcore. Last reviewed 20 November 2026.
In one sentence: Event 4697 is the Windows log entry that says a new background program, called a service, was set up on a computer, and an unexpected one is a classic sign that an attacker is making their access permanent.
What it is
A Windows service is a program that starts with the computer and runs in the background, often with high privileges. Event 4697 is written to the Security log when a new service is installed. Microsoft’s documentation places it under the audit subcategory “Audit Security System Extension” and says it is available from Windows Server 2016 and Windows 10.
Do not confuse it with Event 7045. Event 7045 is written by the Service Control Manager to the System log, and is covered in the 7045 entry. 4697 is the Security log version, so it only appears if you have turned that audit setting on. Having both gives you two independent records.
How it works
- Something registers a new service, for example an installer, an IT tool, or an attacker using a built-in command.
- If “Audit Security System Extension” is enabled for Success, Windows writes 4697.
- The event records who did it (Subject account and logon ID), the service name, the file the service runs, the service type, the start type and the account the service runs as.
Microsoft’s own example shows the service file name, type 0x20, start type 2 and account localSystem for a normal Windows service.
Why attackers use it
MITRE ATT&CK technique T1543.003 describes attackers creating or modifying Windows services to run malicious payloads repeatedly, which gives persistence, meaning the access survives a reboot. ATT&CK says service settings can be set with system tools such as sc.exe, by editing the Registry, or through the Windows API. It also notes services can be used to load malicious drivers. A service often runs as SYSTEM, the most powerful local account.
Who it affects and how badly
- Sole trader to 10 staff: you rarely have the audit setting on, so the event never exists. Worst case, an attacker’s persistence goes unnoticed.
- 10 to 50 staff, accountancy, legal and MSPs: a rogue service on a file server or an MSP remote tool server can survive clean-up if you only remove the first foothold.
- 50 to 250 staff, manufacturing, healthcare, councils: servers with long uptime are where persistence hides. Worst case is repeat compromise and extended downtime.
- Regulated firms (fintech, insurance): auditors and regulators expect logs that show unauthorised change to systems, in the UK, EU and US.
What we check on a test
- Whether service installation auditing is enabled on servers and workstations we can reach.
- Whether ordinary users or a low-privilege service account can install or change services (a privilege escalation path).
- Whether unquoted service paths or writable service folders exist.
- Whether logs are sent off the machine, so an attacker cannot just delete them (see Event 1102).
How to detect it
Microsoft recommends monitoring this event, especially on high value assets, because new service installs should be planned and expected. Its specific suggestions are to alert on:
- A Service File Name outside
%windir%or Program Files folders. - Service Type 0x1, 0x2 or 0x8, which are very rarely installed.
- Service Start Type 0 or 1 (used by drivers) or 4 (disabled).
- A Service Account other than localSystem, localService or networkService.
Compare the time with change tickets and software deployments. Match the Subject Logon ID to Event 4624 to see how the person logged on.
How to fix or prevent it
- Enable “Audit Security System Extension” (Success) in Advanced Audit Policy on servers and domain-joined PCs.
- Forward Security and System logs to a central place that administrators cannot easily edit.
- Alert on the Microsoft conditions above, starting with file paths outside Windows and Program Files.
- Remove local administrator rights from everyday accounts, because installing a service needs high rights.
- Use application control, such as Windows Defender Application Control or AppLocker, so unknown executables cannot run as services.
- Keep a record of approved services and review exceptions monthly.
Attackers often get onto a machine through a phishing email first. You can test how your staff handle one with Phishy phishing simulation software, and begin with the free trial.
Attackers also use scheduled tasks to persist: see the Event ID 4698 entry. The System log twin of this event is covered in windows event id 7045 service installed.
Illustration: worked example
A 25-person accountancy firm has one server. An employee’s laptop is compromised, and the attacker reaches the server with a reused admin password. They install a service that starts their remote access tool. The firm only audits logons, so nothing alerts. A month later the tool is still there. With 4697 on and a rule for file paths outside Program Files, the install is flagged the same day.
FAQ
Which log holds Event 4697? The Security log, per Microsoft’s documentation.
Is it the same as Event 7045? No. 7045 comes from the Service Control Manager in the System log, while 4697 needs the audit subcategory enabled.
Does every 4697 mean an attack? No. Microsoft says installs should be planned and expected, so the check is whether it was planned.
Related terms
windows event id 7045 service installed, windows event id 4688 process creation, windows event id 4672 special privileges assigned, windows event id 4720 user account created, indicators of compromise, how privilege escalation works
More in the Detection and response hub.
Sources opened for this entry
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4697
- https://attack.mitre.org/techniques/T1543/003/
See also: Event ID 5140 and 5145: Network Share Access Explained.
How Wolfcore helps
Wolfcore’s vulnerability management and SOC monitoring keep watch for this after the test is over. See SOC and SIEM monitoring
Wolfcore
Would your staff click a phishing email?
Run a real, safe phishing test on your team with Phishy. Free for 14 days, up to 10 staff, no card. We help you set it up.
Start a free phishing testFree website security scanor book a 30 minute call