Skip to content

Windows Event ID 5168: SPN check for SMB/SMB2 failed

Written when the SPN check for SMB/SMB2 fails. It indicates that the SPN validation required by the server was not satisfied and can be a sign of an NTLM relay attack.

Overview

The subcategory is Audit File Share. It is generated when the SPN (Service Principal Name) check during an SMB/SMB2 connection fails. It often happens when the server sets the Group Policy “Microsoft network server: Server SPN target name validation level” to “Required from client” while the client connects with NTLMv1 or LM. An SPN is sent to the server, and can be validated, only when NTLMv2 or Kerberos is used.

How it is triggered

  • When, in an SMB connection, the presented SPN does not match or no SPN is sent (for example, a connection using NTLMv1/LM).
  • Besides configuration inconsistency, it can occur in attacks involving relaying.

Security review points

  • An SPN check failure can be a sign of an NTLM relay attack (relaying authentication to another server to access by impersonation). SPN validation is one of the relay defenses, and if its failures concentrate on a specific source or server, investigate.
  • Correlate with network logon 4624 (Type 3, NTLM) and NTLM validation 4776 to track authentication flows suspected of relaying.

Notes for log review

  • It also occurs from configuration inconsistency (SPN registration mistakes, etc.). Separate attack from configuration-induced by source, target server, and frequency.
  • Note bursts of SPN check failures against a specific server.

MITRE ATT&CK mapping

TechniqueTacticWhat this event shows
T1557.001 Name Resolution Poisoning and SMB RelayCredential Access, CollectionSMB authentication failing on an SPN mismatch indicates NTLM relay

Mapping as of ATT&CK v19.2. To search by technique, see the ATT&CK reverse lookup.

Key fields

FieldMeaning
SPN Name / Error CodeThe SPN that failed validation and the error code
Server Names / Configured Names / IP AddressesThe names the server accepts, the configured names, and IP addresses

Glossary

  • NTLM relay attack — an attack that forwards stolen/relayed authentication to another server to access by impersonating the victim. Mitigated by SMB signing and SPN target name validation.

References