title: Domain Trust Discovery
id: 3bad990e-4848-4a78-9530-b427d854aac0
related:
  - id: 77815820-246c-47b8-9741-e0def3f57308
    type: obsoletes
description: Identifies execution of nltest.exe and dsquery.exe for domain trust discovery. This technique is used by attackers to enumerate Active Directory trusts.
status: experimental
author: E.M. Anhaus (originally from Atomic Blue Detections, Tony Lambert), oscd.community, omkar72
date: 2019/10/24
modified: 2021/07/09
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1482/T1482.md
    - https://eqllib.readthedocs.io/en/latest/analytics/03e231a6-74bc-467a-acb1-e5676b0fb55e.html
    - https://thedfirreport.com/2020/10/18/ryuk-in-5-hours/
    - https://redcanary.com/blog/how-one-hospital-thwarted-a-ryuk-ransomware-outbreak/
tags:
    - attack.discovery
    - attack.t1482
logsource:
    category: process_creation
    product: windows
detection:
    selection_nltest_v1:
        Image|endswith: '\nltest.exe'
        CommandLine|contains: 
            - 'domain_trusts'
            - 'all_trusts'
            - '/dclist'
    selection_dsquery_v1:
        Image|endswith: '\dsquery.exe'
        CommandLine|contains: 'trustedDomain'
    selection_dsquery_v2:    
        Image|endswith: '\dsquery.exe'
        CommandLine|contains|all:
            - '-filter'
            - 'trustedDomain'
    condition: 1 of them
falsepositives:
    - Legitimate use of the utilities by legitimate user for legitimate reason
level: medium
