Detection rules › Sigma

Privilege Escalation via Named Pipe Impersonation

Status
test
Severity
high
Log source
category process_creation, product windows
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.

Known false positives

  • Other programs that cause these patterns (please report)

MITRE ATT&CK coverage

TacticTechniques
Lateral Movement

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

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

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • > corpus 6 (sigma 6)
  • \\\\.\\pipe\\ corpus 2 (sigma 1, splunk 1)
  • echo corpus 9 (sigma 4, splunk 4, elastic 1)
field:"CommandLine" kind:match
Imageends_with
  • \cmd.exe corpus 130 (sigma 130)
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
field:"Image" kind:ends_with
OriginalFileNameeq
  • Cmd.Exe corpus 81 (sigma 43, elastic 21, splunk 17)
  • PowerShell.EXE corpus 138 (sigma 84, splunk 30, elastic 24)
field:"OriginalFileName" kind:eq