Detection rules › Sigma

AWL Bypass with Winrm.vbs and Malicious WsmPty.xsl/WsmTxt.xsl

Status
test
Severity
medium
Log source
category process_creation, product windows
Author
Julia Fomina, oscd.community
Source
github.com/SigmaHQ/sigma

Detects execution of attacker-controlled WsmPty.xsl or WsmTxt.xsl via winrm.vbs and copied cscript.exe (can be renamed)

Known false positives

  • Unlikely

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: AWL Bypass with Winrm.vbs and Malicious WsmPty.xsl/WsmTxt.xsl
id: 074e0ded-6ced-4ebd-8b4d-53f55908119d
status: test
description: Detects execution of attacker-controlled WsmPty.xsl or WsmTxt.xsl via winrm.vbs and copied cscript.exe (can be renamed)
references:
    - https://posts.specterops.io/application-whitelisting-bypass-and-arbitrary-unsigned-code-execution-technique-in-winrm-vbs-c8c24fb40404
author: Julia Fomina, oscd.community
date: 2020-10-06
modified: 2022-10-09
tags:
    - attack.stealth
    - attack.t1216
logsource:
    category: process_creation
    product: windows
detection:
    contains_format_pretty_arg:
        CommandLine|contains:
            - 'format:pretty'
            - 'format:"pretty"'
            - 'format:"text"'
            - 'format:text'
    image_from_system_folder:
        Image|startswith:
            - 'C:\Windows\System32\'
            - 'C:\Windows\SysWOW64\'
    contains_winrm:
        CommandLine|contains: 'winrm'
    condition: contains_winrm and (contains_format_pretty_arg and not image_from_system_folder)
falsepositives:
    - Unlikely
level: medium

Stages and Predicates

Stage 0: condition

contains_winrm and (contains_format_pretty_arg and not image_from_system_folder)

Stage 1: contains_winrm

contains_winrm:
    CommandLine|contains: 'winrm'

Stage 2: contains_format_pretty_arg

contains_format_pretty_arg:
    CommandLine|contains:
        - 'format:pretty'
        - 'format:"pretty"'
        - 'format:"text"'
        - 'format:text'

Stage 3: not image_from_system_folder

image_from_system_folder:
    Image|startswith:
        - 'C:\Windows\System32\'
        - 'C:\Windows\SysWOW64\'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Imagestarts_withC:\Windows\SysWOW64\excludes:Image field:"Image" value:"C:\Windows\SysWOW64\"
Imagestarts_withC:\Windows\System32\excludes:Image field:"Image" value:"C:\Windows\System32\"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • format:"pretty"
  • format:"text"
  • format:pretty
  • format:text
  • winrm corpus 2 (sigma 2)
field:"CommandLine" kind:match