CobaltStrike Malleable (OCSP) Profile

Detects Malleable (OCSP) Profile with Typo (OSCP) in URL

Rule Content

- title: CobaltStrike Malleable (OCSP) Profile
  id: 37325383-740a-403d-b1a2-b2b4ab7992e7
  status: experimental
  description: Detects Malleable (OCSP) Profile with Typo (OSCP) in URL
  references:
  - https://github.com/rsmudge/Malleable-C2-Profiles/blob/master/normal/ocsp.profile
  author: Markus Neis
  tags:
  - attack.t1102
  logsource:
    category: proxy
    product: null
    service: null
  detection:
    selection:
      c-uri: '*/oscp/*'
      cs-host: ocsp.verisign.com
    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='(c-uri.keyword:*\/oscp\/* AND cs-host:"ocsp.verisign.com")')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()