Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

SharpHound can hang when using GPOLocalGroup due to bad regex in LocalGroupHelpers.cs #87

@m0noc

Description

@m0noc

When using the GPOLocalGroup collection method Sharphound threads can hang due to some GPOs having a lowercase "S" in the SID in the GptTmpl.inf file.

The following fixes the issue and is consistent with the previous regex's in the file using 'IgnoreCase':-

paul@kali2017-1:~/tools/SharpHound/Sharphound2/Enumeration$ diff LocalGroupHelpers.cs LocalGroupHelpers.cs.orig
29c29
<         private static readonly Regex ExtractRid = new Regex(@"S-1-5-32-([0-9]{3})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
---
>         private static readonly Regex ExtractRid = new Regex(@"S-1-5-32-([0-9]{3})", RegexOptions.Compiled);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions