CobaltStrike Malleable OneDrive browsing traffic profile

Detects Malleable OneDrive Profile

Rule Content

- title: CobaltStrike Malleable OneDrive browsing traffic profile
  id: c9b33401-cc6a-4cf6-83bb-57ddcb2407fc
  status: experimental
  description: Detects Malleable OneDrive Profile
  references:
  - https://github.com/rsmudge/Malleable-C2-Profiles/blob/master/normal/onedrive_getonly.profile
  author: Markus Neis
  tags:
  - attack.t1102
  logsource:
    category: proxy
    product: null
    service: null
  detection:
    selection:
      cs-method: GET
      c-uri: '*?manifest=wac'
      cs-host: onedrive.live.com
    filter:
      c-uri: http*://onedrive.live.com/*
    condition: selection and not filter
  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='((cs-method:"GET" AND c-uri.keyword:*?manifest\=wac AND cs-host:"onedrive.live.com") AND (NOT (c-uri.keyword:http*\:\/\/onedrive.live.com\/*)))')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()