Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Added GenericWrite edge for GPOs #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions Sharphound2/Enumeration/ACLHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,32 @@ public static void GetObjectAces(SearchResultEntry entry, ResolvedEntry resolved
continue;
}

if (rights.HasFlag(ActiveDirectoryRights.GenericWrite) || rights.HasFlag(ActiveDirectoryRights.WriteProperty))
{
if (rights.HasFlag(ActiveDirectoryRights.GenericWrite) &&
(objectAceType == AllGuid || objectAceType == ""))
{
aces.Add(new ACL
{
AceType = "",
RightName = "GenericWrite",
PrincipalName = principal.PrincipalName,
PrincipalType = principal.ObjectType
});
}
else if (rights.HasFlag(ActiveDirectoryRights.WriteProperty) &&
(objectAceType == AllGuid || objectAceType == ""))
{
aces.Add(new ACL
{
AceType = "",
RightName = "GenericWrite",
PrincipalName = principal.PrincipalName,
PrincipalType = principal.ObjectType
});
}
}

if (rights.HasFlag(ActiveDirectoryRights.WriteDacl))
{
aces.Add(new ACL
Expand Down