首页 > 其他分享 >cmd关闭防火墙端口

cmd关闭防火墙端口

时间:2023-06-12 18:55:49浏览次数:42  
标签:deny protocol localport firewall cmd 端口 防火墙 add advfirewall


关闭常用的端口135/137/138/139/445 端口
netsh advfirewall set allprofile state on
netsh advfirewall firewall add rule name=deny_TCP135 dir=in action=block protocol=TCP localport=135
netsh advfirewall firewall add rule name=deny_TCP135 dir=out action=block protocol=TCP localport=135
netsh advfirewall firewall add rule name="deny_UDP135" dir=in action=block protocol=udp localport=135
netsh advfirewall firewall add rule name="deny_UDP135" dir=out action=block protocol=udp localport=135

netsh advfirewall firewall add rule name=deny_TCP137 dir=in action=block protocol=TCP localport=137
netsh advfirewall firewall add rule name=deny_TCP137 dir=out action=block protocol=TCP localport=137
netsh advfirewall firewall add rule name="deny_UDP137" dir=in action=block protocol=udp localport=137
netsh advfirewall firewall add rule name="deny_UDP137" dir=out action=block protocol=udp localport=137

netsh advfirewall firewall add rule name=deny_TCP138 dir=in action=block protocol=TCP localport=138
netsh advfirewall firewall add rule name=deny_TCP138 dir=out action=block protocol=TCP localport=138
netsh advfirewall firewall add rule name="deny_UDP138" dir=in action=block protocol=udp localport=138
netsh advfirewall firewall add rule name="deny_UDP138" dir=out action=block protocol=udp localport=138

netsh advfirewall firewall add rule name=deny_TCP139 dir=in action=block protocol=TCP localport=139
netsh advfirewall firewall add rule name=deny_TCP139 dir=out action=block protocol=TCP localport=139
netsh advfirewall firewall add rule name="deny_UDP139" dir=in action=block protocol=udp localport=139
netsh advfirewall firewall add rule name="deny_UDP139" dir=out action=block protocol=udp localport=139

netsh advfirewall firewall add rule name=deny_TCP445 dir=in action=block protocol=TCP localport=445
netsh advfirewall firewall add rule name=deny_TCP445 dir=out action=block protocol=TCP localport=445
netsh advfirewall firewall add rule name="deny_UDP445" dir=in action=block protocol=udp localport=445
netsh advfirewall firewall add rule name="deny_UDP445" dir=out action=block protocol=udp localport=445

标签:deny,protocol,localport,firewall,cmd,端口,防火墙,add,advfirewall
From: https://www.cnblogs.com/lefengshop/p/17475858.html

相关文章

  • PyQt5 扫描远程端口
    #-*-coding:utf-8-*-#@Time:2023/6/916:00#@Author:wangyafeng#@FileName:main.py.py#@Email:[email protected]#@Software:PyCharmimportsysfromPyQt5.QtWidgetsimportQApplication,QMainWindowimportscanportimportthreadingimpor......
  • 根据端口找到进程pid
    [root@localhostluban]#netstat-anp|grep"8999"tcp600:::8999:::*LISTEN93234/./luban#这里的93234就是占用8999端口进程的pid[root@localhostluban]#ps-ef|greplubanroot9323491770016:......
  • zabbix监控多JMX端口
    1.开启Tomcat JMX功能CATALINA_OPTS="$CATALINA_OPTS-Dcom.sun.management.jmxremote-Djava.rmi.server.hostname=10.124.129.241-Dcom.sun.management.jmxremote.port=8889-Dcom.sun.management.jmxremote.ssl=false-Dcom.sun.management.jmxremote.authenticate=false&quo......
  • kali开启ssh端口连接xshell
    先记一下主要命令启动ssh服务:systemctlstartssh.servicenetstat-lnt:再次查看端口状态,可以看到22端口已经成功开启第一步编辑ssh文件 vi/etc/ssh/sshd_config 将其修改为第二步重启ssh/etc/init.d/sshrestart重启或者servicesshstart重启/etc/init.d/sshstatu......
  • linux防火墙相关命令
    查看防火墙状态:systemctlstatusfirewalld启动防火墙:systemctlstartfirewalld关闭防火墙:systemctlstopfirewalld禁用防火墙:systemctldisablefirewalld重启防火墙(修改配置后要重启防火墙):firewall-cmd--reload开放指定端口:firewall-cmd--permanent--a......
  • 如何修改服务器远程端口号3389?
    昨天给你们分享了电脑和服务器的安全基础知识,有讲到修改端口号,有必要时,这个端口,建议还是修改一下为好,最好改大一点,这样安全性会高一点,但如果面对高手级打击,就没有用了,通常高手级过NMAP扫描一个你的IP地址,端口便全部显现出来了。好了,下面我来告诉你们如何修改远程连接3389端口;首先......
  • EasyRTMPLive拉转推硬件设备访问端口返回404报错,该如何解决?
    TSINGSEE青犀视频的各个平台部署灵活,视频能力丰富且全面、能满足用户的多场景视频监控需求。平台各具特点,可支持多类型的设备、多协议接入,包括国标GB28181协议、RTMP/RTSP/Onvif协议、海康EHOME、海康SDK、大华SDK等,在视频流分发上,能支持全终端、全平台的视频流输出,包括RTSP、RTMP......
  • Kali 信息收集工具:子域、端口、目录、交互等
    子域名查询工具:Fierce是使用多种技术来扫描目标主机IP地址和主机名的一个DNS服务器枚举工具。运用递归的方式来工作。它的工作原理是先通过查询本地DNS服务器来查找目标DNS服务器,然后使用目标DNS服务器来查找子域名。fierce的主要特点就是可以用来定位独立IP空间对应域名和主机......
  • Kali Linux 之“端口扫描工具”
    一、NMAP扫描服务器端口和内网端口开放情况:扫描单个网址或IP地址:nmapIP地址nmap域名地址(不带协议头http或https)扫描内网整个网段:nmap192.168.1.0/24扫描多个主机(多个地址用空格间隔):nmap192.168.1.1192.168.1.2扫描指定的IP开放端口(使用半开扫描,指定端口号1-655......
  • 各种常用的默认端口号归纳
    博主归纳的太全了:原文链接:https://blog.csdn.net/Klhz555/article/details/113343083端口号的范围是从1~65535其中1~1024是被RFC3232规定好了的,被称作“众所周知的端口”(WellKnownPorts);从1025~65535的端口被称为动态端口(DynamicPorts),可用来建立与其它主机的会话,也可由用户自......