Detect Network Trust Dependencies in Splunk
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/
SPL Detection Query
index=wineventlog (
(sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1)
OR
(sourcetype="WinEventLog:Security" EventCode=4662)
)
| eval DetectionBranch=case(
EventCode=1 AND (match(Image, "(?i)\\\\nltest\.exe$") AND match(CommandLine, "(?i)(/domain_trusts|/all_trusts|/trusted_domains|/dclist|/parentdomain)")), "NltestTrustEnum",
EventCode=1 AND (match(Image, "(?i)\\\\netdom\.exe$") AND match(CommandLine, "(?i)(trust|query|enumerate_principals)")), "NetdomTrustEnum",
EventCode=1 AND (match(Image, "(?i)\\\\(powershell|pwsh)\.exe$") AND match(CommandLine, "(?i)(Get-ADTrust|Get-ADForest|Get-ADDomain|domain_trusts|trustedDomain|trustDirection|trustAttributes|DsEnumerateDomainTrusts)")), "PowerShellADTrustEnum",
EventCode=1 AND (match(Image, "(?i)\\\\net\.exe$") AND match(CommandLine, "(?i)/domain")), "NetViewDomainEnum",
EventCode=1 AND (match(Image, "(?i)\\\\dsquery\.exe$") AND match(CommandLine, "(?i)(trustedDomain|trust)")), "DsqueryTrustEnum",
EventCode=4662 AND match(ObjectType, "(?i)(trustedDomain|domainDNS)"), "LDAPTrustedDomainAccess",
true(), null()
)
| where isnotnull(DetectionBranch)
| eval Actor=case(
EventCode=1, User,
EventCode=4662, SubjectUserName,
"unknown"
)
| eval TargetObject=case(
EventCode=1, CommandLine,
EventCode=4662, ObjectName,
""
)
| eval ParentProcess=case(
EventCode=1, ParentImage,
true(), ""
)
| table _time, host, Actor, Image, TargetObject, ParentProcess, DetectionBranch
| sort - _time Detects network trust enumeration using Sysmon Event ID 1 (process creation) and Windows Security Event ID 4662 (directory object access). Sysmon branch covers nltest.exe with trust-query flags, netdom.exe trust operations, PowerShell AD trust cmdlets, net.exe domain enumeration, and dsquery.exe targeting trustedDomain objects. Security log branch catches LDAP-level reads against trustedDomain and domainDNS AD object types — effective against custom tooling that avoids spawning known enumeration binaries. Results include actor, target object, parent process, and detection category for rapid analyst triage.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Domain administrators legitimately running nltest.exe /domain_trusts during infrastructure audits or troubleshooting inter-domain authentication issues
- Automated monitoring scripts using Get-ADTrust or Get-ADForest to verify trust health and alert on unexpected trust additions
- Identity governance tools (SailPoint, Saviynt, CyberArk) that enumerate domain trusts during discovery scans
- Microsoft Entra Connect (Azure AD Connect) synchronization service regularly querying forest/domain trust topology
- IT helpdesk staff troubleshooting cross-domain resource access using netdom.exe or nltest.exe
- Security posture assessment tools (Bloodhound Enterprise, Purple Knight) authorized to enumerate AD trust relationships
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.