OpenWith.exe executes specified binary

The OpenWith.exe executes other binary

Rule Content

- title: OpenWith.exe executes specified binary
  id: cec8e918-30f7-4e2d-9bfa-a59cc97ae60f
  status: experimental
  description: The OpenWith.exe executes other binary
  references:
  - https://github.com/LOLBAS-Project/LOLBAS/blob/master/yml/LOLUtilz/OSBinaries/Openwith.yml
  - https://twitter.com/harr0ey/status/991670870384021504
  author: Beyu Denis, oscd.community (rule), @harr0ey (idea)
  date: 2019/10/12
  modified: 2019/11/04
  tags:
  - attack.defense_evasion
  - attack.execution
  - attack.t1218
  level: high
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      Image|endswith: \OpenWith.exe
      CommandLine|contains: /c
    condition: selection
  falsepositives:
  - Legitimate use of OpenWith.exe by legitimate user

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:*\\OpenWith.exe AND process_command_line.keyword:*\/c*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()