Repository navigation
Trust Audit
--trust-audit produces a forest-wide, human-readable audit of every AD trust reachable from the connected domain. For each trust, the four Sandker-dimension decoding is applied to the trustAttributes bitfield, and seven misconfigurations documented in offensive AD literature are flagged with severity codes.
The audit builds on two bodies of prior work:
-
Carsten Sandker - the authoritative reading of
trustAttributesfor the four security-relevant dimensions: transitivity, SID filtering mode, TGT delegation posture, authentication level. -
Almond - the reversibility checks on one-way trusts via TDO extraction (
tdo_dump), which identifies trusts that an attacker can effectively walk in the "wrong" direction.
Both sides of each trust are collected independently. The report lists them as separate rows so that a mismatched trustAttributes between the two TDOs - which does happen in the wild and matters for the audit - is surfaced instead of hidden.
The forest topology is read from CN=Partitions,CN=Configuration (authoritative, replicated across every DC). Each domain NC is queried on its own; when the current ADWS session is not authoritative for the queried partition, the referral is followed on tcp/9389 to the DC named by the server.
| Flag | Purpose |
|---|---|
--trust-audit |
Produce the audit report. Writes <timestamp>_Soaphound_TrustsAudit.txt in the output directory and leaves domains.json unchanged. |
Standard -u/-p/--hashes/-k, -d, -dc, -dc-ip, --output-dir, -op flags apply.
| Code | Severity | Condition |
|---|---|---|
TRUST-01 |
HIGH | Intra-forest SID filtering disabled by default (WITHIN_FOREST set, QUARANTINED_DOMAIN not set). |
TRUST-02 |
HIGH | Forest trust with TREAT_AS_EXTERNAL set alongside FOREST_TRANSITIVE - relaxes SID filtering. |
TRUST-03 |
HIGH | Cross-forest TGT delegation enabled (CROSS_ORGANIZATION_ENABLE_TGT_DELEGATION). |
TRUST-04 |
MEDIUM | External/forest trust without QUARANTINED_DOMAIN. |
TRUST-05 |
MEDIUM | RC4 encryption on inter-realm keys (USES_RC4_ENCRYPTION). |
TRUST-06 |
INFO | PIM / Bastion Forest trust - verify Shadow Principals in the Bastion forest. |
TRUST-07 |
INFO | One-way trust reversibility via TDO extraction (Almond's tdo_dump). |
soaphound --trust-audit \
-u alice -p 'Password123!' \
-d corp.local \
-dc dc01.corp.local -dc-ip 10.0.0.10 \
--output-dir /tmp/trust-auditExample output (abbreviated):
Trust Audit - corp.local
Generated: 2026-11-01 17:04:11
[+] partner.corp (TDO seen from CORP.LOCAL)
trustAttributes: 0x00000020 (QUARANTINED_DOMAIN)
transitivity: non-transitive
SID filter : enabled
TGT deleg. : disabled
auth level : forest-wide
findings : none
[+] partner.corp (TDO seen from PARTNER.CORP)
trustAttributes: 0x00000008 (FOREST_TRANSITIVE)
transitivity: transitive
SID filter : relaxed (TREAT_AS_EXTERNAL not set)
TGT deleg. : disabled
auth level : forest-wide
findings : TRUST-04 (MEDIUM) - forest trust without QUARANTINED_DOMAIN
The report ends with a counts summary (N trusts audited, M findings, X HIGH, Y MEDIUM, Z INFO) and the reference block.
- Transport:
tcp/9389only. One session per DC that owns a partition (CN=Partitionson the connected DC, plus one additional session per referred DC). - DC-side events:
5156on each ADWS connection;1644on NTDS Diagnostics when the per-domain NC pulls hit the configured threshold. - No LDAP (
tcp/389) and no SMB (tcp/445) is used - a monitoring stack scoped to those ports will see nothing. - The audit is read-only; no
5136/5137.
- Carsten Sandker, "The Trouble with Domain Trusts" - https://www.securesystems.de/blog/active-directory-spotlight-trusts/
- Almond, "Active Directory trusts: dangers and vulnerabilities" - https://offsec.almond.consulting/trust-no-one_are-one-way-trusts-really-one-way.html
- Will Schroeder, "Not A Security Boundary: Breaking Forest Trusts" - https://blog.harmj0y.net/redteaming/not-a-security-boundary-breaking-forest-trusts/
- Dirk-jan Mollema, "Active Directory forest trusts part 1" - https://dirkjanm.io/active-directory-forest-trusts-part-one-how-does-sid-filtering-work/
- hacker.recipes, Trust mapping - https://www.thehacker.recipes/ad/movement/trusts
-
src/soaphound/ad/trust_audit_report.py- in-tree implementation