EVENT 7045
EVENT 4697
IMAGEPATH
SC.EXE
DetectionBlue TeamSOCOctober 12, 2026•9 min read

Detecting Remote Service Creation and Suspicious ImagePaths

The Service Control Manager records the full binary path of every new service. Few legitimate services point it at a shell.

Scroll

Creating a service on a remote host is the shared mechanism beneath PsExec, smbexec, Cobalt Strike’s psexec and ransomware deployers. Rather than hunting each tool, treat the install event as the object: score the ImagePath, rank rare service names and attribute the install to a source through the logon that created it.

Signals at a Glance

SignalWhereATT&CK
ImagePath invoking cmd.exe, powershell.exe, rundll32, mshta or scripting enginesEvent 7045 / 4697T1543.003
ImagePath in a user-writable or temp path, or an ADMIN$ UNC pathEvent 7045 / 4697T1569.002
Service name that is random, very short, or never seen in the fleetEvent 7045, baselineT1543.003
sc.exe create with a remote target or sc \\host in the command lineSysmon 1, Event 4688T1543.003
Service registry key written by a remote session (ImagePath value)Sysmon 13T1112

Scoring the ImagePath

No single string identifies a malicious service, so score several properties of the ImagePath and alert above a threshold. Encoded PowerShell, a shell with a command switch, a user-writable directory, an unquoted path with spaces and no file extension each add weight. A Sigma rule captures the high-fidelity core:

title: Service Installed With Interpreter or Encoded Command ImagePath
logsource:
  product: windows
  service: system
detection:
  base:
    Provider_Name: 'Service Control Manager'
    EventID: 7045
  interpreter:
    ImagePath|contains:
      - 'cmd.exe /c'
      - 'cmd /c'
      - '%COMSPEC%'
      - 'powershell'
      - 'pwsh'
      - 'mshta'
      - 'rundll32'
  encoded:
    ImagePath|contains:
      - ' -enc'
      - ' -EncodedCommand'
      - 'FromBase64String'
  writable:
    ImagePath|contains:
      - '\AppData\'
      - '\Temp\'
      - '\ProgramData\'
      - '\Users\Public\'
  condition: base and (interpreter or encoded or writable)
level: high
# tune/validate: add exclusions for installers that register services from ProgramData.

Rarity is the second axis. A service name seen on one host in thirty days is more interesting than one seen on hundreds. A fleet-wide count surfaces both random names and one-off tooling:

index=wineventlog (EventCode=7045 OR EventCode=4697)
| eval svc=coalesce(Service_Name, ServiceName), path=coalesce(Service_File_Name, ServiceFileName)
| stats dc(host) as hosts_seen count min(_time) as first values(path) as paths by svc
| where hosts_seen = 1 AND first > relative_time(now(), "-1d")
| eval name_len=len(svc)
| where name_len <= 8 OR match(svc, "^[A-Za-z]{8,16}$")
| sort - first
# tune/validate: field names differ between add-ons; confirm which event populates Service_File_Name.

Attributing the Source

Vetted sources

Use the SigmaHQ service-creation and suspicious ImagePath rules, Elastic and Splunk ESCU new-service content and MITRE CAR analytics for service creation. Atomic Red Team includes service-creation tests, and the Sysmon configurations from SwiftOnSecurity and Olaf Hartong log related registry changes. Baseline your own environment: endpoint agents, drivers and installers create services constantly.

Build Detections That Fire

Mjolnir Security helps blue teams turn threat intelligence into high-fidelity detections across endpoint, network, identity and cloud telemetry.

Detection EngineeringManaged Detection & ResponseThreat HuntingIncident ResponsePurple Teaming
  • Detection Engineering We build and tune detections mapped to ATT&CK from your own telemetry.
  • Threat Hunting as a Service Hypothesis-driven hunts for the behaviours on this page.
  • 24/7 Incident Response Containment when a detection fires. Call +1 833 403 5875.
Written by: Mjolnir Threat Research (MTAC)  |  Published: October 12, 2026  |  Last reviewed: October 12, 2026