Skip to content
SystemserviceEnabled by default

Windows Event ID 7045: A service was installed in the system

System event 7045 records every new service or driver: name, binary path, start type and account. A top lateral movement signal.

Overview

Event ID
7045
Log / channel
System
Provider
Service Control Manager
Category
service
Enabled by default
Yes
How to enable
Always logged to the System log when a service is installed.

What event 7045 logs

Event 7045 is written by the Service Control Manager when a new service is created — through sc create, New-Service, an installer, the CreateService API or remotely over the SCM RPC interface. Kernel drivers registered as services appear here too. Unlike Security 4697, it is logged by default, which makes it one of the most reliable persistence and lateral movement artifacts on Windows.

ImagePath is the field to read first. Legitimate services point to signed binaries under C:\Windows\System32 or C:\Program Files. Paths in C:\Windows\Temp, user profiles, C:\ProgramData or ADMIN$, and command lines such as cmd.exe /c ..., %COMSPEC% or powershell -enc ..., are strong indicators of remote execution tools and malware. Random 8-character or GUID-like service names are typical of Impacket, Metasploit and Cobalt Strike service-based execution.

Remote execution through the SCM (PsExec and its clones) leaves a 7045 on the target host, usually right after a type 3 logon (4624) from the source, then 7036 as the service starts and stops.

Fields

Every field recorded in event 7045, with the values that matter for investigation.

ServiceName

Display name of the new service. PSEXESVC, random letters or GUID-like names deserve attention.

ImagePath

Binary path or command line the service will run. Look for temp folders, user directories, cmd.exe /c, powershell, rundll32, mshta or UNC paths.

ServiceType

Type of service.

user mode service
Normal service running a user-mode executable.
kernel mode driver
Kernel driver. Unexpected drivers can be rootkits or vulnerable drivers loaded to kill security tools.
file system driver
File system or filter driver.
StartType

When the service starts.

auto start
Starts at every boot — persistence.
demand start
Manual start; typical of one-shot remote execution services.
disabled
Cannot be started until reconfigured.
boot start
Driver loaded by the boot loader.
system start
Driver loaded during kernel initialization.
AccountName

Account the service runs as, e.g. LocalSystem, NT AUTHORITY\LocalService or a domain account. Empty for drivers.

How to enable this event

Always logged to the System log when a service is installed.

Security 4697 carries similar data but requires Audit Security System Extension. A 7045 is only written at creation; changes to an existing service's binary path do not produce one.

Detection and investigation

Typically benign

  • Software installers and updates registering their services and drivers.
  • Endpoint agents, backup and remote support tools deployed by IT.
  • Hardware drivers installed when new devices are connected.
  • Legitimate PsExec use by administrators (service PSEXESVC).

Worth investigating

  • Remote execution with PsExec, Impacket psexec.py / smbexec.py, Metasploit or Cobalt Strike jump psexec: short-lived services with random names or cmd.exe /c in ImagePath.
  • Persistence via a new auto-start service pointing to a dropped payload.
  • Loading a vulnerable signed driver (BYOVD) to disable EDR, visible as a new kernel mode driver.

Investigation notes

  • Review every 7045 on the timeline; the volume is low enough to read them all.
  • Check ImagePath location, signature and hash; retrieve the binary if it still exists.
  • Correlate with 4624 type 3 and 5145 (ADMIN$ / IPC$ svcctl) just before on the same host to identify the source.
  • Follow with 7036 (running/stopped), 7009 or 7000 (start failures) to see whether it ran and for how long.

MITRE ATT&CK techniques

Related event IDs

References