Windows Service Control Manager flags smbexec.py-style service installation via suspicious ImagePath
Flags suspicious Windows service installations matching a specific service name and BAT/delete command patterns in Event 7045.
- Product
- windows
- Service
- system
- Author
- Omer Faruk Celik (SigmaHQ), DRL 1.1
- Published
- 2018-03-20
- Updated
- 2026-07-31
ATT&CK techniques
Execution → Lateral MovementRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule catches Windows service creation events (EventID 7045) where the Service Control Manager reports a specific service name and ImagePath patterns consistent with smbexec.py-style execution chains. Attackers can leverage this technique to run remote code via a temporary or misleading Windows service, blending execution into normal service installation telemetry. It relies on Windows System logs capturing Service Control Manager provider events, including Provider_Name, EventID, ServiceName, and ImagePath contents.
Reporting behind it
- blog.ropnop.comhttps://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/
- github.comhttps://github.com/fortra/impacket/blob/33058eb2fde6976ea62e04bc7d6b629d64d44712/examples/smbexec.py#L286-L296
- github.comhttps://github.com/fortra/impacket/blob/edef71f17bc1240f9f8c957bbda98662951ac3ec/examples/smbexec.py#L60
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/system/service_control_manager/win_system_hack_smbexec.yml
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows Service Control Manager flags smbexec.py-style service installation via suspicious ImagePath
id: 111a47ef-90c3-41d3-aabc-c5ee98847729
status: test
description: This rule catches Windows service creation events (EventID 7045) where the Service Control Manager reports a specific service name and ImagePath patterns consistent with smbexec.py-style execution chains. Attackers can leverage this technique to run remote code via a temporary or misleading Windows service, blending execution into normal service installation telemetry. It relies on Windows System logs capturing Service Control Manager provider events, including Provider_Name, EventID, ServiceName, and ImagePath contents.
references:
- https://blog.ropnop.com/using-credentials-to-own-windows-boxes-part-2-psexec-and-services/
- https://github.com/fortra/impacket/blob/33058eb2fde6976ea62e04bc7d6b629d64d44712/examples/smbexec.py#L286-L296
- https://github.com/fortra/impacket/blob/edef71f17bc1240f9f8c957bbda98662951ac3ec/examples/smbexec.py#L60
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/system/service_control_manager/win_system_hack_smbexec.yml
author: Omer Faruk Celik, Huntrule Team
date: 2018-03-20
modified: 2023-11-09
tags:
- attack.lateral-movement
- attack.execution
- attack.t1021.002
- attack.t1569.002
logsource:
product: windows
service: system
detection:
selection_eid:
Provider_Name: Service Control Manager
EventID: 7045
selection_service_name:
ServiceName: BTOBTO
selection_service_image:
ImagePath|contains:
- ".bat & del "
- __output 2^>^&1 >
condition: selection_eid and 1 of selection_service_*
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 52a85084-6989-40c3-8f32-091e12e13f09
type: derived