Invocation of Active Directory Diagnostic Tool (ntdsutil.exe)

Detects execution of ntdsutil.exe, which can be used for various attacks against the NTDS database (NTDS.DIT)

Rule Content

- title: Invocation of Active Directory Diagnostic Tool (ntdsutil.exe)
  id: 2afafd61-6aae-4df4-baed-139fa1f4c345
  description: Detects execution of ntdsutil.exe, which can be used for various attacks
    against the NTDS database (NTDS.DIT)
  status: experimental
  references:
  - https://jpcertcc.github.io/ToolAnalysisResultSheet/details/ntdsutil.htm
  author: Thomas Patzke
  tags:
  - attack.credential_access
  - attack.t1003
  logsource:
    category: process_creation
    product: windows
    service: null
  detection:
    selection:
      CommandLine: '*\ntdsutil*'
    condition: selection
  falsepositives:
  - NTDS maintenance
  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='process_command_line.keyword:*\\ntdsutil*')
response = s.execute()
if response.success():
    df = pd.DataFrame((d.to_dict() for d in s.scan()))

Show Results


In [ ]:
df.head()