windows防火墙禁止访问某些端口

为了系统安全一半服务器会开启系统防火墙去限制一些入站端口访问限制

为了高效批量添加,我整理了一个批量的脚本供参考

%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
::管理员运行

net start MpsSvc
::开启服务

sc config MpsSvc start= auto
::开机启动

netsh advfirewall set allprofiles state on
::启用防火墙

::开启相关端口入站拒绝规则
netsh advfirewall firewall add rule name = "Disable port 135 - TCP" dir = in action = block protocol = TCP localport = 135
netsh advfirewall firewall add rule name = "Disable port 135 - UDP" dir = in action = block protocol = UDP localport = 135
netsh advfirewall firewall add rule name = "Disable port 137 - TCP" dir = in action = block protocol = TCP localport = 137
netsh advfirewall firewall add rule name = "Disable port 137 - UDP" dir = in action = block protocol = UDP localport = 137
正文完
 0
365share
版权声明:本站原创文章,由 365share 于2023-06-08发表,共计683字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。