-
Notifications
You must be signed in to change notification settings - Fork 56
Feature: Add collection of Active Directory Sites ACLs and data #257
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
base: v4
Are you sure you want to change the base?
Changes from 7 commits
621b04e
95ac4d1
9214843
a615dce
6fd6029
20d164a
7946b56
4e96f6a
b81e13a
8634f87
c29e4dc
5deab29
78536b6
f3b0463
55553d8
0d1feec
4938653
774f53a
c337e00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -603,3 +603,6 @@ FodyWeavers.xsd | |
| # JetBrains Rider | ||
| .idea/ | ||
| *.sln.iml | ||
|
|
||
| # Codex local workspace state | ||
| .codex | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| using System; | ||
|
|
||
| namespace SharpHoundCommonLib.OutputTypes | ||
| { | ||
| public class Site : OutputBase | ||
| { | ||
| // Subnets and Servers are common site children; keep them optional and empty by default. | ||
| //public string[] Subnets { get; set; } = Array.Empty<string>(); | ||
| //public TypedPrincipal[] Servers { get; set; } = Array.Empty<TypedPrincipal>(); | ||
| public GPLink[] Links { get; set; } = Array.Empty<GPLink>(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace SharpHoundCommonLib.OutputTypes | ||
| { | ||
| public class SiteServer : OutputBase | ||
| { | ||
| public TypedPrincipal SeverIs { get; set; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| namespace SharpHoundCommonLib.OutputTypes | ||
| { | ||
| public class SiteSubnet : OutputBase | ||
| { | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,10 @@ static ACLProcessor() { | |
| { Label.EnterpriseCA, "ee4aa692-3bba-11d2-90cc-00c04fd91ab1" }, | ||
| { Label.NTAuthStore, "3fdfee50-47f4-11d1-a9c3-0000f80367c1" }, | ||
| { Label.CertTemplate, "e5209ca2-3bba-11d2-90cc-00c04fd91ab1" }, | ||
| { Label.IssuancePolicy, "37cfd85c-6719-4ad8-8f9e-8678ba627563" } | ||
| { Label.IssuancePolicy, "37cfd85c-6719-4ad8-8f9e-8678ba627563" }, | ||
| { Label.Site, "bf967ab3-0de6-11d0-a285-00aa003049e2" }, | ||
| { Label.SiteServer, "bf967a92-0de6-11d0-a285-00aa003049e2" }, | ||
| { Label.SiteSubnet, "b7b13124-b82e-11d0-afee-0000f80367c1" } | ||
| }; | ||
| } | ||
|
|
||
|
|
@@ -449,6 +452,11 @@ public IAsyncEnumerable<ACE> ProcessACL(byte[] ntSecurityDescriptor, string obje | |
|
|
||
| public async IAsyncEnumerable<ACE> ProcessACL(byte[] ntSecurityDescriptor, string objectDomain, | ||
| Label objectType, bool hasLaps, bool checkForOwnerRights, string objectName) { | ||
| if (objectType is Label.SiteServer or Label.SiteSubnet) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do these 2 object types not have ACLs?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They do, but there are currently no known attack techniques that abuse permissions such as Because This would be less problematic for Given this, should we include ACL edges on either of these node types anyway? |
||
| _log.LogDebug("Skipping ACL processing for {ObjectType} object {ObjectName}", objectType, objectName); | ||
| yield break; | ||
| } | ||
|
|
||
| await BuildGuidCache(objectDomain); | ||
|
|
||
| if (ntSecurityDescriptor == null) { | ||
|
|
@@ -734,7 +742,10 @@ or Label.RootCA | |
| or Label.EnterpriseCA | ||
| or Label.AIACA | ||
| or Label.NTAuthStore | ||
| or Label.IssuancePolicy) | ||
| or Label.IssuancePolicy | ||
| or Label.Site | ||
| or Label.SiteServer | ||
| or Label.SiteSubnet) | ||
| if (aceType is ACEGuids.AllGuid or "") | ||
| yield return new ACE { | ||
| PrincipalType = resolvedPrincipal.ObjectType, | ||
|
|
@@ -776,7 +787,7 @@ or Label.NTAuthStore | |
| IsPermissionForOwnerRightsSid = isPermissionForOwnerRightsSid, | ||
| IsInheritedPermissionForOwnerRightsSid = isInheritedPermissionForOwnerRightsSid, | ||
| }; | ||
| else if (objectType is Label.OU or Label.Domain && aceType == ACEGuids.WriteGPLink) | ||
| else if (objectType is Label.OU or Label.Domain or Label.Site && aceType == ACEGuids.WriteGPLink) | ||
| yield return new ACE { | ||
| PrincipalType = resolvedPrincipal.ObjectType, | ||
| PrincipalSID = resolvedPrincipal.ObjectIdentifier, | ||
|
|
||
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.
The Properties for site objects will need to be added here as well or ObjectProps will miss it
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.
I'm not sure I get it. Do you want me to add site properties here?

Shouldn't CertAbuseProps also be there then?