域信任发现是攻击者在Windows多域/林环境中枚举域间信任关系以寻找横向移动路径的关键技术,涉及通过DSEnumerateDomainTrusts() API、nltest工具或LDAP查询等方式获取信任域列表。传统检测主要监控进程行为(如nltest /domain_trusts调用)、API调用序列(如GetAllTrustRelationships()方法)及LDAP查询特征。防御方可通过审计日志分析、RPC流量监控等手段识别异常域信任枚举行为。
当前域信任发现匿迹技术的共性在于对系统信任机制的逆向利用与协议规范的创造性突破。合法API调用技术通过"Living-off-the-Land"策略将恶意代码寄生在系统进程内,复用微软签名的二进制文件执行侦察操作;跨域日志伪造技术针对审计体系的完整性弱点,构建虚假行为轨迹干扰事件关联分析;协议元数据伪装则突破传统协议解析器的检测深度,在协议合规的表象下传输恶意查询指令。三者共同构建了从主机层到网络层的全栈匿迹能力:在主机层利用系统白名单机制规避进程检测,在日志层破坏审计证据链完整性,在网络层借助合法协议通道隐藏恶意流量。这种多层匿迹体系使得传统基于单一维度检测的防御方案完全失效,攻击者得以在域控制器、SIEM系统、网络防火墙等多个防御节点的盲区中实施隐蔽侦察。
| 效应类型 | 是否存在 |
|---|---|
| 特征伪装 | ✅ |
| 行为透明 | ❌ |
| 数据遮蔽 | ✅ |
| 时空释痕 | ✅ |
攻击者通过复用系统管理工具的数字签名、模仿LDAP/DNS协议交互模式,将域信任发现行为伪装成合法的域管理操作。例如将恶意查询指令嵌入LDAP分页查询控件或DNS扩展字段,使网络流量呈现合规协议特征,规避基于协议解析的检测规则。
在跨域协议元数据伪装场景中,攻击者利用TLS加密通道传输改造后的LDAP请求,使中间设备无法解析被加密的协议元数据字段。同时采用内存加密技术保护API调用过程中的敏感参数,避免EDR解决方案捕获明文侦察指令。
通过将域信任查询任务拆解为低频次、跨域的分散请求,例如每周在不同子域控制器发起单次LDAP查询,利用跨域信任关系的自动同步机制间接获取全局信息。这种长周期、跨域的空间分散策略稀释了攻击特征,使得传统基于单域短周期行为分析的检测模型难以有效识别。
| ID | Name | Description |
|---|---|---|
| S0552 | AdFind |
AdFind can gather information about organizational units (OUs) and domain trusts from Active Directory.[1][2][3][4] |
| G1024 | Akira |
Akira uses the built-in Nltest utility or tools such as AdFind to enumerate Active Directory trusts in victim environments.[5] |
| S1081 | BADHATCH |
BADHATCH can use |
| S0534 | Bazar |
Bazar can use Nltest tools to obtain information about the domain.[7][8] |
| S0521 | BloodHound |
BloodHound has the ability to map domain trusts and identify misconfigurations for potential abuse.[9] |
| S1063 | Brute Ratel C4 |
Brute Ratel C4 can use LDAP queries and |
| C0015 | C0015 |
During C0015, the threat actors used the command |
| G0114 | Chimera |
Chimera has |
| S0105 | dsquery |
dsquery can be used to gather information on domain trusts with |
| S1159 | DUSTTRAP |
DUSTTRAP can identify Active Directory information and related items.[15] |
| G1006 | Earth Lusca |
Earth Lusca has used Nltest to obtain information about domain controllers.[16] |
| S0363 | Empire | |
| G0061 | FIN8 |
FIN8 has retrieved a list of trusted domains by using |
| S0483 | IcedID | |
| S1160 | Latrodectus |
Latrodectus can run |
| G0059 | Magic Hound |
Magic Hound has used a web shell to execute |
| S1146 | MgBot |
MgBot includes modules for collecting information on local domain users and permissions.[24] |
| S0359 | Nltest |
Nltest may be used to enumerate trusted domains by using commands such as |
| S1145 | Pikabot |
Pikabot will gather information concerning the Windows Domain the victim machine is a member of during execution.[27] |
| S0378 | PoshC2 | |
| S0194 | PowerSploit |
PowerSploit has modules such as |
| S0650 | QakBot |
QakBot can run |
| S1071 | Rubeus | |
| S1124 | SocGholish |
SocGholish can profile compromised systems to identify domain trust relationships.[34][35] |
| C0024 | SolarWinds Compromise |
During the SolarWinds Compromise, APT29 used the |
| S0266 | TrickBot |
TrickBot can gather information about domain trusts by utilizing Nltest.[26][39] |
| ID | Mitigation | Description |
|---|---|---|
| M1047 | Audit |
Map the trusts within existing domains/forests and keep trust relationships to a minimum. |
| M1030 | Network Segmentation |
Employ network segmentation for sensitive domains.[14]. |
| ID | Data Source | Data Component | Detects |
|---|---|---|---|
| DS0017 | Command | Command Execution |
Monitor executed commands and arguments for actions that could be taken to gather system and network information, such as nltest /domain_trusts. Remote access tools with built-in features may interact directly with the Windows API to gather information. |
| DS0029 | Network Traffic | Network Traffic Content |
Monitor and analyze traffic patterns and packet inspection associated to LDAP and MSRPC that do not follow the expected protocol standards and traffic flows (e.g extraneous packets that do not belong to established flows, gratuitous or anomalous traffic patterns, anomalous syntax, or structure). |
| DS0009 | Process | OS API Execution |
Monitor for API calls associated with gathering information on domain trust relationships that may be used to identify lateral movement like DSEnumerateDomainTrusts() Win32 API call to spot activity associated with Domain Trust Discovery.[14] Information may also be acquired through Windows system management tools such as PowerShell. The .NET method GetAllTrustRelationships() can be an indicator of Domain Trust Discovery.[40] |
| Process Creation |
Monitor for newly executed processes that may attempt to gather information on domain trust relationships that may be used to identify lateral movement opportunities in Windows multi-domain/forest environments. |
||
| DS0012 | Script | Script Execution |
Monitor for any attempts to enable scripts running on a system would be considered suspicious. If scripts are not commonly used on a system, but enabled, scripts running out of cycle from patching or other administrator functions are suspicious. Scripts should be captured from the file system when possible to determine their actions and intent. |