Password Spraying Without Locking Out Your Client

Password spraying is one of the first things people reach for on an internal engagement, and it is also one of the fastest ways to cause real damage to a client. Lock out a few hundred accounts during business hours and you are no longer a quiet assessor. You are an incident. This post is about how to get the credential without becoming the incident.

The whole game is understanding the lockout policy before you send a single authentication attempt, then pacing yourself under it with margin to spare.

How account lockout actually works

Active Directory tracks failed authentication per account using an attribute called badPwdCount. Three policy values govern what happens to it:

  • lockoutThreshold — the number of bad password attempts that trigger a lockout. If this is 0, lockout is disabled and you have far more room (though that is rare in a mature environment).
  • lockoutObservationWindow — the rolling window over which bad attempts are counted. After this much time passes with no new failures, badPwdCount effectively resets to zero.
  • lockoutDuration — how long an account stays locked once the threshold is hit. This must be greater than or equal to the observation window.

Two details matter for pacing. First, badPwdCount is reset when the account authenticates successfully, and it decays based on the observation window rather than a fixed clock reset. Second, and this one bites people, badPwdCount is not replicated between domain controllers. Each DC maintains its own counter. A DC with the PDC emulator role is consulted on a near-miss before a lockout is declared, but if you spread attempts across multiple DCs you can get surprising behaviour. The safe assumption is to treat the threshold as if every attempt lands on the same counter.

Fine-grained password policies change the math

The default domain policy is not the whole story. Since Server 2008, domains can define Password Settings Objects (PSOs), also called fine-grained password policies. A PSO can set its own lockout threshold and observation window for specific users or groups, and it overrides the default domain policy for anyone it applies to.

This means admins and service accounts frequently sit under a different, often stricter, policy than ordinary users. If you enumerate only the default domain policy and then spray a group that a PSO covers, your careful cadence can be wrong for exactly the high-value accounts you most wanted to avoid locking. Enumerate PSOs explicitly.

Enumerate the policy first

You never spray blind. Pull the default policy over SMB with NetExec (or CrackMapExec, same flag):

nxc smb dc01.corp.local -u jdoe -p 'Passw0rd!' --pass-pol

That returns the lockout threshold, observation window, lockout duration, minimum password length and complexity flags. If you only have a foothold and no creds yet, a null or guest session sometimes still yields the policy, and ldapsearch against the domain root works too:

ldapsearch -x -H ldap://10.0.0.10 -D 'jdoe@corp.local' -w 'Passw0rd!' \
  -b 'DC=corp,DC=local' -s base \
  lockoutThreshold lockoutDuration lockOutObservationWindow

From a Windows host with domain context, PowerView reads the same thing:

Get-DomainPolicy
# lockout values live under the .SystemAccess key:
(Get-DomainPolicy).SystemAccess

Note the lockout duration and observation window in LDAP are stored as negative 100-nanosecond intervals, so you will convert them to minutes. PowerView and NetExec present them already converted.

For fine-grained policies, NetExec has a dedicated flag that dumps PSOs over LDAP (read access to the Password Settings Container is required, which by default only privileged accounts have, but it is sometimes loosened):

nxc ldap dc01.corp.local -u jdoe -p 'Passw0rd!' --pso

On a Windows box with RSAT you can also check the effective policy for a specific user:

Get-ADUserResultantPasswordPolicy -Identity svc_sql

Picking a safe cadence

The rule I follow is simple: one attempt per user per observation window, minus a margin.

If the threshold is 5 and the observation window is 30 minutes, a single bad attempt per account every 31 or more minutes never accumulates toward a lockout, because the counter decays before your next guess lands. In practice I leave a wider gap than the strict minimum to absorb clock skew and the chance that someone else (the real user, a stale service) also fails an attempt in the same window.

A practical plan looks like this:

  1. One password tried against the entire user list in a single pass.
  2. Wait out the observation window plus margin.
  3. Next password, next pass.

