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
Windows OSWindows Server 2012
Last Comment
Seth Simmons
8/22/2022 - Mon
netcmh
Have you tried this:
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\CurrentControlSet\services\NetBT\Parameters
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
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
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