DOCUMENT:Q241041 TITLE :Enabling NetBT to Open IP Ports Exclusively PRODUCT :Windows NT PROD/VER:4.0 OPER/SYS:WINDOWS NT KEYWORD :kbbug4.00 kbfix4.00 ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Windows NT Server version 4.0 - Microsoft Windows NT Server, Enterprise Edition version 4.0 - Microsoft Windows NT Workstation version 4.0 ------------------------------------------------------------------------------- SYMPTOMS ======== A user-mode application can listen to the TCP port 139 and UDP ports 137 and 138. Because these ports are used by Windows NT services, it is a Trusted Computer System Evaluation Criteria (TCSEC) C2 requirement that an unprivileged user-mode application should not be able to listen to these ports used by Windows NT services, regardless of the cryptographic protection applied to the Windows NT service traffic using these ports. CAUSE ===== Netbt.sys (NetBIOS over TCP/IP) is responsible for opening the following TCP and UDP ports that subsequently are used by Windows NT services: - UDP Port 137 - UDP Port 138 - TCP Port 139 For additional information about Windows NT services that use these ports, click the article number below to view the article in the Microsoft Knowledge Base: Q150543 WinNT, Terminal Server, and Exchange Services Use TCP/IP Ports As explained in the Windows NT 4.0 Device Development Kit (DDK) for network driver development, Netbt.sys (as a TDI client) begins communicating with its local-node transport by opening a file object that represents a transport address. It calls ZwCreateFile, passing the address specification in the EA (extended attributes) buffer parameter to ZwCreateFile. In Windows NT 4.0 Service Pack 6a and earlier, Netbt.sys allows file share access to file objects representing the aforementioned TCP and UDP ports when calling ZwCreateFile. Subsequently, a user-mode application on Windows NT 4.0 Service Pack 6a and earlier can gain share access and listen to the TCP and UDP ports. The Post-SP6a hotfix, C2 Update, allows the option to change the Netbt.sys behavior so that it does not allow file share access to files objects representing the aforementioned TCP and UDP ports when calling ZwCreateFile. The option is selected through the use of the following registry key and key value. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters EnablePortLocking:REG_DWORD Default: 0 - NetBt allows file share access 1 - NetBt disallows file share access When EnablePortLocking is set to 1, Netbt.sys passes in zero (ULONG) in the ShareAccess parameter of ZwCreateFile. After the application of Netbt-fix and the setting of REG_DWORD value 1 for EnablePortLocking, a user-mode application cannot gain share access and listen to the TCP and UDP ports. NOTE: NETBT in Windows 2000 will not support this option and the above registry key and value. The default behaviour in Windows 2000 is to disallow file share access to all ports created by NETBT. RESOLUTION ========== The following files are available for download from the Microsoft Download Center or Microsoft's FTP site. Click the file names below to download the appropriate file: English: x86: Microsoft Download Center: Q244599i.exe (http://download.microsoft.com/download/winntsp/Patch/SP6a_C2/NT4/EN-US/Q244599i.exe) FTP: Q244599i.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt40/hotfixes-postsp6a/c2-fix/Q244599i.exe) Alpha: Microsoft Download Center: Q244599a.exe (http://download.microsoft.com/download/winntsp/Patch/SP6a_C2/ALPHA/EN-US/Q244599a.exe) FTP: Q244599a.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/usa/nt40/hotfixes-postsp6a/c2-fix/Q244599a.exe) French: x86: FTP: Q244599i.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/frn/nt40/hotfixes-postsp6a/c2-fix/Q244599i.exe) Alpha: FTP: Q244599a.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/frn/nt40/hotfixes-postsp6a/c2-fix/Q244599a.exe) Spanish: x86: FTP: Q244599i.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/spa/nt40/hotfixes-postsp6a/c2-fix/Q244599i.exe) Alpha: FTP: Q244599a.exe (ftp://ftp.microsoft.com/bussys/winnt/winnt-public/fixes/spa/nt40/hotfixes-postsp6a/c2-fix/Q244599a.exe) For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.asp and then click "How to use the Microsoft Download Center". The English version of this fix should have the following file attributes or later: Date Time Size File name Platform ------------------------------------------------ 10/07/1999 03:13p 123,152 Netbt.sys x86 10/07/1999 03:11p 222,800 Netbt.sys Alpha STATUS ====== Microsoft has confirmed this to be a problem in Windows NT 4.0. Additional query words: c2 security_patch ============================================================================ THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.