Detection rules › Sigma

Privilege escalation via RunasCS

Status
experimental
Severity
low
Log source
product windows, category process_creation
Author
mdecrevoisier
Source
github.com/mdecrevoisier/SIGMA-detection-rules

Detects scenarios where attack attempts to elevate privileges via customize Runas tool.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Privilege escalation via RunasCS
description: Detects scenarios where attack attempts to elevate privileges via customize Runas tool.
correlation: correlation with ID 4648 can be done over SubjectLogonId in order to get more context.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0004-Privilege%20Escalation/T1134-Access%20Token%20Manipulation
- https://github.com/antonioCoco/RunasCs
- https://twitter.com/SBousseaden/status/1478373779642400783
tags:
- attack.privilege_escalation
- attack.t1134.002
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  category: process_creation
detection:

  selection_process: # optional parameter with suspicious behavior reported by SBousseaden
    EventID: 4688
    TargetUserSid: S-1-0-0 # everyone

  filter_user_process:
    - TargetUserName:
      - 'LOCAL SERVICE'
      - 'Network Service'
      - 'DWM-*'
      - 'UMFD-*'
      - 'sshd_*'
      - '*$'
      - 'DefaultAppPool'
      - '-'
    - TargetDomainName:
      - 'NT Service'
      - 'NT AUTHORITY'
      - 'Font Driver Host'
      - 'Window Manager'
      - 'IIS APPPOOL'
      - 'VIRTUAL USERS'

  condition: selection_process and not filter_user_process
falsepositives:
- Administrator activity
level: low

Stages and Predicates

Stage 0: condition

selection_process and not filter_user_process

Stage 1: selection_process

selection_process:
  EventID: 4688
  TargetUserSid: S-1-0-0

Stage 2: not filter_user_process

filter_user_process:
  - TargetUserName:
    - 'LOCAL SERVICE'
    - 'Network Service'
    - 'DWM-*'
    - 'UMFD-*'
    - 'sshd_*'
    - '*$'
    - 'DefaultAppPool'
    - '-'
  - TargetDomainName:
    - 'NT Service'
    - 'NT AUTHORITY'
    - 'Font Driver Host'
    - 'Window Manager'
    - 'IIS APPPOOL'
    - 'VIRTUAL USERS'

Exclusions

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

FieldKindExcluded values
TargetDomainNameeqFont Driver Host
TargetDomainNameeqIIS APPPOOL
TargetDomainNameeqNT AUTHORITY
TargetDomainNameeqNT Service
TargetDomainNameeqVIRTUAL USERS
TargetDomainNameeqWindow Manager
TargetUserNameeq*$
TargetUserNameeq-
TargetUserNameeqDWM-*
TargetUserNameeqDefaultAppPool
TargetUserNameeqLOCAL SERVICE
TargetUserNameeqNetwork Service
TargetUserNameeqUMFD-*
TargetUserNameeqsshd_*

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
TargetUserSideq
  • S-1-0-0