I want to block open ports e.g 445 on my windows server 2012 R2 server. I have tried to follow the procedure of adding an inbound rule in windows firewall advanced settings but when I run nmap the report still shows port 445 as open. is there another way of blocking/disabling the port
Open up cmd as "Run as administrator."
Type in the following:
netsh advfirewall set allprofile state on <Enter>
netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=445 name="Block_TCP-445" <Enter>
You can also do it via registry:
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\
Right click the blank area and select New. Select DWORD (32-bit) Value.
Call it SMBDeviceEnabled. Modify it, and change Value data from 1 to 0
and then disable the Windows Server service