BloodHoundAD / SharpHoundCommon

Common library used by SharpHound.
GNU General Public License v3.0
73 stars 47 forks source link

Split ResolveHostToSid #108

Closed definitelynotagoblin closed 4 months ago

definitelynotagoblin commented 4 months ago

Description

ResolveHostToSid resolves to a SID when a SID can be resolved, and falls back to a hostname from DNS when a SID cannot be resolved. This produces unwanted behavior when a SID is expected but a hostname is returned, so we split the method in two - one that returns null where no SID can be resolved and another that falls back onto the hostname.

Motivation and Context

https://specterops.atlassian.net/browse/BP-508

Bug in SHS when an AD object is deleted but remains on DNS. Such objects currently are collected and recorded into our BloodHound graphs as empty domain CAs.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

Checklist:

definitelynotagoblin commented 4 months ago

This will need to be merged with appropriate changes to SharpHound, SHS, and any other project that uses ResolveHostToSid from this library.