The Server Message Block (SMB) Protocol is a network file sharing protocol, and as implemented in Microsoft Windows is known as Microsoft SMB Protocol. SMB mainly used for file sharing.


SMB uses either IP port 139 or 445.

  • Port 139: SMB originally ran on top of NetBIOS using port 139. NetBIOS is an older transport layer that allows Windows computers to talk to each other on the same network.
  • Port 445: Later versions of SMB (after Windows 2000) began to use port 445 on top of a TCP stack. Using TCP allows SMB to work over the internet.


Below steps demonstrate the guide to disable Microsoft Windows operating system Server SMB protocol.


Check if SMB1 and SMB2 are enabled or not


Open Powershell by hitting Windows key + R on keyboard, type in powershell and hit OK button.



1. Detect SMB1 command


Get-WindowsOptionalFeature -Online -FeatureName SMB1Protocol


Output



Disable SMB1 command


Set-SmbServerConfiguration -EnableSMB1Protocol $false



2. Detect SMB2 command


Get-SmbServerConfiguration | Select EnableSMB2Protocol


Disable SMB2 command,


Set-SmbServerConfiguration -EnableSMB2Protocol $false

Output



3. Uninstall SMB1 feature and reboot server to apply the change.


Uninstall-WindowsFeature –Name FS-SMB1 –Remove




Disable port 445




Disable port 139 ( NETBIOS )


1. Open Network and Sharing Center 



2. Click Connection.



3. click Properties



4. Double click TCP/IPv4



5. Hit Advanced button



6. Tick Disable NETBIOS over TCP/IP and OK.