From 0bf98fd820f8eaeb8db56ea6ed28c1e8c6c5a603 Mon Sep 17 00:00:00 2001 From: Rohan Vazarkar Date: Wed, 31 Jul 2024 10:13:01 -0400 Subject: [PATCH] chore: update commonlib (#110) chore: skip base labelled items chore: bump version --- Sharphound.csproj | 8 ++++---- src/Runtime/LDAPConsumer.cs | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Sharphound.csproj b/Sharphound.csproj index a04e8d4..ae75dac 100644 --- a/Sharphound.csproj +++ b/Sharphound.csproj @@ -6,8 +6,8 @@ latest full favicon.ico - 2.5.3 - 2.5.3 + 2.5.4 + 2.5.4 SpecterOps SharpHound SharpHound @@ -24,8 +24,8 @@ - - + + diff --git a/src/Runtime/LDAPConsumer.cs b/src/Runtime/LDAPConsumer.cs index 4aa4046..952b0f9 100644 --- a/src/Runtime/LDAPConsumer.cs +++ b/src/Runtime/LDAPConsumer.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Logging; using Sharphound.Client; using SharpHoundCommonLib; +using SharpHoundCommonLib.Enums; using SharpHoundCommonLib.OutputTypes; namespace Sharphound.Runtime @@ -24,11 +25,14 @@ internal static async Task ConsumeSearchResults(Channel inputC await foreach (var item in inputChannel.Reader.ReadAllAsync()) try { - if (await LdapUtils.ResolveSearchResult(item, context.LDAPUtils) is not (true, var res) || res == null) { + if (await LdapUtils.ResolveSearchResult(item, context.LDAPUtils) is not (true, var res) || res == null || res.ObjectType == Label.Base) { + if (item.TryGetDistinguishedName(out var dn)) { + log.LogTrace("Consumer failed to resolve entry for {item} or label was Base", dn); + } continue; } - log.LogTrace("Consumer {ThreadID} started processing {obj}", threadId, res.DisplayName); + log.LogTrace("Consumer {ThreadID} started processing {obj} ({type})", threadId, res.DisplayName, res.ObjectType); watch.Start(); var processed = await processor.ProcessObject(item, res, computerStatusChannel); watch.Stop();