Incoming Execution via WinRM Remote Shelledit

Identifies remote execution via Windows Remote Management (WinRM) remote shell on a target host. This could be an indication of lateral movement.

Rule type: eql

Rule indices:

  • winlogbeat-*
  • logs-endpoint.events.*
  • logs-windows.*

Severity: medium

Risk score: 47

Runs every: 5 minutes

Searches indices from: now-9m (Date Math format, see also Additional look-back time)

Maximum alerts per execution: 100

Tags:

  • Elastic
  • Host
  • Windows
  • Threat Detection
  • Lateral Movement

Version: 3 (version history)

Added (Elastic Stack release): 7.11.0

Last modified (Elastic Stack release): 7.16.0

Rule authors: Elastic

Rule license: Elastic License v2

Potential false positivesedit

WinRM is a dual-use protocol that can be used for benign or malicious activity. It’s important to baseline your environment to determine the amount of noise to expect from this tool.

Rule queryedit

sequence by host.id with maxspan=30s [network where process.pid ==
4 and network.direction : ("incoming", "ingress") and
destination.port in (5985, 5986) and network.protocol == "http" and
not source.address in ("::1", "127.0.0.1") ] [process where
event.type == "start" and process.parent.name : "winrshost.exe" and
not process.name : "conhost.exe"]

Threat mappingedit

Framework: MITRE ATT&CKTM

Rule version historyedit

Version 3 (7.16.0 release)
  • Updated query, changed from:

    sequence by host.id with maxspan=30s [network where process.pid ==
    4 and network.direction == "incoming" and destination.port in
    (5985, 5986) and network.protocol == "http" and not source.address in
    ("::1", "127.0.0.1") ] [process where event.type == "start" and
    process.parent.name : "winrshost.exe" and not process.name :
    "conhost.exe"]
Version 2 (7.12.0 release)
  • Formatting only