Detection rules › Sigma

Service Binary in Suspicious Folder

Status
test
Severity
high
Log source
product windows, category registry_set
Author
Florian Roth (Nextron Systems), frack113
Source
github.com/SigmaHQ/sigma

Detect the creation of a service with a service binary located in a suspicious directory

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1112 Modify Registry
Defense ImpairmentT1112 Modify Registry

Event coverage

ProviderEventTitle
SysmonEvent ID 13RegistryEvent (Value Set)

Rule body yaml

title: Service Binary in Suspicious Folder
id: a07f0359-4c90-4dc4-a681-8ffea40b4f47
related:
    - id: c0abc838-36b0-47c9-b3b3-a90c39455382
      type: obsolete
status: test
description: Detect the creation of a service with a service binary located in a suspicious directory
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1562.001/T1562.001.md
author: Florian Roth (Nextron Systems), frack113
date: 2022-05-02
modified: 2025-10-07
tags:
    - attack.persistence
    - attack.defense-impairment
    - attack.t1112
logsource:
    category: registry_set
    product: windows
detection:
    selection_service_start:
        TargetObject|startswith: 'HKLM\System\CurrentControlSet\Services\'
        TargetObject|endswith: '\Start'
        Image|contains:
            - '\Users\Public\'
            - '\Perflogs\'
            - '\ADMIN$\'
            - '\Temp\'
        Details:
            - 'DWORD (0x00000000)'  # boot
            - 'DWORD (0x00000001)'  # System
            - 'DWORD (0x00000002)'  # Automatic
            # 3 - Manual , 4 - Disabled
    selection_service_imagepath:
        TargetObject|startswith: 'HKLM\System\CurrentControlSet\Services\'
        TargetObject|endswith: '\ImagePath'
        Details|contains:
            - '\Users\Public\'
            - '\Perflogs\'
            - '\ADMIN$\'
            - '\Temp\'
    filter_optional_avast:
        Image|contains|all: # Filter FP with Avast software
            - '\Common Files\'
            - '\Temp\'
    filter_optional_mbamservice:
        TargetObject|endswith: '\CurrentControlSet\Services\MBAMInstallerService\ImagePath'
        Details|endswith: '\AppData\Local\Temp\MBAMInstallerService.exe"'
        Image: 'C:\Windows\system32\services.exe'
    condition: 1 of selection_* and not 1 of filter_optional_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

1 of selection_* and not 1 of filter_optional_*

Stage 1: selection_service_start

selection_service_start:
    TargetObject|startswith: 'HKLM\System\CurrentControlSet\Services\'
    TargetObject|endswith: '\Start'
    Image|contains:
        - '\Users\Public\'
        - '\Perflogs\'
        - '\ADMIN$\'
        - '\Temp\'
    Details:
        - 'DWORD (0x00000000)'
        - 'DWORD (0x00000001)'
        - 'DWORD (0x00000002)'

Stage 2: selection_service_imagepath

selection_service_imagepath:
    TargetObject|startswith: 'HKLM\System\CurrentControlSet\Services\'
    TargetObject|endswith: '\ImagePath'
    Details|contains:
        - '\Users\Public\'
        - '\Perflogs\'
        - '\ADMIN$\'
        - '\Temp\'

Stage 3: not filter_optional_*

filter_optional_avast:
    Image|contains|all:
        - '\Common Files\'
        - '\Temp\'
filter_optional_mbamservice:
    TargetObject|endswith: '\CurrentControlSet\Services\MBAMInstallerService\ImagePath'
    Details|endswith: '\AppData\Local\Temp\MBAMInstallerService.exe"'
    Image: 'C:\Windows\system32\services.exe'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
Detailsends_with\AppData\Local\Temp\MBAMInstallerService.exe"
ImageeqC:\Windows\system32\services.exe
TargetObjectends_with\CurrentControlSet\Services\MBAMInstallerService\ImagePath
Imagematch\Common Files\
Imagematch\Temp\

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Detailseq
  • DWORD (0x00000000) corpus 38 (sigma 36, chronicle 2)
  • DWORD (0x00000001) corpus 40 (sigma 36, chronicle 4)
  • DWORD (0x00000002) corpus 11 (sigma 9, chronicle 1, kusto 1)
Detailsmatch
  • \ADMIN$\
  • \Perflogs\ corpus 3 (sigma 3)
  • \Temp\
  • \Users\Public\ corpus 5 (sigma 5)
Imagematch
  • \ADMIN$\
  • \Perflogs\ corpus 5 (sigma 5)
  • \Temp\ corpus 4 (sigma 4)
  • \Users\Public\ corpus 10 (sigma 10)
TargetObjectends_with
  • \ImagePath corpus 3 (sigma 3)
  • \Start corpus 2 (sigma 2)
TargetObjectstarts_with
  • HKLM\System\CurrentControlSet\Services\