How to close port 135/139/445 under Windows

1. Close​ ​Port 135​

first step

Run dcomcnfg, open "Component Services" → "Computer", right-click on "My Computer", select "Properties"; then click Default Properties, and remove the tick "Enable Distributed COM (E) on this computer" , then return to "Default Protocol" and remove the "Connection-Oriented" TCP/IP protocol. (This operation can also be done through the registry, the effect is the same, open the start menu in the lower left corner, run, enter regedit, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\EnableDCOM and double-click to change the value to "N" , HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc\DCOM Protocols and then double-click except "ncacn_ip_tcp")

second step

This is a critical step. Many people find that they follow the steps copied and pasted by other people on the Internet, but they use netstat -an to check that port 135 is still in the listening state because of this step. Open the start menu in the lower left corner, run, enter regedit, enter the registry, locate HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc

Right-click on Rpc, create a new item - enter Internet and restart, then cmd, enter netstat -an, and you will find that port 135 has completely disappeared

2. Close port 139

1. Right-click the "Local Area Connection" icon in the lower right corner of the desktop and select "Status".

2. In the pop-up "Local Area Connection Status" dialog box, click the "Properties" button.

3. In the "Local Area Connection Properties" dialog box that appears, select "Internet Protocol (TCP/IP)" and double-click to open it.

4. In the "Internet Protocol (TCP/IP) Properties" dialog box that appears, click the "Advanced" button.

5. In the "Advanced TCP/IP Settings" dialog box that appears, select the "WINS" tab.

6. On the "WINS" tab, under "NetBIOS Settings", select "Disable NetBIOS over TCP/IP".

7. Click "OK" to close port 139 after restarting.

3. Close port 445

1. Click "Start" - "Run", enter "regedit", click the "OK" button to open the registry.

2. Find the registry key "HKEY_LOCAL_MACHINE\System\Controlset\Services\NetBT\Parameters".

3. Select the "Parameters" item, right-click, and select "New" - "DWORD Value".

4. Name the DWORD value "SMBDeviceEnabled".

5. Right-click the "SMBDeviceEnabled" value and select "Modify".

6. In the "Edit DWORD Value" dialog box that appears, under "Value Data", enter "0", and click the "OK" button to complete the setting.

-----------------------------------

Guess you like

Origin blog.csdn.net/fzy18757569631/article/details/128954180