Oracle WebLogic Exploit

Detects access to a webshell droped into a keytore folder on the WebLogic server

Rule Content

- title: Oracle WebLogic Exploit
  id: 37e8369b-43bb-4bf8-83b6-6dd43bda2000
  description: Detects access to a webshell droped into a keytore folder on the WebLogic
    server
  author: Florian Roth
  date: 2018/07/22
  status: experimental
  references:
  - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-2894
  - https://twitter.com/pyn3rd/status/1020620932967223296
  - https://github.com/LandGrey/CVE-2018-2894
  logsource:
    category: webserver
    product: null
    service: null
  detection:
    selection:
      c-uri-path:
      - '*/config/keystore/*.js*'
    condition: selection
  fields:
  - c-ip
  - c-dns
  falsepositives:
  - Unknown
  tags:
  - attack.t1100
  - attack.t1190
  - attack.initial_access
  - attack.persistence
  - attack.privilege_escalation
  - cve.2018-2894
  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='c-uri-path.keyword:(*\/config\/keystore\/*.js*)')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()