These changes fix a System.ArgumentException in SidToDomainName when the SID is invalid.
This occurs when looking up foreign security principals with a name conflict. When this happens SharpHound will attempt to create a SecurityIdenifier from a string similar to S-1-5-21-123456789-123456789-123456789-123\0ACNF:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee which will fail due to the invalid format.
These changes fix a
System.ArgumentException
inSidToDomainName
when the SID is invalid.This occurs when looking up foreign security principals with a name conflict. When this happens SharpHound will attempt to create a
SecurityIdenifier
from a string similar to S-1-5-21-123456789-123456789-123456789-123\0ACNF:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee which will fail due to the invalid format.