How to realize batch processing of shutting down dangerous ports with one button
This article is about how to implement batch processing to close dangerous ports with one click. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Close the dangerous port with one button (to prevent hackers)
Danger, ports, hackers.
Copy all of the following
Use notepad to save the suffix as
Bat
Follow the prompts to copy from @ below
The code is as follows:
@ echo off
Color 1f
Title shuts down common dangerous ports
Echo.
Echo.
Echo this batch is used to start the firewall of the XP system and close common dangerous ports
Echo.
Echo, please make sure that you are using a XP system and that no other firewalls are installed.
Echo.
Echo to avoid conflicts with the firewall of the XP system
Echo.
Echo.
Echo.
Pause
Cls
Please wait while echo starts the firewall.
Sc config SharedAccess start= auto > nul
Net start SharedAccess > nul
Echo Firewall has been started successfully
Echo.
Please wait while echo shuts down common dangerous ports.
Echo.
Echo is shutting down port 135. please wait a moment.
Netsh firewall set portopening protocol = ALL port = 135name = 135mode = DISABLE scope = ALL profile = ALL
Echo is shutting down port 137. please wait a moment.
Echo is shutting down port 138. please wait a moment.
Echo is shutting down port 139. please wait a moment.
Netsh firewall set portopening protocol = ALL port = 139name = 139mode = DISABLE scope = ALL profile = ALL
Echo is shutting down port 445. please wait a moment.
Netsh firewall set portopening protocol = ALL port = 445 name = 445 mode = DISABLE scope = ALL profile = ALL
Netsh firewall set portopening protocol = TCP port = 593name = 593mode = DISABLE scope = ALL profile = ALL
Please wait a moment while echo shuts down port 1025.
Netsh firewall set portopening protocol = TCP port = 1025 name = 1024 mode = DISABLE scope = ALL profile = ALL
Please wait a moment while echo shuts down port 3389.
Cls
Echo.
Echo.
Echo.
The common dangerous port of echo has been shut down
Echo.
Echo.
Echo.
Echo.
Echo
Echo.
Echo.
Echo.
Echo press any key to exit
Pause > nul
Thank you for reading! This is the end of this article on "how to close dangerous ports with one click". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!