TrustedSec: Windows SMB server SPN target name validation breaks host/ SPN tickets in red team workflows; Titanis workaround
A TrustedSec blog post explains the Windows policy "Microsoft network server: Server SPN target name validation level" (registry value SmbServerNameHardeningLevel, 1 = Accept, 2 = Require). It is a hardening control against ticket and credential abuse over SMB. When enabled, the SMB server validates the SPN presented in a Kerberos ticket or in the NTLMv2 NTLM_AUTHENTICATE packet. Forged tickets using the common host/computer SPN, such as those made after obtaining a machine hash through shadow credentials and PKINIT, are rejected with STATUS_ACCESS_DENIED. The same applies to relayed NTLM authentication. During an engagement, the Titanis tool hit this. The workaround is the -SpnOverride cifs/server~=host/server syntax, which uses host/ for the ticket lookup but rewrites the SPN to cifs/server before transmission. This works because both SPNs map to the same account key. The article is a technical write-up, not a vulnerability disclosure. It has no CVE and no reported exploitation.
Detalhes técnicos
- With the policy enabled, the server accepts SPNs matching the NetBIOS name (cifs/HOST), the FQDN, U2U tickets to the computer account (HOST$), and any IP assigned to the machine. This includes 127.0.0.1, ::1 and IPv6 link-local addresses, with or without an interface index.
- It rejects tickets whose service class is not cifs, other loopback addresses such as 127.0.0.2 or 127.1, alternate host names, and the machine account name HOST$.
- For Kerberos, SPN validation happens after ticket decryption. A ticket that cannot be decrypted fails earlier with KRB_AP_ERR_MODIFIED (41).
- The policy affects SMB only, including RPC over named pipes. It does not affect RPC over TCP. The similarly named "Require strict target SPN match on remote procedure calls" policy is unrelated.
- Failed validation returns STATUS_ACCESS_DENIED (0xC0000022) and logs Event ID 551 in Microsoft-Windows-SMBServer/Security, with the client-supplied SPN in the event data.
- For NTLM, the SPN is only a text field, so no special setup is needed to supply a valid one.
Remediação
- Defenders can set the policy to Accept (1) or Require (2) via GPO or registry on SMB servers. This blocks tickets and relays that carry non-matching SPNs.
- Monitor Event ID 551 in Microsoft-Windows-SMBServer/Security for rejected SPNs.
- Tickets with a cifs/ SPN and the correct host name pass the validation.
Linha do tempo
-
TrustedSec: Windows SMB server SPN target name validation breaks host/ SPN tickets in red team workflows; Titanis workaround
ler a análise desta fonte ocultar
A TrustedSec blog post explains the Windows policy "Microsoft network server: Server SPN target name validation level" (registry value
SmbServerNameHardeningLevel, 1 = Accept, 2 = Require). It is a hardening control against ticket and credential abuse over SMB. When enabled, the SMB server validates the SPN presented in a Kerberos ticket or in the NTLMv2NTLM_AUTHENTICATEpacket. Forged tickets using the commonhost/computerSPN, such as those made after obtaining a machine hash through shadow credentials and PKINIT, are rejected with STATUS_ACCESS_DENIED. The same applies to relayed NTLM authentication. During an engagement, the Titanis tool hit this. The workaround is the-SpnOverride cifs/server~=host/serversyntax, which useshost/for the ticket lookup but rewrites the SPN tocifs/serverbefore transmission. This works because both SPNs map to the same account key. The article is a technical write-up, not a vulnerability disclosure. It has no CVE and no reported exploitation.Technical Details
- With the policy enabled, the server accepts SPNs matching the NetBIOS name (cifs/HOST), the FQDN, U2U tickets to the computer account (HOST$), and any IP assigned to the machine. This includes 127.0.0.1, ::1 and IPv6 link-local addresses, with or without an interface index.
- It rejects tickets whose service class is not cifs, other loopback addresses such as 127.0.0.2 or 127.1, alternate host names, and the machine account name HOST$.
- For Kerberos, SPN validation happens after ticket decryption. A ticket that cannot be decrypted fails earlier with KRB_AP_ERR_MODIFIED (41).
- The policy affects SMB only, including RPC over named pipes. It does not affect RPC over TCP. The similarly named "Require strict target SPN match on remote procedure calls" policy is unrelated.
- Failed validation returns STATUS_ACCESS_DENIED (0xC0000022) and logs Event ID 551 in Microsoft-Windows-SMBServer/Security, with the client-supplied SPN in the event data.
- For NTLM, the SPN is only a text field, so no special setup is needed to supply a valid one.
Remediation
- Defenders can set the policy to Accept (1) or Require (2) via GPO or registry on SMB servers. This blocks tickets and relays that carry non-matching SPNs.
- Monitor Event ID 551 in Microsoft-Windows-SMBServer/Security for rejected SPNs.
- Tickets with a cifs/ SPN and the correct host name pass the validation.