Detection rules › Sigma

ServiceDll Hijack

Status
test
Severity
medium
Log source
product windows, category registry_set
Author
frack113
Source
github.com/SigmaHQ/sigma

Detects changes to the "ServiceDLL" value related to a service in the registry. This is often used as a method of persistence.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 13RegistryEvent (Value Set)

Rule body yaml

title: ServiceDll Hijack
id: 612e47e9-8a59-43a6-b404-f48683f45bd6
status: test
description: |
    Detects changes to the "ServiceDLL" value related to a service in the registry.
    This is often used as a method of persistence.
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1543.003/T1543.003.md#atomic-test-4---tinyturla-backdoor-service-w64time
    - https://www.hexacorn.com/blog/2013/09/19/beyond-good-ol-run-key-part-4/
author: frack113
date: 2022-02-04
modified: 2024-04-03
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.t1543.003
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains|all:
            - '\System\'
            - 'ControlSet'
            - '\Services\'
        TargetObject|endswith: '\Parameters\ServiceDll'
    filter_main_printextensionmanger:
        Details: 'C:\Windows\system32\spool\drivers\x64\3\PrintConfig.dll'
    filter_main_domain_controller:
        Image: 'C:\Windows\system32\lsass.exe'
        TargetObject|endswith: '\Services\NTDS\Parameters\ServiceDll'
        Details: '%%systemroot%%\system32\ntdsa.dll'
    filter_main_poqexec:
        Image: 'C:\Windows\System32\poqexec.exe'
    filter_optional_safetica:
        Image|endswith: '\regsvr32.exe'
        Details: 'C:\Windows\System32\STAgent.dll'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Administrative scripts
    - Installation of a service
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection

selection:
    TargetObject|contains|all:
        - '\System\'
        - 'ControlSet'
        - '\Services\'
    TargetObject|endswith: '\Parameters\ServiceDll'

Stage 2: not filter_main_*

filter_main_printextensionmanger:
    Details: 'C:\Windows\system32\spool\drivers\x64\3\PrintConfig.dll'
filter_main_domain_controller:
    Image: 'C:\Windows\system32\lsass.exe'
    TargetObject|endswith: '\Services\NTDS\Parameters\ServiceDll'
    Details: '%%systemroot%%\system32\ntdsa.dll'
filter_main_poqexec:
    Image: 'C:\Windows\System32\poqexec.exe'

Stage 3: not filter_optional_safetica

filter_optional_safetica:
    Image|endswith: '\regsvr32.exe'
    Details: 'C:\Windows\System32\STAgent.dll'

Exclusions

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

FieldKindExcluded values
Detailseq%%systemroot%%\system32\ntdsa.dll
ImageeqC:\Windows\system32\lsass.exe
TargetObjectends_with\Services\NTDS\Parameters\ServiceDll
DetailseqC:\Windows\system32\spool\drivers\x64\3\PrintConfig.dll
ImageeqC:\Windows\System32\poqexec.exe
DetailseqC:\Windows\System32\STAgent.dll
Imageends_with\regsvr32.exe

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
TargetObjectends_with
  • \Parameters\ServiceDll
TargetObjectmatch
  • ControlSet corpus 3 (sigma 3)
  • \Services\ corpus 4 (sigma 4)
  • \System\