Detection rules › Splunk

WinRM Tools (Windows Event Log)

Group by
_time, command_line, host
Source
github.com/anvilogic-forge/armory

Winrm is a command–line tool for system management is implemented in a Visual Basic Scripting Edition file (Winrm.vbs) written using the WinRM scripting API. This tool enables an administrator to configure WinRM and to get data or manage resources. Winrs.exe is a command line tool enables administrators to remotely execute most Cmd.exe commands using the WS-Management protocol. -- The WMI command-line (WMIC) utility provides a command-line interface for Windows Management Instrumentation (WMI). WMIC is compatible with existing shells and utility commands. - ThreatActor Association: Antlion, APT27/Emissary Panda, APT29/Nobelium/Cozy Bear, Carbanak, APT34/OilRig, FIN6, FIN7, FIN8 (Syssphinx), FIN12, FIN13, Flax Typhoon, GhostShell, Lazarus, Magic Hound (aka APT35, Charming Kitten, Phosphorus, and Mint Sandstorm), MalKamak, MuddyWater, TA2541, TA551, Vice Society, Volt Typhoon, WinterVivern/UAC-0114, Witchetty, Wizard Spider

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '5490.5670'
title: WinRM Tools
description: 'Winrm is a command–line tool for system management is implemented in
  a Visual Basic Scripting Edition file (Winrm.vbs) written using the WinRM scripting
  API. This tool enables an administrator to configure WinRM and to get data or manage
  resources. Winrs.exe is a command line tool enables administrators to remotely execute
  most Cmd.exe commands using the WS-Management protocol. -- The WMI command-line
  (WMIC) utility provides a command-line interface for Windows Management Instrumentation
  (WMI). WMIC is compatible with existing shells and utility commands. - ThreatActor
  Association: Antlion, APT27/Emissary Panda, APT29/Nobelium/Cozy Bear, Carbanak,
  APT34/OilRig, FIN6, FIN7, FIN8 (Syssphinx), FIN12, FIN13, Flax Typhoon, GhostShell,
  Lazarus, Magic Hound (aka APT35, Charming Kitten, Phosphorus, and Mint Sandstorm),
  MalKamak, MuddyWater, TA2541, TA551, Vice Society, Volt Typhoon, WinterVivern/UAC-0114,
  Witchetty, Wizard Spider -- Software Association: ALPHV/BlackCat, Astaroth, Avaddon,
  AvosLocker, BadHatch, Bazar, Blackcat/ALPHV, Black Basta, Clop, Conti, Cring, IcedID,
  Play, Quantum, Ryuk, SamSam, Sodinokibi/REvil, Vice Society, XingLocker -- Atomics
  T1047 Test#1 Atomics T1047 Test#2 Atomics T1047 Test#3 Atomics T1047 Test#4 Atomics
  T1047 Test#5 Atomics T1047 Test#6 Atomics T1047 Test#9 Atomics T1518.001 Test#6'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM(winrm) OR TERM(winrs) OR TERM(wmic)) | regex
  process="(?i)(winrm|winrs|wmic)" | table _time, host, user, signature_id, process,
  process_*, parent_process_name | bin span=1s | stats values(*) as * by _time, host,
  process | eventstats c(process) as c_process by process| where c_process<25 '
techniques:
- lateral-movement:remote services:windows remote management
- execution:windows management instrumentation
technique_id:
- T1021.006
- T1047
data_category:
- Windows event logs
references:
- http://msdn.microsoft.com/en-us/library/aa384426

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(winrm) OR TERM(winrs) OR TERM(wmic))

Stage 2: regex

| regex process="(?i)(winrm|winrs|wmic)"

Stage 3: table

| table _time, host, user, signature_id, process, process_*, parent_process_name

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host, process

Stage 6: eventstats

| eventstats c(process) as c_process by process

Stage 7: where

| where c_process<25

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
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
c_processlt
  • 25 corpus 4 (splunk 4)
processregex_match
  • "(?i)(winrm|winrs|wmic)"

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4688<"
1TERM
1winrm
1TERM
1winrs
1TERM
1wmic