Users Can Add Computers to the Domain
Any domain user can create computer accounts, giving an attacker accounts they fully control for use in Kerberos delegation, relay and certificate attacks.
| Severity | Medium |
| CVSS 3.1 | 4.3 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N Open in the calculator |
| CVSS 4.0 | 5.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1188: Initialization of a Resource with an Insecure Default |
| MITRE ATT&CK | T1136.002 Domain Account, T1078.002 Domain Accounts |
| Category | Security Misconfiguration |
Description
The domain lets ordinary users join computers to it, which creates computer accounts in the directory. Two settings control this: the ms-DS-MachineAccountQuota attribute on the domain object, which sets how many computer accounts each user may create and is 10 by default, and the Add workstations to domain user right, which the Default Domain Controllers Policy grants to Authenticated Users. Unless one of them has been changed, every domain user can create up to ten computer accounts.
The user chooses the new account's name and password, and the account is a full domain principal: it can authenticate with Kerberos and NTLM, belongs to Domain Computers, and can be given service principal names. An attacker who creates one therefore holds an account with a known password and a service principal name, a common building block in Active Directory attacks. Resource-based constrained delegation attacks need such an account: where the attacker can also write to a computer object's msDS-AllowedToActOnBehalfOfOtherIdentity attribute, for example by relaying an NTLM authentication to LDAP, they can impersonate users on that computer, including administrators who are not protected from delegation. The account can also enrol in certificate templates open to Domain Computers, and creating one was a step in the noPac attack. On its own the setting gives no extra access to data; its impact comes from the other weaknesses it helps to exploit.
The setting is identified by reading ms-DS-MachineAccountQuota from the domain object, which any domain user can do, and checking who holds the Add workstations to domain right. It can be confirmed by creating a computer account as a low-privileged user, for example with Impacket's addcomputer.py or Powermad, which an administrator should then remove. Accounts created under the quota record their creator in the ms-DS-CreatorSID attribute.
Remediation
- Set
ms-DS-MachineAccountQuotato 0 on the domain object, so that ordinary users can no longer create computer accounts (example below). - Before the change, find out how devices are joined, by service desk staff or by build and deployment tools, and delegate the Create Computer objects permission to those accounts or groups on the organisational units where new computers belong, or pre-stage computer accounts and name who may join each one.
- Optionally, remove Authenticated Users from the Add workstations to domain right in the Default Domain Controllers Policy (Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\User Rights Assignment); accounts with delegated permission on an organisational unit do not need it.
- Review existing computer accounts whose
ms-DS-CreatorSIDis an ordinary user, and disable or delete any that do not belong to a managed device.
Confirm the fix by reading the attribute again and by attempting to create a computer account as an ordinary user, which should now fail.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.