Emotet Process Creation

Detects all Emotet like process executions that are not covered by the more generic rules

Rule Content

- title: Emotet Process Creation
  id: d02e8cf5-6099-48cf-9bfc-1eec2d0c7b18
  status: experimental
  description: Detects all Emotet like process executions that are not covered by
    the more generic rules
  author: Florian Roth
  date: 2019/09/30
  modified: 2019/10/16
  references:
  - https://app.any.run/tasks/e13ab713-64cf-4b23-ad93-6dceaa5429ac/
  - https://app.any.run/tasks/81f3c28c-c686-425d-8a2b-a98198d244e1/
  - https://app.any.run/tasks/97f875e8-0e08-4328-815f-055e971ba754/
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      CommandLine:
      - '* -e* PAA*'
      - '*JABlAG4AdgA6AHUAcwBlAHIAcAByAG8AZgBpAGwAZQ*'
      - '*QAZQBuAHYAOgB1AHMAZQByAHAAcgBvAGYAaQBsAGUA*'
      - '*kAGUAbgB2ADoAdQBzAGUAcgBwAHIAbwBmAGkAbABlA*'
      - '*IgAoACcAKgAnACkAOwAkA*'
      - '*IAKAAnACoAJwApADsAJA*'
      - '*iACgAJwAqACcAKQA7ACQA*'
    condition: selection
  fields:
  - CommandLine
  - ParentCommandLine
  falsepositives:
  - Unlikely
  level: critical

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_command_line.keyword:(*\ \-e*\ PAA* OR *JABlAG4AdgA6AHUAcwBlAHIAcAByAG8AZgBpAGwAZQ* OR *QAZQBuAHYAOgB1AHMAZQByAHAAcgBvAGYAaQBsAGUA* OR *kAGUAbgB2ADoAdQBzAGUAcgBwAHIAbwBmAGkAbABlA* OR *IgAoACcAKgAnACkAOwAkA* OR *IAKAAnACoAJwApADsAJA* OR *iACgAJwAqACcAKQA7ACQA*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()