Windows: detect if feature SMB 1.0/CIFS file sharing support is on

184 Views Asked by At

Is there a way to detect in Delphi code if the Windows SMB 1.0/CIFS feature is on? I want my application to detect this so that I can warn users of vulnerability issues. I can't find any code examples anywhere, so any help would be much appreciated.

1

There are 1 best solutions below

0
Ian Boyd On

Microsoft documents that SMB1 is enabled in the registry, and they document that checking the registrying is the way to go:

How to detect, enable and disable SMBv1, SMBv2, and SMBv3 in Windows

So you can check for the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
   @SMB1: DWORD

The default is "enabled", so if they key is not present, then it counts as enabled:

  • SMB1=0: Disable
  • SMB1=1: Enabled
  • (missing): Enabled