PAM Trust

Enumerating PAM trust

Enumerate if our current forest has any PAM trust with any other forest

Using the ADModule, we can simply run Get-ADTrust and look for a trust which has ForestTransitive set to True and SIDFilteringQuarantined set to False - this means that SID Filtering is disabled.

Enumerate if your current forest is managed by a bastion forest

Look for ForestTransitive set to True and SIDFilteringForestAware set to True. In this case, TrustAttributes is also a very good indicator. It is 0x00000400 (1024 in decimal) for PAM/PIM trust. Simplifying it, it is 1096 for PAM + External Trust + Forest Transitive.

INSERT IMAGE

Enumerate the shadow security principals

Enumerate the members from the current (bastion) forest and privileges in the user/production forest.

Run with Active Directory module Get-ADObject

Please note that if Kerberos AES Encryption is not enabled for the PAM trust, we need to add the machines of existing forest in WSMan TrustedHosts and use '-Authentication Negotiate' option with PowerShell remoting cmdlets.

Add user to shadow security principal

Adding user oneliner

Import below script and execute below command.

Add-ADShadowGroupMember.ps1

References

Last updated