From 2bd4658d8ab213bfc3c00c90e64eb11ca1a3dd08 Mon Sep 17 00:00:00 2001 From: pixis Date: Sat, 3 Feb 2024 14:28:59 -0800 Subject: [PATCH] Add NTLMv1 flag on GPO --- src/Runtime/ObjectProcessors.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Runtime/ObjectProcessors.cs b/src/Runtime/ObjectProcessors.cs index 7ec9e48..73fbf8f 100644 --- a/src/Runtime/ObjectProcessors.cs +++ b/src/Runtime/ObjectProcessors.cs @@ -32,6 +32,7 @@ public class ObjectProcessors private readonly GroupProcessor _groupProcessor; private readonly LDAPPropertyProcessor _ldapPropertyProcessor; private readonly GPOLocalGroupProcessor _gpoLocalGroupProcessor; + private readonly GPOLmCompatibilityLevelProcessor _gpoLmCompatibilityLevelProcessor; private readonly UserRightsAssignmentProcessor _userRightsAssignmentProcessor; private readonly LocalGroupProcessor _localGroupProcessor; private readonly ILogger _log; @@ -52,6 +53,7 @@ public ObjectProcessors(IContext context, ILogger log) _groupProcessor = new GroupProcessor(context.LDAPUtils); _containerProcessor = new ContainerProcessor(context.LDAPUtils); _gpoLocalGroupProcessor = new GPOLocalGroupProcessor(context.LDAPUtils); + _gpoLmCompatibilityLevelProcessor = new GPOLmCompatibilityLevelProcessor(context.LDAPUtils); _userRightsAssignmentProcessor = new UserRightsAssignmentProcessor(context.LDAPUtils); _localGroupProcessor = new LocalGroupProcessor(context.LDAPUtils); _methods = context.ResolvedCollectionMethods; @@ -71,7 +73,7 @@ internal async Task ProcessObject(ISearchResultEntry entry, case Label.Group: return ProcessGroupObject(entry, resolvedSearchResult); case Label.GPO: - return ProcessGPOObject(entry, resolvedSearchResult); + return await ProcessGPOObject(entry, resolvedSearchResult); case Label.Domain: return await ProcessDomainObject(entry, resolvedSearchResult); case Label.OU: @@ -407,7 +409,7 @@ private async Task ProcessDomainObject(ISearchResultEntry entry, return ret; } - private GPO ProcessGPOObject(ISearchResultEntry entry, + private async Task ProcessGPOObject(ISearchResultEntry entry, ResolvedSearchResult resolvedSearchResult) { var ret = new GPO @@ -436,6 +438,8 @@ private GPO ProcessGPOObject(ISearchResultEntry entry, ret.Properties); } } + ret.NTLMv1Enabled = await _gpoLmCompatibilityLevelProcessor.ReadGPOLmCompatibilityLevel(entry); + ret.Properties.Add("ntlmv1", ret.NTLMv1Enabled); return ret; }