Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate Attack Path created when ObjectType specified in ACE #613

Open
5 of 11 tasks
lbrauns opened this issue May 16, 2024 · 6 comments
Open
5 of 11 tasks

Inaccurate Attack Path created when ObjectType specified in ACE #613

lbrauns opened this issue May 16, 2024 · 6 comments
Labels
bug Something isn't working ticketed Ticket has been created internally for tracking

Comments

@lbrauns
Copy link

lbrauns commented May 16, 2024

Description:

In the domain i am analyzing (BHE) the EXCHANGE RECIPIENT ADMINISTRATORS are shown with a lot of WriteDacl and WriteOwner edges. Even to the Domain Root Object:

image

The only existing ACL that could produce this edge are ACL on the domain root object where the EXCHANGE RECIPIENT ADMINISTRATORS receive CreateChild, DeleteChild, Self, WriteProperty, DeleteTree, ExtendedRight, Delete, WriteDacl, WriteOwner on the object type ms-Exch-Dynamic-Distribution-List.

Full ACL:

InheritedObjectType   : All
ObjectDN              : DC=CHILDDOMAIN,DC=net
ObjectType            : ms-Exch-Dynamic-Distribution-List
IdentityReference     : PARENTDOMAIN\Exchange Recipient Administrators
IsInherited           : False
ActiveDirectoryRights : CreateChild, DeleteChild, Self, WriteProperty, DeleteTree, ExtendedRight, Delete, WriteDacl, WriteOwner
PropagationFlags      : None
ObjectFlags           : ObjectAceTypePresent
InheritanceFlags      : ContainerInherit
InheritanceType       : All
AccessControlType     : Allow
ObjectSID             : S-1-5-21-[REDACTED]
TargetObjectType      : DomainRoot

In this case the EXCHANGE RECIPIENT ADMINISTRATORS comes from a parent domain and the privileges are present on the child domain root object, this might be relevant.

This is a false positive and creates a LOT of unnecessary edges.

Component(s) Affected:

  • UI
  • API
  • Neo4j
  • PostgreSQL
  • Data Collector (SharpHound, AzureHound)
  • Other (tooling, documentation, etc.)

Steps to Reproduce:

  1. Create environment with parent and child domain
  2. Install Exchange Organization in the parent domain in Active Directory Split Permission mode.
  3. Verify EXCHANGE RECIPIENT ADMINISTRATORS have a permission on the domain root object of the child domain
  4. Collect data and run analysis
  5. Check outbound control of EXCHANGE RECIPIENT ADMINISTRATORS

Expected Behavior:

Edges should not be created as permissions on the object type ms-Exch-Dynamic-Distribution-List are not abusable.

Actual Behavior:

EXCHANGE RECIPIENT ADMINISTRATORS show outbound control over all objects in the domain.

Screenshots/Code Snippets/Sample Files:

If applicable, add screenshots, relevant code snippets, or sample files that help illustrate the issue.

Environment Information:

BloodHound: Bloodhound Enterprise

Collector: Sharphound 2.3.10.0

Contributor Checklist:

  • I have searched the issue tracker to ensure this bug hasn't been reported before or is not already being addressed.
  • I have provided clear steps to reproduce the issue.
  • I have included relevant environment information details.
  • I have attached necessary supporting documents.
  • I have checked that any JSON files I am attempting to upload to BloodHound are valid.
@lbrauns lbrauns added bug Something isn't working triage This issue requires triaging labels May 16, 2024
@JonasBK
Copy link
Collaborator

JonasBK commented May 16, 2024

Hey @lbrauns,

Thanks for reporting this.

I have Exchange configured in the AD split model in my lab, but I do not have the EXCHANGE RECIPIENT ADMINISTRATORS group at all. I guess it depends on the Exchange version.

Is it possible for you to send a screenshot of the ACE(s) the group has on the domain? Potentially from ldp.exe. Then I will try to create it manually in my lab.

@JonasBK
Copy link
Collaborator

JonasBK commented May 16, 2024

Oh, you added the ACE. never mind!

@JonasBK
Copy link
Collaborator

JonasBK commented May 16, 2024

I just confirmed in my lab that these edges are being generated when creating the given ACE granted to a user, and the user is not able to modify the DACL or change the owner.

When I remove the object type, then I can do those things. So it seems we should confirm that object type is not set before creating WriteDacl and WriteOwner edges. Do you agree @lbrauns?

@JonasBK
Copy link
Collaborator

JonasBK commented May 16, 2024

Just confirmed that a clean WriteDacl ACE does not work when object type is set.

@lbrauns
Copy link
Author

lbrauns commented May 16, 2024

I just confirmed in my lab that these edges are being generated when creating the given ACE granted to a user, and the user is not able to modify the DACL or change the owner.

When I remove the object type, then I can do those things. So it seems we should confirm that object type is not set before creating WriteDacl and WriteOwner edges. Do you agree @lbrauns?

I am not sure if it is sufficient to check for the presence of an object type. The GUID map of the directory contains abusable object types as well, for example ms-DS-Key-Credential-Link is in there (but is already covered by SharpHound anyways). There might be more abusable object types contained there.

@JonasBK
Copy link
Collaborator

JonasBK commented May 17, 2024

Yes, you are right. We should only avoid creating WriteDacl and WriteOwner if an object type is set. Maybe also GenericAll - I need to test that. We should still create edges like WriteAccountRestrictions that depends on the object type to be set 👍

@StephenHinck StephenHinck added ticketed Ticket has been created internally for tracking and removed triage This issue requires triaging labels May 17, 2024
@StephenHinck StephenHinck changed the title Wrong Identification Of ACL Paths Inaccurate Attack Path created when ObjectType specified in ACE May 17, 2024
@slokie-so slokie-so added ticketed Ticket has been created internally for tracking and removed ticketed Ticket has been created internally for tracking labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ticketed Ticket has been created internally for tracking
Projects
None yet
Development

No branches or pull requests

4 participants