Addition of Domain Trusts

Addition of domains is seldom and should be verified for legitimacy.

Rule Content

- title: Addition of Domain Trusts
  id: 0255a820-e564-4e40-af2b-6ac61160335c
  status: stable
  description: Addition of domains is seldom and should be verified for legitimacy.
  author: Thomas Patzke
  tags:
  - attack.persistence
  logsource:
    product: windows
    service: security
    category: null
  detection:
    selection:
      EventID: 4706
    condition: selection
  falsepositives:
  - Legitimate extension of domain structure
  level: medium

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-endpoint-winevent-security-*', doc_type='doc')

Run Elasticsearch Query


In [ ]:
s = searchContext.query('query_string', query='event_id:"4706"')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()