Detection rules › Sigma

OpenSSH server firewall configuration on Windows (command)

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

Detects scenarios where an attacker configure the Windows firewall to allow incoming connections to perform stealthy lateral movement.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: OpenSSH server firewall configuration on Windows (command)
description: Detects scenarios where an attacker configure the Windows firewall to allow incoming connections to perform stealthy lateral movement.
references:
 - https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0008-Lateral%20Movement/T1021.004-Remote%20Service%20SSH
 - https://winaero.com/enable-openssh-server-windows-10/
 - https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
 - https://virtualizationreview.com/articles/2020/05/21/ssh-server-on-windows-10.aspx
tags:
- attack.defense_evasion
- attack.t1562.004
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  category: process_creation
detection:
  selection_event:
    EventID: 4688

  selection_netsh_adv: # Command for firewall rule creation (available starting Server 2012 R2)
    CommandLine|contains|all:
      - netsh
      - advfirewall
      - localport=
      - '22'

  selection_netsh: # Command for firewall rule creation (deprecated)
    CommandLine|contains|all:
      - netsh
      - firewall
      - portopening
      - '22'

  condition: selection_event and (selection_netsh_adv or selection_netsh)
falsepositives:
- Unknown
level: high

Stages and Predicates

Stage 0: condition

selection_event and (selection_netsh_adv or selection_netsh)

Stage 1: selection_event

selection_event:
  EventID: 4688

Stage 2: selection_netsh_adv

selection_netsh_adv:
  CommandLine|contains|all:
    - netsh
    - advfirewall
    - localport=
    - '22'

Stage 3: selection_netsh

selection_netsh:
  CommandLine|contains|all:
    - netsh
    - firewall
    - portopening
    - '22'

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
  • 22
  • advfirewall corpus 7 (sigma 6, kusto 1)
  • firewall corpus 13 (sigma 7, splunk 6)
  • localport=
  • netsh corpus 9 (sigma 9)
  • portopening corpus 2 (sigma 2)