Skip to content
SOC Analyst Role
  • Loading index…

↑↓ navigate · ↵ open · Esc close

en

Security · Persistence

4697 · A service was installed in the system

Event 4697 is logged in the Security log when a new service is installed, recording the service name, binary path, start type and account. It is the Security-log counterpart of System Event 7045 and is a key signal for PsExec-style remote execution, Cobalt Strike service-based lateral movement and service persistence. Because it is in the Security log, it can be harder for an attacker to clear selectively than the System log.

high prioritySecurity logPersistenceMITRE T1543.003

Where it is logged

Security log on the host where the service was created (the target of remote execution). Requires the Audit Security System Extension subcategory (System) for Success, which is not enabled by default, so many environments only have 7045 in the System log.

Key fields to read

FieldWhat it tells you
ServiceNameName of the new service; random 7–16 character names are typical of attack tools.
ServiceFileNameBinary path or command the service runs, the most important field to read.
ServiceTypee.g. 0x10 own process, 0x1 kernel driver.
ServiceStartType2 auto start (persistence), 3 demand start (typical of PsExec), 4 disabled.
ServiceAccountAccount the service runs as, usually LocalSystem.
SubjectUserNameAccount that installed the service, the pivot to the source of lateral movement.

Sample event

4697 — synthetic example
EventID: 4697
TimeCreated: 2026-03-14T02:24:35.441Z
Computer: NW-FS-02.northwind.local
SubjectUserName: adm.jlopez
SubjectDomainName: NORTHWIND
SubjectLogonId: 0x5B1C0A9
ServiceName: wXkQpLmz
ServiceFileName: %COMSPEC% /b /c start /b /min powershell -nop -w hidden -enc SQBFAFgA...
ServiceType: 0x10
ServiceStartType: 3
ServiceAccount: LocalSystem

How to triage it

  1. 1Read ServiceFileName: cmd /c, %COMSPEC%, powershell -enc, \\ADMIN$\ paths, Temp/ProgramData binaries and PSEXESVC.exe are high-signal.
  2. 2Pivot on SubjectLogonId to the 4624 on the same host to find the source IP and logon type (usually type 3 from another internal host).
  3. 3On the source host, look for 4648 explicit credentials and the tool that initiated the connection; on the target, check 5140/5145 for ADMIN$ and IPC$ (svcctl) access.
  4. 4Check prevalence: has this service name or binary been installed on other hosts in the last 24 hours? Fan-out means active lateral movement.
  5. 5Validate with change management or the software deployment team; escalate any unexplained service, and isolate if the binary is malicious.

Benign vs suspicious

Usually benign

  • Software installs and updates (browsers, drivers, AV/EDR agents) during patch windows.
  • Legitimate admin use of PsExec (PSEXESVC) by known IT staff from approved admin hosts.
  • Deployment tools such as SCCM or RMM agents creating their own services.

Red flags

  • Random-looking service names combined with cmd /c or encoded PowerShell in ServiceFileName.
  • Services pointing to binaries in C:\Windows\Temp, user profiles or UNC paths.
  • Installation by a user account outside the IT team, or from a workstation rather than a management server.
  • The same new service appearing on many hosts within minutes.
  • Kernel driver services (ServiceType 0x1) from unknown vendors, which can indicate vulnerable-driver abuse to kill EDR.

Hunt for it: Splunk & KQL

Splunk SPL
index=wineventlog EventCode=4697
| search Service_File_Name="*cmd*" OR Service_File_Name="*powershell*" OR Service_File_Name="*\\Temp\\*" OR Service_File_Name="*ADMIN$*"
| table _time, host, Account_Name, Service_Name, Service_File_Name, Service_Start_Type
Sentinel KQL
SecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4697
| where ServiceFileName has_any ("cmd", "powershell", "%COMSPEC%", "\\Temp\\", "ADMIN$", "-enc")
| project TimeGenerated, Computer, SubjectUserName, ServiceName, ServiceFileName, ServiceStartType, ServiceAccount

Field names depend on your add-on and table. More translations in the Splunk vs KQL cheat sheet.

Interview question

“What is the difference between Event 4697 and 7045, and which would you hunt with?”

✓ Strong answer sketch

Both record a new service install. 7045 is in the System log and is enabled by default, while 4697 is in the Security log and only appears if Audit Security System Extension is enabled, but it includes the subject account and logon ID that installed the service. I would hunt with whichever is collected, ideally both, focusing on ServiceFileName containing cmd /c, encoded PowerShell or temp paths. The subject logon ID in 4697 is the bonus, because it lets me jump straight to the 4624 and the source host of the lateral movement.

More SOC interview questions

Frequently asked questions

What does Event ID 4697 mean?

Event ID 4697 means a service was installed on the system, logged in the Security log. It records the service name, ServiceFileName, start type, service account and the account that installed it.

Why am I not seeing Event ID 4697?

4697 requires the Audit Security System Extension advanced audit subcategory, which is off by default. Without it, rely on System Event 7045, which is logged by the Service Control Manager regardless of audit policy.