Detection rules › Sigma

Changing Existing Service ImagePath Value Via Reg.EXE

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

Adversaries may execute their own malicious payloads by hijacking the Registry entries used by services. Adversaries may use flaws in the permissions for registry to redirect from the originally specified executable to one that they control, in order to launch their own code at Service start. Windows stores local service configuration information in the Registry under HKLM\SYSTEM\CurrentControlSet\Services

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Changing Existing Service ImagePath Value Via Reg.EXE
id: 9b0b7ac3-6223-47aa-a3fd-e8f211e637db
status: test
description: |
    Adversaries may execute their own malicious payloads by hijacking the Registry entries used by services.
    Adversaries may use flaws in the permissions for registry to redirect from the originally specified executable to one that they control, in order to launch their own code at Service start.
    Windows stores local service configuration information in the Registry under HKLM\SYSTEM\CurrentControlSet\Services
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1574.011/T1574.011.md#atomic-test-2---service-imagepath-change-with-regexe
author: frack113
date: 2021-12-30
modified: 2024-03-13
tags:
    - attack.privilege-escalation
    - attack.persistence
    - attack.execution
    - attack.stealth
    - attack.t1574.011
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\reg.exe'
        CommandLine|contains|all:
            - 'add '
            - 'SYSTEM\CurrentControlSet\Services\'
            - ' ImagePath '
    selection_value:
        CommandLine|contains|windash: ' -d '
    condition: all of selection*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection

selection:
    Image|endswith: '\reg.exe'
    CommandLine|contains|all:
        - 'add '
        - 'SYSTEM\CurrentControlSet\Services\'
        - ' ImagePath '

Stage 2: selection_value

selection_value:
    CommandLine|contains|windash: ' -d '

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • -d transforms: windash corpus 8 (sigma 7, splunk 1)
  • ImagePath
  • SYSTEM\CurrentControlSet\Services\
  • add corpus 12 (sigma 12)
field:"CommandLine" kind:match
Imageends_with
  • \reg.exe corpus 58 (sigma 58)
field:"Image" kind:ends_with value:"\reg.exe"