Service registered with an image path in a user-writable directory
Anchors on the same Security 4697 service-creation record as the published T1569.002 rule, but on a different field pattern, which is what keeps the two from collapsing into one analytic. T1569.002 matches ServiceFileName being a shell, script host or UNC path — the signature of a tool that abuses the service mechanism to execute something once and move on. This rule matches MITRE's ImagePathFilter knob instead, populated here with a broader set of writable-directory paths than MITRE's own worked example: MITRE's mutableElements entry names only `C:\Users\` and `C:\Temp\` directly (the `\Temp\` term below is written to catch that literal path and, as a side effect, `\Windows\Temp\` too); the additional ServiceFileName terms for `\ProgramData\` and the recycle bin are this rule's own extension of that pattern to other locations that are user-writable but atypical for a service image path, regardless of what kind of binary it is — the signature of a service meant to persist, staged somewhere services do not normally live because the adversary has no Program Files-style install path to drop into. A legitimate-looking, correctly-signed executable registered this way still matches; a shell-launching service registered from a normal install path does not, and is exactly what T1569.002 is for instead. The command-line and driver-load legs of AN1527 (`sc.exe`/PowerShell invocation, `.sys` loads via `ZwLoadDriver`) are separate events this rule does not join to the creation record, and MITRE's UnsignedBinaryAlert and ServiceNamePattern knobs need signature status and a name baseline this log source does not carry. 4697 requires the Audit Security System Extension (Success) subcategory, which is off in a default install and in the MS and CIS baselines — without it this rule is blind, not quiet. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0552, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
title: Service registered with an image path in a user-writable directoryid: 559b945a-36fd-43d2-805c-ef532569d74bstatus: experimentaldescription: | Anchors on the same Security 4697 service-creation record as the published T1569.002 rule, but on a different field pattern, which is what keeps the two from collapsing into one analytic. T1569.002 matches ServiceFileName being a shell, script host or UNC path — the signature of a tool that abuses the service mechanism to execute something once and move on. This rule matches MITRE's ImagePathFilter knob instead, populated here with a broader set of writable-directory paths than MITRE's own worked example: MITRE's mutableElements entry names only `C:\Users\` and `C:\Temp\` directly (the `\Temp\` term below is written to catch that literal path and, as a side effect, `\Windows\Temp\` too); the additional ServiceFileName terms for `\ProgramData\` and the recycle bin are this rule's own extension of that pattern to other locations that are user-writable but atypical for a service image path, regardless of what kind of binary it is — the signature of a service meant to persist, staged somewhere services do not normally live because the adversary has no Program Files-style install path to drop into. A legitimate-looking, correctly-signed executable registered this way still matches; a shell-launching service registered from a normal install path does not, and is exactly what T1569.002 is for instead. The command-line and driver-load legs of AN1527 (`sc.exe`/PowerShell invocation, `.sys` loads via `ZwLoadDriver`) are separate events this rule does not join to the creation record, and MITRE's UnsignedBinaryAlert and ServiceNamePattern knobs need signature status and a name baseline this log source does not carry. 4697 requires the Audit Security System Extension (Success) subcategory, which is off in a default install and in the MS and CIS baselines — without it this rule is blind, not quiet. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0552, not hand-written and not tested by its author. Any lab result is on this rule's own page.references: - https://attack.mitre.org/techniques/T1543/003 - https://attack.mitre.org/detectionstrategies/DET0552author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags: - attack.persistence - attack.privilege-escalation - attack.t1543.003logsource: product: windows service: securitydetection: selection: EventID: 4697 ServiceFileName|contains: - '\Users\' - '\Temp\' - '\ProgramData\' - '\$Recycle.Bin\' condition: selectionfalsepositives: - "Consumer and line-of-business software that stages a background helper or update service under %ProgramData%\\<vendor>\\ instead of Program Files — printer and OEM utilities, cloud-sync backends and some security suites all do this by design, and it is likely the largest source of matches on a typical fleet." - "IT-run remote-support and diagnostic tools that register a temporary service pointing at a binary copied into a technician's profile or %TEMP% for the duration of a single session." - "Application self-updaters that stage the next version's executable under %ProgramData% during an upgrade and re-point the existing service at it before the old file is cleaned up." - "Endpoint-security or backup agents whose repair, quarantine or recovery component is deliberately installed from a %ProgramData% cache directory rather than the product's main install path."level: mediumSentinel · KQL
Run this as a search.
SecurityEvent| where (EventID == 4697 and (ServiceFileName contains "\\Users\\" or ServiceFileName contains "\\Temp\\" or ServiceFileName contains "\\ProgramData\\" or ServiceFileName contains "\\$Recycle.Bin\\"))
Splunk · SPL
Run this as a search.
index=* (EventID="4697" AND (ServiceFileName="*\\Users\\*" OR ServiceFileName="*\\Temp\\*" OR ServiceFileName="*\\ProgramData\\*" OR ServiceFileName="*\\$Recycle.Bin\\*"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE (event.code == 4697 AND (TO_LOWER(winlog.event_data.ServiceFileName) LIKE "*\\\\users\\\\*" OR TO_LOWER(winlog.event_data.ServiceFileName) LIKE "*\\\\temp\\\\*" OR TO_LOWER(winlog.event_data.ServiceFileName) LIKE "*\\\\programdata\\\\*" OR TO_LOWER(winlog.event_data.ServiceFileName) LIKE "*\\\\$recycle.bin\\\\*"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="7"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="EventID" type="pcre2">(?i)^4697$</field> <field name="ServiceFileName" type="pcre2">(?i)(\\Users\\|\\Temp\\|\\ProgramData\\|\\\$Recycle\.Bin\\)</field> <description>Service registered with an image path in a user-writable directory</description> <mitre> <id>T1543.003</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
Log in to join the discussion.
No comments yet. Someone who deploys this will have something to say about it.