T1021.006 Sumo Logic CSE · Sumo

Detect Windows Remote Management in Sumo Logic CSE

Adversaries may use Valid Accounts to interact with remote systems using Windows Remote Management (WinRM). WinRM is a Windows service and protocol allowing remote execution of commands, registry modification, and service management. It can be invoked via the winrm command, PowerShell's Invoke-Command/Enter-PSSession, or tools like Evil-WinRM used by Storm-0501. Other users include Cobalt Strike (WinRM for Beacon delivery), Brute Ratel C4, Chimera, and FIN13. WinRM operates over HTTP (5985) and HTTPS (5986) and requires valid credentials plus network access. When disabled by default on client systems, adversaries may first enable it via registry modification or Group Policy.

MITRE ATT&CK

Tactic
Lateral Movement
Technique
T1021 Remote Services
Sub-technique
T1021.006 Windows Remote Management
Canonical reference
https://attack.mitre.org/techniques/T1021/006/

Sumo Detection Query

Sumo Logic CSE (Sumo)
sql
(_sourceCategory=windows/sysmon OR _sourceCategory=Windows/Sysmon/Operational)
| where EventCode = "1"
| parse regex field=ParentImage "(?i)(?<ParentFileName>[^\\]+)$" nodrop
| parse regex field=Image      "(?i)(?<FileName>[^\\]+)$"      nodrop
| where (
    (
      ParentFileName matches "(?i)wsmprovhost.exe"
      and FileName != "conhost.exe"
      and FileName != "WerFault.exe"
      and FileName != "csc.exe"
    )
    or
    (
      (FileName matches "(?i)powershell.exe" or FileName matches "(?i)pwsh.exe")
      and (
        CommandLine matches "(?i)Invoke-Command"
        or CommandLine matches "(?i)Enter-PSSession"
        or CommandLine matches "(?i)New-PSSession"
        or CommandLine matches "(?i)-ComputerName"
        or CommandLine matches "(?i)wsman://"
        or CommandLine matches "(?i)WSMan"
      )
    )
    or FileName matches "(?i)winrs.exe"
  )
| eval AlertType = if(ParentFileName matches "(?i)wsmprovhost.exe", "WinRM_RemoteExec",
                   if(FileName matches "(?i)(powershell|pwsh).exe", "WinRM_PSRemoting",
                   if(FileName matches "(?i)winrs.exe", "WinRM_DirectTool", "Unknown")))
| fields _messageTime, Computer, User, FileName, CommandLine, ParentFileName, AlertType
| sort by _messageTime desc
high severity high confidence

Sumo Logic query detecting WinRM lateral movement via Sysmon EventID 1 ingested under windows/sysmon source categories. Parses the base filename from full image paths using regex, then filters on the three WinRM lateral movement patterns. Uses eval to tag each event with an alert type for downstream triage. Adjust _sourceCategory values to match your collector configuration.

Data Sources

Sumo Logic Cloud SIEM Enterprise (CSE)Sysmon operational logs forwarded via Sumo Logic Installed Collector (Windows Event Log source)Sumo Logic OpenTelemetry Collector for Windows

Required Tables

windows/sysmon (source category)Windows/Sysmon/Operational (source category)

False Positives & Tuning

  • Legitimate IT administrators using PowerShell Remoting interactively for remote system health checks or remediation — tunable by correlating with privileged account baselines and source-to-destination pair frequency
  • Enterprise RMM tools (ConnectWise, Kaseya, NinjaRMM) that leverage WinRM for remote script execution on managed endpoints — whitelist known RMM agent process hashes or parent processes
  • CI/CD build pipelines using New-PSSession to deploy artefacts or run integration tests on remote Windows hosts — expect periodic bursts aligned with deployment schedules
Download portable Sigma rule (.yml)

Other platforms for T1021.006


Testing Methodology

Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Execute Remote Command via WinRM (Invoke-Command)

    Expected signal: Sysmon Event ID 1: powershell.exe with Invoke-Command and ComputerName in command line. Sysmon Event ID 3: outbound TCP to 127.0.0.1:5985. On target: wsmprovhost.exe spawning child process (Get-Process execution). WinRM Operational Event ID 91.

  2. Test 2Enable WinRM on Remote Host via Registry

    Expected signal: Sysmon Event ID 1: powershell.exe with Enable-PSRemoting. Sysmon Event ID 13 (Registry Value Set): changes to WinRM configuration registry keys under HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM. WinRM service start in System log.

  3. Test 3Execute Remote Command via winrs.exe

    Expected signal: Sysmon Event ID 1: winrs.exe process creation with -r: and remote IP. Sysmon Event ID 3: network connection to 127.0.0.1:5985. On target: wsmprovhost.exe spawning cmd.exe with 'whoami & hostname'.

  4. Test 4Interactive WinRM Session via Enter-PSSession

    Expected signal: Sysmon Event ID 1: powershell.exe with New-PSSession and ComputerName 127.0.0.1. Sysmon Event ID 3: TCP connection to 5985. WinRM Operational Events 6, 11, 15 (create, shell, command). ScriptBlock Log Event 4104 with Get-LocalUser.

Unlock Pro Content

Get the full detection package for T1021.006 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections