Detect Network Trust Dependencies in Google Chronicle
Adversaries may gather information about the victim's network trust dependencies that can be used during targeting. This includes identifying second or third-party organizations such as managed service providers (MSPs), contractors, and partner organizations that have privileged or elevated network access to the target environment. Adversaries gather this information through direct elicitation (spear phishing for information), public sources (LinkedIn, company websites, job postings revealing MSP/vendor relationships), WHOIS/DNS records, and Active Directory trust enumeration once they have initial internal access. Internally, this manifests as enumeration of Active Directory domain and forest trusts using built-in tools (nltest.exe, netdom.exe), PowerShell AD cmdlets (Get-ADTrust, Get-ADForest), or LDAP queries targeting trustedDomain objects. Externally, adversaries may discover trust relationships from public BGP routing data, certificate transparency logs, or OSINT tools targeting organizational infrastructure. The intelligence gathered enables attacks via trusted third-party relationships (T1199), supply chain compromise (T1195), or credential abuse against MSP-managed accounts.
MITRE ATT&CK
- Tactic
- Reconnaissance
- Technique
- T1590 Gather Victim Network Information
- Sub-technique
- T1590.003 Network Trust Dependencies
- Canonical reference
- https://attack.mitre.org/techniques/T1590/003/
YARA-L Detection Query
rule t1590_003_network_trust_dependency_enumeration {
meta:
author = "Argus Detection Engineering"
description = "Detects enumeration of Active Directory trust relationships via process execution or LDAP directory access. Covers nltest.exe, netdom.exe, PowerShell AD cmdlets, dsquery.exe, and Event ID 4662 trustedDomain object access (T1590.003)."
mitre_attack_tactic = "Reconnaissance"
mitre_attack_technique = "T1590.003"
severity = "MEDIUM"
priority = "MEDIUM"
events:
(
// Branch 1a: nltest.exe with trust enumeration arguments
(
$e.metadata.event_type = "PROCESS_LAUNCH"
and re.regex($e.target.process.file.full_path, `(?i)\\nltest\.exe$`)
and (
re.regex($e.target.process.command_line, `(?i)/domain_trusts`) or
re.regex($e.target.process.command_line, `(?i)/all_trusts`) or
re.regex($e.target.process.command_line, `(?i)/trusted_domains`) or
re.regex($e.target.process.command_line, `(?i)/dclist`) or
re.regex($e.target.process.command_line, `(?i)/parentdomain`) or
re.regex($e.target.process.command_line, `(?i)/dsgetsite`)
)
)
or
// Branch 1b: netdom.exe trust operations
(
$e.metadata.event_type = "PROCESS_LAUNCH"
and re.regex($e.target.process.file.full_path, `(?i)\\netdom\.exe$`)
and (
re.regex($e.target.process.command_line, `(?i)(trust|query|enumerate_principals)`)
)
)
or
// Branch 1c: PowerShell AD trust cmdlets
(
$e.metadata.event_type = "PROCESS_LAUNCH"
and re.regex($e.target.process.file.full_path, `(?i)\\(powershell|pwsh)\.exe$`)
and (
re.regex($e.target.process.command_line, `(?i)(Get-ADTrust|Get-ADForest|Get-ADDomain)`) or
re.regex($e.target.process.command_line, `(?i)(trustedDomain|trustDirection|trustAttributes)`) or
re.regex($e.target.process.command_line, `(?i)(DsEnumerateDomainTrusts|NetEnumerateTrustedDomains)`)
)
)
or
// Branch 1d: dsquery.exe targeting trust objects
(
$e.metadata.event_type = "PROCESS_LAUNCH"
and re.regex($e.target.process.file.full_path, `(?i)\\dsquery\.exe$`)
and re.regex($e.target.process.command_line, `(?i)(trustedDomain|trust)`)
)
or
// Branch 2: LDAP directory access to trustedDomain objects (Event ID 4662)
(
$e.metadata.event_type = "USER_RESOURCE_ACCESS"
and $e.metadata.product_event_type = "4662"
and (
re.regex($e.target.resource.name, `(?i)(trustedDomain|domainDNS)`)
)
)
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting AD trust enumeration for T1590.003. Covers process-based enumeration (nltest, netdom, PowerShell, dsquery) via PROCESS_LAUNCH events and LDAP-based trustedDomain object access via USER_RESOURCE_ACCESS events mapped from Windows Security Event ID 4662.
Data Sources
Required Tables
False Positives & Tuning
- Microsoft Identity Manager (MIM) or Entra Connect sync agents enumerating AD trusts during synchronization cycles
- Red team or penetration testing exercises authorized by the security team using standard AD enumeration tooling
- Automated onboarding scripts for new domain-joined servers that query trust topology to configure Kerberos delegation settings
Other platforms for T1590.003
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Enumerate Domain Trusts via nltest.exe
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\nltest.exe, CommandLine='/domain_trusts /all_trusts'. Security Event ID 4688 (with command line auditing): same command line data. Parent process will be cmd.exe or powershell.exe depending on execution context.
- Test 2Enumerate Active Directory Trusts via PowerShell Get-ADTrust
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ADTrust'. PowerShell ScriptBlock Log Event ID 4104 with full script content including trust properties being queried. LDAP query to Domain Controller on port 389 for trustedDomain objects (visible in Sysmon Event ID 3 if DC is remote).
- Test 3Query AD Forest Trust Information via PowerShell Get-ADForest
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ADForest'. PowerShell ScriptBlock Log Event ID 4104 with the full script. Directory access Event ID 4662 on Domain Controllers for crossRefContainer and crossRef object reads. Sysmon Event ID 3 for LDAP connection to DC on port 389.
- Test 4Enumerate Domain Trusts via netdom.exe
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\netdom.exe, CommandLine containing 'query' and 'trust'. Security Event ID 4688 (with command line auditing) recording the full command line. The tool will contact the nearest Domain Controller to resolve trust information.
- Test 5LDAP Query for trustedDomain Objects via dsquery
Expected signal: Sysmon Event ID 1: Process Create with Image=C:\Windows\System32\dsquery.exe, CommandLine containing 'trustedDomain'. On the Domain Controller: Security Event ID 4662 with ObjectType=trustedDomain for each trust object read. Multiple 4662 events will fire — one per trusted domain object in the directory.
References (10)
- https://attack.mitre.org/techniques/T1590/003/
- https://attack.mitre.org/techniques/T1482/
- https://www.slideshare.net/rootedcon/carlos-garca-pentesting-active-directory-forests-rooted2019
- https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/forest-design-models
- https://learn.microsoft.com/en-us/defender-for-identity/lateral-movement-alerts
- https://github.com/BloodHoundAD/BloodHound
- https://learn.microsoft.com/en-us/sysinternals/downloads/adexplorer
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc731320(v=ws.11)
- https://specterops.io/wp-content/uploads/sites/3/2022/06/an_ace_up_the_sleeve.pdf
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662
Unlock Pro Content
Get the full detection package for T1590.003 including response playbook, investigation guide, and atomic red team tests.