-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial NTLM Implementation #177
base: v4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, mostly style comments and naming conventions that I think we can improve on
recheck |
# Conflicts: # src/CommonLib/LdapConnectionPool.cs
throw new ArgumentException("Url property is null"); | ||
|
||
if (useBadChannelBindings == null && url.Scheme == "https") | ||
throw new ArgumentException("When using HTTPS, useBadChannelBindings must be set"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking, but trinary args like this tend to create some funky logic flows that can be hard to follow if you're smooth-brained like I am.
Here I think we're taking on some complexity by managing arg validations that the callers could be doing instead.
I might split this into two functions for clarity: the public function that does everything up to this point, then a private EnsureRequiresAuth(Uri url, bool useBadChannelBindings)
that this one calls, feeding the appropriate coerced useBadChannelBindings
:
EnsureRequiresAuth(url, useBadChannelBindings ?? true);
return schemes; | ||
} | ||
|
||
private async Task AuthWithBadChannelBindings(Uri url, string authScheme) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use "-Async" suffix
@@ -2,7 +2,7 @@ | |||
|
|||
namespace SharpHoundCommonLib.OutputTypes | |||
{ | |||
public class AceRegistryAPIResult : APIResult | |||
public class AceRegistryAPIResult : APIResult.APIResult |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer the namespace and class had different names but not a blocker
public TypedPrincipal[] AllowedToAct { get; set; } = Array.Empty<TypedPrincipal>(); | ||
public TypedPrincipal[] HasSIDHistory { get; set; } = Array.Empty<TypedPrincipal>(); | ||
public TypedPrincipal[] DumpSMSAPassword { get; set; } = Array.Empty<TypedPrincipal>(); | ||
public TypedPrincipal[] AllowedToDelegate { get; set; } = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This syntax may not compile with older dotnet sdks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this syntax feature isn't available til dotnet 8
Feature 'collection expressions' is not available in C# 11.0. Please use language version 12.0 or greater.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks dotnet fiddle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This is the initial implementation of the new NTLM modelling, courtesy of @leechristensen .
Motivation and Context
https://specterops.atlassian.net/browse/BED-5113
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: