Security of Server Message Block (SMB)

Common Weaknesses in SMB


  • Multiple vulnerabilities in Microsoft Windows SMBv1
  • SMB Signing not enabled
  • Microsoft Windows SMB using NULL Session Authentication
  • Microsoft Windows SMB Shares accessible without privileges

Network Exploration

TCP port 5357: Web Services on Devices API (WSDAPI)

File and Printer Sharing

TCP port 135: Remote Procedure Call (RPC)
TCP port 139: NETBIOS Session Service
TCP port 445: Server Message Block (SMB)

Disabling NetBIOS over TCP/IP (TCP Port 139) stops NETBIOS name discovery.


Numerous vulnerabilities in Microsoft Windows SMBv1


Checking for Weaknesses:

The NSE script “smb-protocols” helps determine if a server supports “NT LM 0.12 (SMBv1)”.

System Evaluation:

1
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters | ForEach-Object {Get-ItemProperty $_.pspath}

Fixing the Issue:

1
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 –Force

Confirming the Fix:


SMB Signing Not Enabled


Checking for Weaknesses:

System Evaluation:

Fixing the Issue:

Enable the “Microsoft network server: Digitally sign communication (always)” setting.

Disabling “Microsoft network server: Digitally sign communications (always)” completely disables SMB signing. This leaves computers open to attacks that hijack sessions.

Things to Consider:

  • Enabling this might make file copying and network performance slower on client computers.
  • Enabling this will stop clients that can’t use SMB signing from talking to servers and domain controllers. This will cause issues with actions like joining a domain, user and computer authentication, or network access for programs.

Confirming the Fix:


Microsoft Windows SMB using NULL Session Authentication


Checking for Weaknesses:

System Evaluation:

Fixing the Issue:

Enable both “Network access: Do not allow anonymous enumeration of SAM accounts” and “Network access: Do not allow anonymous enumeration of SAM accounts and shares”.

Confirming the Fix:


Microsoft Windows SMB Shares Accessible Without Privileges


Checking for Weaknesses:

System Evaluation:

Fixing the Issue:

Activate password-protected sharing.

Confirming the Fix:

Analyzing Logs for SMB Session Authentication



Additional Resources


Licensed under CC BY-NC-SA 4.0
Last updated on Oct 01, 2023 07:16 +0100