Skip to content

Trust Audit

belettetimoree edited this page Nov 1, 2026 · 1 revision

Trust Audit - --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.

Framework

The audit builds on two bodies of prior work:

  • Carsten Sandker - the authoritative reading of trustAttributes for 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.

CLI Flags

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.

Detections

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).

Example

soaphound --trust-audit \
  -u alice -p 'Password123!' \
  -d corp.local \
  -dc dc01.corp.local -dc-ip 10.0.0.10 \
  --output-dir /tmp/trust-audit

Example 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.

OpSec Notes

  • Transport: tcp/9389 only. One session per DC that owns a partition (CN=Partitions on the connected DC, plus one additional session per referred DC).
  • DC-side events: 5156 on each ADWS connection; 1644 on 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.

References

Clone this wiki locally