【安全--教程】在CMD中使用命令操作Windows防火墙

查看是否启动windows防火墙
netsh  advfirewall  show  allprofiles state
查看默认防火墙规则
netsh advfirewall show allprofiles firewallpolicy
查看windows防火墙静态入站规则
netsh advfirewall firewall show rule name=all dir=in type=static verbose
查看windows防火墙所有入站规则
netsh advfirewall firewall show rule name=all dir=in verbose
添加windows防火墙入站规则(需要管理员权限)
netsh advfirewall firewall add rule name="1.exe" dir=in action=allow program="c:\\1.exe" enable=yes
删除windows防火墙入站规则(需要管理员权限)
netsh advfirewall firewall delete rule name="1.exe"
添加windows防火墙入站TCP端口(需要管理员权限)
netsh advfirewall firewall add rule name="Allow_Tcp_9999_Port" description="Allow_Tcp_9999_Port" dir=in protocol=tcp localport=9999 action=allow enable=yes
发布了83 篇原创文章 · 获赞 276 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/qq_43017750/article/details/104017755
今日推荐