name: NLTest Domain Trust Discovery
id: c3e05466-5f22-11eb-ae93-0242ac130002
version: 1
date: '2021-01-25'
author: Michael Haag, Splunk
type: batch
datamodel:
- Endpoint
description: This search looks for the execution of `nltest.exe` with command-line
  arguments utilized to query for Domain Trust information. Two arguments `/domain
  trusts`, returns a list of trusted domains, and `/all_trusts`, returns all trusted
  domains. Red Teams and adversaries alike use NLTest.exe to enumerate the current
  domain to assist with further understanding where to pivot next.
search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time)
  as lastTime from datamodel=Endpoint.Processes where (Processes.process_name=nltest.exe
  OR Processes.process_name!=nltest.exe) (Processes.process=*/domain_trusts* OR Processes.process=*/all_trusts*)
  by Processes.dest Processes.user Processes.parent_process Processes.process_name
  Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)`
  | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `nltest_domain_trust_discovery_filter`'
how_to_implement: To successfully implement this search you need to be ingesting information
  on process that include the name of the process responsible for the changes from
  your endpoints into the `Endpoint` datamodel in the `Processes` node.
known_false_positives: Administrators may use nltest for troubleshooting purposes,
  otherwise, rarely used.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1482/T1482.md
- https://malware.news/t/lets-learn-trickbot-implements-network-collector-module-leveraging-cmd-wmi-ldap/19104
- https://attack.mitre.org/techniques/T1482/
- https://www.owasp.org/images/4/4b/Red_Team_Operating_in_a_Modern_Environment.pdf
- https://ss64.com/nt/nltest.html
- https://redcanary.com/threat-detection-report/techniques/domain-trust-discovery/
- https://thedfirreport.com/2020/10/08/ryuks-return/
tags:
  analytic_story:
  - Ryuk Ransomware
  asset_type: Endpoint
  automated_detection_testing: passed
  cis20:
  - CIS 8
  dataset:
  - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1482/atomic_red_team/windows-sysmon.log
  kill_chain_phases:
  - Exploitation
  mitre_attack_id:
  - T1482
  nist:
  - PR.PT
  - DE.CM
  product:
  - Splunk Enterprise
  - Splunk Enterprise Security
  - Splunk Cloud
  required_fields:
  - _time
  - Processes.process_name
  - Processes.process
  - Processes.dest
  - Processes.user
  - Processes.parent_process
  - Processes.process_id
  - Processes.parent_process_id
  security_domain: endpoint
