Detection rules › Sigma
Remote Code Execute via Winrm.vbs
Detects an attempt to execute code or create service on remote host via winrm.vbs.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | T1216 System Script Proxy Execution |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 1 | Process creation |
Rule body yaml
title: Remote Code Execute via Winrm.vbs
id: 9df0dd3a-1a5c-47e3-a2bc-30ed177646a0
status: test
description: Detects an attempt to execute code or create service on remote host via winrm.vbs.
references:
- https://twitter.com/bohops/status/994405551751815170
- https://redcanary.com/blog/lateral-movement-winrm-wmi/
- https://lolbas-project.github.io/lolbas/Scripts/Winrm/
author: Julia Fomina, oscd.community
date: 2020-10-07
modified: 2023-03-03
tags:
- attack.stealth
- attack.t1216
logsource:
category: process_creation
product: windows
detection:
selection_img:
# Note: winrm.vbs can only be run by a process named cscript (see "IsCScriptEnv" function)
- Image|endswith: '\cscript.exe'
- OriginalFileName: 'cscript.exe'
selection_cli:
CommandLine|contains|all:
- 'winrm'
- 'invoke Create wmicimv2/Win32_'
- '-r:http'
condition: all of selection*
falsepositives:
- Unknown
level: medium
Stages and Predicates
Stage 0: condition
all of selection*Stage 1: selection_img
selection_img:
- Image|endswith: '\cscript.exe'
- OriginalFileName: 'cscript.exe'
Stage 2: selection_cli
selection_cli:
CommandLine|contains|all:
- 'winrm'
- 'invoke Create wmicimv2/Win32_'
- '-r:http'
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.
| Field | Kind | Values |
|---|---|---|
CommandLine | match |
|
Image | ends_with |
|
OriginalFileName | eq |
|