Detection rules › Sigma

Remote PowerShell Sessions Network Connections (WinRM)

Status
test
Severity
high
Log source
product windows, service security
Author
Roberto Rodriguez @Cyb3rWard0g
Source
github.com/SigmaHQ/sigma

Detects basic PowerShell Remoting (WinRM) by monitoring for network inbound connections to ports 5985 OR 5986

Known false positives

  • Legitimate use of remote PowerShell execution

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Remote PowerShell Sessions Network Connections (WinRM)
id: 13acf386-b8c6-4fe0-9a6e-c4756b974698
status: test
description: Detects basic PowerShell Remoting (WinRM) by monitoring for network inbound connections to ports 5985 OR 5986
references:
    - https://threathunterplaybook.com/hunts/windows/190511-RemotePwshExecution/notebook.html
author: Roberto Rodriguez @Cyb3rWard0g
date: 2019-09-12
modified: 2022-10-09
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    service: security
detection:
    selection:
        EventID: 5156
        DestPort:
            - 5985
            - 5986
        LayerRTID: 44
    condition: selection
falsepositives:
    - Legitimate use of remote PowerShell execution
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    EventID: 5156
    DestPort:
        - 5985
        - 5986
    LayerRTID: 44

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
DestPorteq
  • 5985 corpus 4 (sigma 2, elastic 1, chronicle 1)
  • 5986 corpus 3 (sigma 2, chronicle 1)
field:"DestinationPort" kind:eq
LayerRTIDeq
  • 44
field:"LayerRTID" kind:eq value:"44"