Skip to content

Commit

Permalink
Additional Organizational Units ACLs (#118)
Browse files Browse the repository at this point in the history
* Adding Organizational Units GenericWrite and ManageGPLink permissions

* Renaming ManageGPLink permission to WriteGPLink

* fix: gPLink guid

* feat: add GenericWrite and WriteGPLink for Domain

---------

Co-authored-by: Jonas Bülow Knudsen <[email protected]>
Co-authored-by: Rohan Vazarkar <[email protected]>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent ea6b097 commit d61b8f7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/CommonLib/EdgeNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static class EdgeNames
public const string AddKeyCredentialLink = "AddKeyCredentialLink";
public const string SQLAdmin = "SQLAdmin";
public const string WriteAccountRestrictions = "WriteAccountRestrictions";
public const string WriteGPLink = "WriteGPLink";

//CertAbuse edges
public const string WritePKIEnrollmentFlag = "WritePKIEnrollmentFlag";
Expand Down
4 changes: 3 additions & 1 deletion src/CommonLib/Processors/ACEGuids.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ public class ACEGuids
public const string WriteSPN = "f3a64788-5306-11d1-a9c5-0000f80367c1";
public const string AddKeyPrincipal = "5b47d60f-6090-40b2-9f37-2a4de88f3063";
public const string UserAccountRestrictions = "4c164200-20c0-11d0-a768-00aa006e0529";
public const string WriteGPLink = "f30e3bbe-9ff0-11d1-b603-0000f80367c1";


//Cert abuse ACEs
public const string PKINameFlag = "ea1dddc4-60ff-416e-8cc0-17cee534bce7";
public const string PKIEnrollmentFlag = "d15ef7d8-f226-46db-ae79-b34e560bd12c";
public const string Enroll = "0e10c968-78fb-11d2-90d4-00c04f79dc55";
public const string AutoEnroll = "a05b8cc2-17bc-4802-a710-e7c15ab866a2"; //TODO: Add this if it becomes abusable
}
}
}
12 changes: 11 additions & 1 deletion src/CommonLib/Processors/ACLProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ public IEnumerable<ACE> ProcessACL(byte[] ntSecurityDescriptor, string objectDom
or Label.Group
or Label.Computer
or Label.GPO
or Label.OU
or Label.Domain
or Label.CertTemplate
or Label.RootCA
or Label.EnterpriseCA
Expand Down Expand Up @@ -419,6 +421,14 @@ or Label.NTAuthStore
IsInherited = inherited,
RightName = EdgeNames.WriteAccountRestrictions
};
else if (objectType is Label.OU or Label.Domain && aceType == ACEGuids.WriteGPLink)
yield return new ACE
{
PrincipalType = resolvedPrincipal.ObjectType,
PrincipalSID = resolvedPrincipal.ObjectIdentifier,
IsInherited = inherited,
RightName = EdgeNames.WriteGPLink
};
else if (objectType == Label.Group && aceType == ACEGuids.WriteMember)
yield return new ACE
{
Expand Down Expand Up @@ -593,4 +603,4 @@ public IEnumerable<ACE> ProcessGMSAReaders(byte[] groupMSAMembership, string obj
}
}
}
}
}

0 comments on commit d61b8f7

Please sign in to comment.