Detection rules › Sigma

Possible Privilege Escalation via Weak Service Permissions

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Teymur Kheirkhabarov
Source
github.com/SigmaHQ/sigma

Detection of sc.exe utility spawning by user with Medium integrity level to change service ImagePath or FailureCommand

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Possible Privilege Escalation via Weak Service Permissions
id: d937b75f-a665-4480-88a5-2f20e9f9b22a
status: test
description: Detection of sc.exe utility spawning by user with Medium integrity level to change service ImagePath or FailureCommand
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-privilege-escalation-in-windows-environment
    - https://pentestlab.blog/2017/03/30/weak-service-permissions/
author: Teymur Kheirkhabarov
date: 2019-10-26
modified: 2024-12-01
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.execution
    - attack.stealth
    - attack.t1574.011
logsource:
    category: process_creation
    product: windows
detection:
    scbynonadmin:
        Image|endswith: '\sc.exe'
        IntegrityLevel:
            - 'Medium'
            - 'S-1-16-8192'
    selection_binpath:
        CommandLine|contains|all:
            - 'config'
            - 'binPath'
    selection_failure:
        CommandLine|contains|all:
            - 'failure'
            - 'command'
    condition: scbynonadmin and 1 of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

scbynonadmin and 1 of selection_*

Stage 1: scbynonadmin

scbynonadmin:
    Image|endswith: '\sc.exe'
    IntegrityLevel:
        - 'Medium'
        - 'S-1-16-8192'

Stage 2: selection_binpath

selection_binpath:
    CommandLine|contains|all:
        - 'config'
        - 'binPath'

Stage 3: selection_failure

selection_failure:
    CommandLine|contains|all:
        - 'failure'
        - 'command'

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
CommandLinematch
  • binPath corpus 6 (sigma 5, splunk 1)
  • command corpus 4 (sigma 4)
  • config corpus 16 (sigma 15, splunk 1)
  • failure corpus 3 (sigma 3)
Imageends_with
  • \sc.exe corpus 30 (sigma 30)
IntegrityLeveleq
  • Medium corpus 3 (sigma 3)
  • S-1-16-8192 corpus 3 (sigma 3)