Horizontal, not vertical. You are trying one likely password against many users, not many passwords against one user. Seasonal passwords, the company name with a year, and Welcome1-style defaults are the usual candidates.

Exclude accounts that are already near the edge

Before each pass, re-check badPwdCount and drop any account that is already close to the threshold. Someone may have been fat-fingering their password all morning, and your single attempt could be the one that tips them over. You can read the attribute over LDAP:

nxc ldap dc01.corp.local -u jdoe -p 'Passw0rd!' --users

Remember the per-DC caveat: the badPwdCount you read from one DC is that DC's view. If you want certainty, query the DC you are actually authenticating against, and keep all spray traffic pointed at that same DC so one counter tells the whole story.

Kerberos pre-auth spraying vs NTLM/SMB

You can spray over different protocols, and they are not equally loud.

A classic SMB/NTLM spray authenticates against the DC and generates logon failure events. A Kerberos pre-authentication spray instead requests a TGT (an AS-REQ) with a timestamp encrypted under the candidate password. A wrong password fails pre-authentication without a full interactive logon. Kerbrute is the common tool here.

Which events fire depends on the path:

  • 4625 — "An account failed to log on." This is the NTLM/interactive failure. A Kerberos pre-auth spray does not generate 4625, which is why Kerberos spraying slips past detections that watch only for 4625.
  • 4771 — "Kerberos pre-authentication failed," with failure code 0x18 for a bad password. This is the Kerberos failure event.
  • 4768 — "A Kerberos authentication ticket (TGT) was requested." This fires on the AS-REQ itself, both for successful and for some failed requests, so it appears under Kerberos activity generally.

Important: whether 4771 and 4768 are logged at all depends on the Audit Kerberos Authentication Service subcategory being enabled, and it is not on by default in every environment. Do not assume your Kerberos spray is invisible. Assume it is logged and behave accordingly.

One thing I want to be clear about: changing the protocol does not change the lockout. Kerberos pre-auth failures increment badPwdCount exactly like NTLM failures do. Kerberos spraying is quieter against certain detections, but it will lock accounts just the same if you ignore the cadence.

Kerbrute's spray mode is straightforward, and it has a safety valve worth using:

kerbrute passwordspray -d corp.local --dc 10.0.0.10 users.txt 'Autumn2025!'

The --safe flag tells it to abort all threads the moment any account comes back as already locked out, which is a good circuit breaker against a bad policy read.

Detection ideas for defenders

If you are on the other side of this, the signatures are recognisable:

  • Many distinct target accounts failing authentication within a short window from a single source, especially a single logon failure per account rather than repeated failures against one account.
  • A spike in 4771 events with failure code 0x18 across many users, which catches Kerberos spraying that 4625-only rules miss.
  • A honeypot account that no legitimate user or service should ever touch. Any authentication attempt against it is suspicious by definition, and it gives you a near-zero-false-positive tripwire.
  • Because badPwdCount is per-DC, correlate failures across all domain controllers rather than trusting any single one.

Pre-spray checklist

  1. Enumerated the default domain policy: threshold, observation window, duration.
  2. Enumerated any PSOs that cover the accounts I plan to touch.
  3. Confirmed I have written authorisation and a point of contact in case something locks.
  4. Built the user list and scrubbed obviously disabled or decommissioned accounts.
  5. Checked badPwdCount and excluded anyone already near the threshold.
  6. Set my cadence to one attempt per user per observation window plus margin.
  7. Pinned all spray traffic to a single DC so one counter is authoritative.
  8. Picked a small, sensible password list rather than a brute list.

Do all that and spraying stops being a gamble. You get your credential, the client's help desk has a quiet afternoon, and nobody has to explain to a CISO why half the finance team was locked out at 10am. Spray responsibly.

Everything here was done in a lab. Only test systems you own or have written permission to test.

Black Friday · 20% off everything, auto-applied

Gear for this post

Shop all gifts for hackers →

Get new AD attack write-ups

Kerberos, ADCS and HTB write-ups by email, with the detection side included. No spam. Unsubscribe in one click.