Two Active Directory settings the PHP2Shell firewall intruders leaned on: set an account lockout threshold and drop MachineAccountQuota to 0
In the Dream case, the domain had lockoutThreshold=0, so the attacker could spray passwords at every account without limit, and the default MachineAccountQuota let any authenticated account try to add machine accounts.
- Run
Get-ADDefaultDomainPasswordPolicyand set a lockout threshold that fits your helpdesk load (with fine-grained policies for service accounts if needed). - Run
Get-ADObject (Get-ADDomain).DistinguishedName -Properties ms-DS-MachineAccountQuotaand set it to 0, delegating computer joins to a specific group instead. - Treat LDAP service accounts used by firewalls and VPNs as high value: least privilege, long random passwords, and alerts when they log on from anything but the appliance.
Sources: Dream Research: Chained PHP2Shell Exploit Roots 25 Servers, including US Government Servers (Oct 26) · Microsoft Learn: Account lockout threshold