MSHTA spwaned by SVCHOST as seen in LethalHTA

Detects MSHTA.EXE spwaned by SVCHOST described in report

Rule Content

- title: MSHTA spwaned by SVCHOST as seen in LethalHTA
  id: ed5d72a6-f8f4-479d-ba79-02f6a80d7471
  status: experimental
  description: Detects MSHTA.EXE spwaned by SVCHOST described in report
  references:
  - https://codewhitesec.blogspot.com/2018/07/lethalhta.html
  tags:
  - attack.defense_evasion
  - attack.execution
  - attack.t1170
  author: Markus Neis
  date: 2018/06/07
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      ParentImage: '*\svchost.exe'
      Image: '*\mshta.exe'
    condition: selection
  falsepositives:
  - Unknown
  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_parent_path.keyword:*\\svchost.exe AND process_path.keyword:*\\mshta.exe)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()