Summary
Certain SCCM accounts unintentionally inherit privileges such that they become highly overprivileged over time. The canonical example of this is task sequence domain join account. When an account joins a computer to the domain, the account gains ownership over the computer. Ownership allows the owner to modify the security description on the object, regardless of the explicit permissions in the object’s DACL. Therefore, the account can modify the DACL on the object and grant itself any privilege (i.e., full control of the object). When combined with CRED-1, this becomes extremely dangerous, as an attacker could potentially retrieve the task sequence domain join account credentials and takeover any computer it owns. This can be abused to grant the account the ability to read LAPS passwords, perform Kerberos resource-based constrained delegation, and various other attacks. At SpecterOps, we’ve seen this account have ownership over hundreds of thousands of computers, including domain controllers. We recommend auditing the permissions of the task sequence domain join account, and any other SCCM account as outlined in PREVENT-10. Remove computer ownership from the domain join account and assign it to theDomain Admins group.
We can use the following PowerShell script to:
- Create the necessary
System.Security.Principal.NTAccountobject forSetOwner - Enumerate all computers with a name like
win11* - Iterate over each computer, creating an ACL variable for each
- Set the owner on each ACL to the account specificed in
$user
Linked Defensive IDs
Associated Offensive IDs
- CRED-1: Retrieve secrets from PXE boot media
- CRED-2: Request computer policy and deobfuscate secrets
- CRED-3: Dump currently deployed secrets via WMI
- CRED-4: Retrieve legacy secrets from the CIM repository
- CRED-5: Dump credentials from the site database
References
- Wolfgang Sommergut, Change the Owner of Computer Objects in Active Directory, https://4sysops.com/archives/change-the-owner-of-computer-objects-in-active-directory/
- Elad Shamir, Wagging the Dog: Abusing Resource-Based Constrained Delegation to Attack Active Directory, https://eladshamir.com/2019/01/28/Wagging-the-Dog.html