From c953260325cbfd335ed2e9726cfe28d4b16357c8 Mon Sep 17 00:00:00 2001 From: Rohan Vazarkar Date: Thu, 21 Nov 2024 11:29:46 -0500 Subject: [PATCH] chore: move group collection to end of our ldap queries (#175) * chore: move group collection to end of our ldap queries * chore: version bump --- src/CommonLib/LdapProducerQueryGenerator.cs | 10 +++++----- src/CommonLib/SharpHoundCommonLib.csproj | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CommonLib/LdapProducerQueryGenerator.cs b/src/CommonLib/LdapProducerQueryGenerator.cs index 1fc7ea73..0d6580f8 100644 --- a/src/CommonLib/LdapProducerQueryGenerator.cs +++ b/src/CommonLib/LdapProducerQueryGenerator.cs @@ -59,11 +59,6 @@ public static GeneratedLdapParameters GenerateDefaultPartitionParameters(Collect }; } - if (methods.HasFlag(CollectionMethod.Group)) { - filter = filter.AddGroups(); - properties.AddRange(CommonProperties.GroupResolutionProps); - } - if (methods.IsComputerCollectionSet()) { filter = filter.AddComputers(); properties.AddRange(CommonProperties.ComputerMethodProps); @@ -89,6 +84,11 @@ public static GeneratedLdapParameters GenerateDefaultPartitionParameters(Collect properties.AddRange(CommonProperties.ComputerMethodProps); } + if (methods.HasFlag(CollectionMethod.Group)) { + filter = filter.AddGroups(); + properties.AddRange(CommonProperties.GroupResolutionProps); + } + return new GeneratedLdapParameters { Filter = filter, Attributes = properties.Distinct().ToArray() diff --git a/src/CommonLib/SharpHoundCommonLib.csproj b/src/CommonLib/SharpHoundCommonLib.csproj index 6c88c8e8..fd5d7aa0 100644 --- a/src/CommonLib/SharpHoundCommonLib.csproj +++ b/src/CommonLib/SharpHoundCommonLib.csproj @@ -9,7 +9,7 @@ Common library for C# BloodHound enumeration tasks GPL-3.0-only https://github.com/BloodHoundAD/SharpHoundCommon - 4.0.8 + 4.0.9 SharpHoundCommonLib SharpHoundCommonLib