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
-
On a Windows Server 2025 domain controller, disable incoming NTLM e.g. by:
HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0\RestrictReceivingNTLMTraffic=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
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
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 returnedSTATUS_NOT_SUPPORTED.During
enum_host_info, NetExec catches all exceptions but only processes ones that contain the stringSTATUS_NOT_SUPPORTED. Specifically,NetBIOSTimeoutexceptions are not handled:NetExec/nxc/protocols/smb.py
Lines 191 to 201 in d1fc6d5
When the connection fails,
getServerDNSHostName()andgetServerName()both return empty, causing the hostname information to be cleared.NetExec/nxc/protocols/smb.py
Lines 215 to 221 in d1fc6d5
To Reproduce
On a Windows Server 2025 domain controller, disable incoming NTLM e.g. by:
Attempt to authenticate to the host with Kerberos:
nxc smb DC.CORP.LOCAL -u Administrator -p "${PW}" -k -d CORP.LOCALExpected Behavior
Authentication success, SPN of
cifs/DC.CORP.LOCALin Wireshark, etcActual Behavior
KDC_ERR_S_PRINCIPAL_UNKNOWN, SPN of
cifs/.in Wireshark.Screenshot
TGS-REQ
NetExec info
1.5.1 - Yippie-Ki-Yay - Kali Linux -mainshows the same