Windows Service Installation via Scripted ImagePath Indicators (Event 7045)

Identifies suspicious Windows service installations that embed script host execution via Event ID 7045 ImagePath patterns.

FreeReviewedSigma · High · v2
Product
windows
Service
system
Author
pH-T (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2022-03-18
Updated
2026-07-31
title: Windows Service Installation via Scripted ImagePath Indicators (Event 7045)
id: 14915478-da3c-4a01-ba8f-6e284985de38
status: test
description: This rule flags Windows service creation events (Service Control Manager, EventID 7045) where the service ImagePath contains specific command-line flags and script or scripting host binaries. Attackers often abuse service installation for persistence and privilege escalation by registering a service that executes scripts or scriptable interpreters. The detection relies on Windows service installation telemetry that records the Provider_Name and the ImagePath content from Event 7045.
references:
  - Internal Research
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/system/service_control_manager/win_system_susp_service_installation_script.yml
author: pH-T (Nextron Systems), Huntrule Team
date: 2022-03-18
modified: 2024-03-05
tags:
  - attack.persistence
  - attack.privilege-escalation
  - car.2013-09-005
  - attack.t1543.003
logsource:
  product: windows
  service: system
detection:
  selection_eid:
    Provider_Name: Service Control Manager
    EventID: 7045
  selection_cmd_flags:
    ImagePath|contains|windash:
      - " -c "
      - " -r "
      - " -k "
  selection_binaries:
    ImagePath|contains:
      - cscript
      - mshta
      - powershell
      - pwsh
      - regsvr32
      - rundll32
      - wscript
  condition: all of selection_*
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 70f00d10-60b2-4f34-b9a0-dc3df3fe762a
    type: derived