Avatar of Shepherd Kwashiwa
Shepherd Kwashiwa
 asked on

Block open ports

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

Avatar of undefined
Last Comment
Seth Simmons

8/22/2022 - Mon

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
Cliff Galiher

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

I agree with Cliff and here is a supporting article.


In there is a link to a Microsoft Support article. You probably do not need to close unless you allow for all the possibilities of it being closed.
Seth Simmons

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Cliff Galiher (https:#a42351345)

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.

Experts-Exchange Cleanup Volunteer
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy