Salih Muhammed

All field notes

Field note 01

Why a correct password is refused: credentialed scans and the NTLM domain trap

A credentialed scan that cannot log in rarely fails loudly. Here is the order I work the chain in, and the one field that is computed into the password check.

Reviewed

01

Why it matters

An authenticated scan sees patch levels, installed software and configuration. An unauthenticated one mostly sees open ports. When a scanner cannot log in, it usually does not stop with an error: it returns a short, clean-looking report. A low finding count can mean a healthy host or a scan that never got in, so I confirm the credentialed status of every host before reading anything into its results.

02

Work the chain in order

Each step fails with a different cause, and several look identical from the scanner.

  1. The WinRM port is open and Test-WSMan answers. That proves the listener only; it does not authenticate.
  2. The listener accepts Negotiate. Kerberos only means a local account cannot authenticate at all.
  3. The scanner has an NTLM implementation. Without one, every account is refused regardless of the password.
  4. The account name is the real one. Sign-in screens show a display name, which is often not it. whoami on the target settles it.
  5. The domain string is right. This is the trap.

03

The trap

NTLMv2 computes its response from the user name, the password and the domain. Send the wrong domain and the logon can fail with the same status Windows uses for a wrong password. The exact behaviour depends on the client and the target, so test it rather than assume. A client given no domain often defaults to its own workstation name, which is never correct for a local account on the target. For a local account, send TARGETCOMPUTER\user.

04

Read the refusal, do not guess

With failure auditing enabled, a rejected logon can produce Security event 4625 on the target. Two fields settle it: Account Domain shows the authority that was actually sent, and Sub Status gives the reason.

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625} -MaxEvents 1 |
    Format-List TimeCreated, Message

0xC000006A is a wrong password or a wrong domain. 0xC0000064 is no such account. If there is no 4625, check the auditing configuration and transport before drawing a conclusion about the account. Check the lockout threshold before you start, and change one variable at a time.

Microsoft Windows Event Viewer reference showing Account Domain and Sub Status in event 4625
Microsoft Windows reference example of Event 4625. This sample shows account lockout; it illustrates the fields, not the wrong-domain failure described in this note. Source: Microsoft Learn. Used with permission from Microsoft. Open full image.

05

After it works

On a workgroup machine, remote user account control can still strip the administrator token from a local account over the network. I recommend a dedicated local scan account rather than an operator's, so it can be rotated and audited on its own and never touches an account a system signs in with automatically.

References

All field notes