System Owner or User Discovery

Adversaries may use the information from System Owner/User Discovery during automated discovery to shape follow-on behaviors, including whether or not the adversary fully infects the target and/or attempts specific actions.

Rule Content

- title: System Owner or User Discovery
  id: 9a0d8ca0-2385-4020-b6c6-cb6153ca56f3
  status: experimental
  description: Adversaries may use the information from System Owner/User Discovery
    during automated discovery to shape follow-on behaviors, including whether or
    not the adversary fully infects the target and/or attempts specific actions.
  author: Timur Zinniatullin, oscd.community
  date: 2019/10/21
  references:
  - https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1033/T1033.yaml
  logsource:
    product: linux
    service: auditd
    category: null
  detection:
    selection:
      type: EXECVE
      a0:
      - users
      - w
      - who
    condition: selection
  falsepositives:
  - Admin activity
  level: low
  tags:
  - attack.discovery
  - attack.t1033

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='(type:"EXECVE" AND a0:("users" OR "w" OR "who"))')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()