Microsoft Workflow Compiler

Detects invocation of Microsoft Workflow Compiler, which may permit the execution of arbitrary unsigned code.

Rule Content

- title: Microsoft Workflow Compiler
  id: 419dbf2b-8a9b-4bea-bf99-7544b050ec8d
  status: experimental
  description: Detects invocation of Microsoft Workflow Compiler, which may permit
    the execution of arbitrary unsigned code.
  tags:
  - attack.defense_evasion
  - attack.execution
  - attack.t1127
  author: Nik Seetharaman
  references:
  - https://posts.specterops.io/arbitrary-unsigned-code-execution-vector-in-microsoft-workflow-compiler-exe-3d9294bc5efb
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image: '*\Microsoft.Workflow.Compiler.exe'
    condition: selection
  fields:
  - CommandLine
  - ParentCommandLine
  falsepositives:
  - Legitimate MWC use (unlikely in modern enterprise environments)
  level: high

Querying Elasticsearch

Import Libraries


In [ ]:
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
import pandas as pd

Initialize Elasticsearch client


In [ ]:
es = Elasticsearch(['http://helk-elasticsearch:9200'])
searchContext = Search(using=es, index='logs-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='process_path.keyword:*\\Microsoft.Workflow.Compiler.exe')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()