Skip to content

Kerberos KDC_ERR_S_PRINCIPAL_UNKNOWN in Server 2025 #1312

Description

@drewmnoel

Some of the SMB connection behavior of Windows Server 2025 seems to have changed, and it likes to drop the SMB connection if the user is in Protected Users, NTLM is disabled, etc.

Describe the bug
When using NetExec to authenticate with Kerberos to Windows Server 2025 with NTLM disabled, the authentication fails with KDC_ERR_S_PRINCIPAL_UNKNOWN. NetExec clobbers hostname information if the initial SMB connection fails, resulting in SPNs like "cifs/.".

In Windows Server 2025, NetBIOS requests are dropped entirely when NTLM is disabled (via SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0\RestrictReceivingNTLMTraffic=2), unlike previous Windows versions that returned STATUS_NOT_SUPPORTED.

During enum_host_info, NetExec catches all exceptions but only processes ones that contain the string STATUS_NOT_SUPPORTED. Specifically, NetBIOSTimeout exceptions are not handled:

try:
self.conn.login("", "")
self.null_auth = True
except BrokenPipeError:
self.logger.fail("Broken Pipe Error while attempting to login")
except Exception as e:
self.null_auth = False
if "STATUS_NOT_SUPPORTED" in str(e):
# no ntlm supported
self.no_ntlm = True
self.logger.debug("NTLM not supported")

When the connection fails, getServerDNSHostName() and getServerName() both return empty, causing the hostname information to be cleared.

dns_hostname = self.conn.getServerDNSHostName().upper()
if dns_hostname and "." in dns_hostname:
self.hostname = dns_hostname.split(".")[0]
elif dns_hostname:
self.hostname = dns_hostname
else:
self.hostname = self.conn.getServerName()

To Reproduce

  1. On a Windows Server 2025 domain controller, disable incoming NTLM e.g. by:

    HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0\RestrictReceivingNTLMTraffic=2
    
  2. Attempt to authenticate to the host with Kerberos:

    nxc smb DC.CORP.LOCAL -u Administrator -p "${PW}" -k -d CORP.LOCAL

Expected Behavior
Authentication success, SPN of cifs/DC.CORP.LOCAL in Wireshark, etc

Actual Behavior
KDC_ERR_S_PRINCIPAL_UNKNOWN, SPN of cifs/. in Wireshark.

SMB         DC.CORP.LOCAL    445    NONE             [*]  x64 (name:) (domain:) (signing:True) (SMBv1:None)
SMB         DC.CORP.LOCAL    445    NONE             [-] CORP.LOCAL\Administrator:[..snip..] KDC_ERR_S_PRINCIPAL_UNKNOWN

Screenshot

TGS-REQ Image

NetExec info

  • OS: Kali
  • Version of nxc: 1.5.1 - Yippie-Ki-Yay - Kali Linux -
  • Installed from: apt, but testing on main shows the same

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions