Detection rules › Sigma

Privilege Escalation via Named Pipe Impersonation

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Tim Rauch, Elastic (idea)
Source
github.com/SigmaHQ/sigma

Detects a remote file copy attempt to a hidden network share. This may indicate lateral movement or data staging activity.

MITRE ATT&CK coverage

TacticTechniques
Lateral MovementT1021 Remote Services

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Privilege Escalation via Named Pipe Impersonation
id: 9bd04a79-dabe-4f1f-a5ff-92430265c96b
related:
    - id: f35c5d71-b489-4e22-a115-f003df287317
      type: derived
status: test
description: Detects a remote file copy attempt to a hidden network share. This may indicate lateral movement or data staging activity.
references:
    - https://www.elastic.co/guide/en/security/current/privilege-escalation-via-named-pipe-impersonation.html
author: Tim Rauch, Elastic (idea)
date: 2022-09-27
modified: 2022-12-30
tags:
    - attack.lateral-movement
    - attack.t1021
logsource:
    category: process_creation
    product: windows
detection:
    selection_name:
        - Image|endswith:
              - '\cmd.exe'
              - '\powershell.exe'
        - OriginalFileName:
              - 'Cmd.Exe'
              - 'PowerShell.EXE'
    selection_args:
        CommandLine|contains|all:
            - 'echo'
            - '>'
            - '\\\\.\\pipe\\'
    condition: all of selection*
falsepositives:
    - Other programs that cause these patterns (please report)
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_name

selection_name:
    - Image|endswith:
          - '\cmd.exe'
          - '\powershell.exe'
    - OriginalFileName:
          - 'Cmd.Exe'
          - 'PowerShell.EXE'

Stage 2: selection_args

selection_args:
    CommandLine|contains|all:
        - 'echo'
        - '>'
        - '\\\\.\\pipe\\'

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
  • > corpus 6 (sigma 6)
  • \\\\.\\pipe\\ corpus 2 (sigma 1, splunk 1)
  • echo corpus 8 (sigma 4, splunk 4)
Imageends_with
  • \cmd.exe corpus 130 (sigma 130)
  • \powershell.exe corpus 182 (sigma 182)
OriginalFileNameeq
  • Cmd.Exe corpus 65 (sigma 43, splunk 17, elastic 5)
  • PowerShell.EXE corpus 120 (sigma 84, splunk 30, elastic 6)