Skip to content
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

Rule S-ADRegistration wont trigger if the "ms-DS-MachineAccountQuota" is not set, but adding computers is possible. #216

Open
dcaluzi opened this issue Feb 7, 2024 · 0 comments

Comments

@dcaluzi
Copy link

dcaluzi commented Feb 7, 2024

If the ms-DS-MachineAccountQuota in the Active Directory is "not set" it is possible to add computers to the domain if the SeMachineAccountPrivilege is set to "Authenticated Users".

However the PingCastle rule S-ADRegistration will not detect the issue.

The following lab setup was used to confirm the behaviour:

  • PingCastle version 3.1.0.1
  • ms-DS-MachineAccountQuota: "not set"
  • SeMachineAccountPrivilege: Authenticated Users
    image

PingCastle did not trigger the S-ADRegistration Rule, however adding a computer was possible (in this case using impacket):

$ impacket-addcomputer child.testlab.local/cclear:Welc0me2022! -dc-ip 10.0.1.100 -computer-name EVIL-COMPUTER$ -computer-pass password.123 
Impacket v0.11.0 - Copyright 2023 Fortra

[*] Successfully added machine account EVIL-COMPUTER$ with password password.123.

Computer created in AD:
image

It would be nice if PingCastle could also detect this special case to know if adding machine accounts as domain user is possible. Remediation will stay the same: set the ms-DS-MachineAccountQuota to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant