Domain Trust Discovery
Adversaries may attempt to gather information on domain trust relationships that may be used to identify lateral movement opportunities in Windows multi-domain/forest environments. Domain trusts provide a mechanism for a domain to allow access to resources based on the authentication procedures of another domain. Adversaries use utilities like nltest.exe, AdFind, PowerShell .NET methods (Get-ADTrust, GetAllTrustRelationships), LDAP queries, and tools like Rubeus to enumerate bidirectional, one-way, forest, and external trusts. This information facilitates SID-History Injection, Pass the Ticket, Kerberoasting, and lateral movement across trust boundaries. Widely observed in ransomware pre-encryption reconnaissance by groups including BlackByte, Akira, QakBot, IcedID, and Chimera.
let NltestTrustArgs = dynamic([
"/domain_trusts", "/all_trusts", "/dclist:", "/trusted_domains",
"/domain_trusts /all_trusts"
]);
let AdfindTrustArgs = dynamic([
"trustdmp", "trustedDomain", "objectclass=trusteddomain",
"-f\"(objectcategory=trusteddomain)\"", "-f (objectcategory=trusteddomain)"
]);
let PsTrustPatterns = dynamic([
"Get-ADTrust", "GetAllTrustRelationships", "DSEnumerateDomainTrusts",
"GetCurrentDomainTrustRelationships", "GetTrustedDomains",
"System.DirectoryServices.ActiveDirectory.Domain",
"netapi32", "DsEnumerateDomainTrusts"
]);
let TrustBinaries = dynamic(["nltest.exe", "adfind.exe", "adfind64.exe"]);
// Branch 1: nltest.exe and AdFind direct execution
let BinaryTrustDiscovery = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (TrustBinaries)
| where ProcessCommandLine has_any (NltestTrustArgs)
or (FileName =~"adfind.exe" and ProcessCommandLine has_any (AdfindTrustArgs))
or (FileName =~"adfind64.exe" and ProcessCommandLine has_any (AdfindTrustArgs))
| extend TrustTool = "nltest/adfind"
| extend TrustMethod = case(
ProcessCommandLine has "/domain_trusts", "nltest-domain_trusts",
ProcessCommandLine has "/dclist", "nltest-dclist",
ProcessCommandLine has "trustdmp", "adfind-trustdmp",
ProcessCommandLine has "trusteddomain", "adfind-ldap-trust",
"other"
);
// Branch 2: PowerShell and .NET-based trust enumeration
let PsTrustDiscovery = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine has_any (PsTrustPatterns)
| extend TrustTool = "PowerShell"
| extend TrustMethod = case(
ProcessCommandLine has "Get-ADTrust", "ps-Get-ADTrust",
ProcessCommandLine has "GetAllTrustRelationships", "ps-GetAllTrustRelationships",
ProcessCommandLine has "DSEnumerateDomainTrusts", "ps-DSEnumerateDomainTrusts",
"ps-other"
);
// Branch 3: net.exe commands revealing domain/forest info used in trust context
let NetTrustDiscovery = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("net.exe", "net1.exe")
| where ProcessCommandLine has_any ("view /domain", "group \"Domain Admins\"")
and InitiatingProcessFileName in~ ("nltest.exe", "adfind.exe", "powershell.exe", "cmd.exe", "wscript.exe", "cscript.exe")
| extend TrustTool = "net.exe"
| extend TrustMethod = "net-domain-enum";
union BinaryTrustDiscovery, PsTrustDiscovery, NetTrustDiscovery
| project Timestamp, DeviceName, AccountName, AccountDomain,
FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessAccountName,
TrustTool, TrustMethod
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Domain administrators running nltest /domain_trusts as part of AD health checks or troubleshooting connectivity between trusted domains
- IT infrastructure monitoring tools (SolarWinds, ManageEngine AD Manager) that enumerate trust relationships for topology mapping and alerting
- Scripted onboarding or provisioning automation that calls Get-ADTrust to validate forest membership before deploying resources
- Penetration testing or red team exercises with pre-approved scope documents — verify against change management records
- SIEM/SOAR playbooks that enumerate domain trusts to populate CMDB or enrich security incidents
References (10)
- https://attack.mitre.org/techniques/T1482/
- https://posts.specterops.io/a-guide-to-attacking-domain-trusts-971e52cb2944
- https://adsecurity.org/?p=1588
- https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc759554(v=ws.10)
- https://docs.microsoft.com/en-us/dotnet/api/system.directoryservices.activedirectory.domain.getalltrustrelationships
- https://www.microsoft.com/security/blog/2017/05/04/windows-defender-atp-thwarts-operation-wilysupply-software-supply-chain-cyberattack/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1482/T1482.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_nltest_recon.yml
- https://thedfirreport.com/2020/10/08/ryuks-return/
- https://www.arcticicwolf.com/resource-library/akira-ransomware-actor-ttps
Unlock Pro Content
Get the full detection package for T1482 including response playbook, investigation guide, and atomic red team tests.