windows高级防火墙拦截指定端口和改远程端口

Z先森 2022-09-21 PM 351℃ 0条
netsh advfirewall firewall add rule name=allow80and443 description="允许80,443端口" dir=in localport=80,443 protocol=TCP action=allow

netsh advfirewall firewall add rule name=deny1to1000not80_443 description="拒绝1-1000除了80,443外的端口" dir=in localport=1-79,81-442,444-1000 protocol=TCP action=block

#放远程端口
netsh advfirewall firewall add rule name=allow11111 description="允许rdp端口" dir=in localport=11111 protocol=TCP action=allow

#改远程端口
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v "PortNumber" /t REG_DWORD /d "11111" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "PortNumber" /t REG_DWORD /d "11111" /f
标签: none

如无特殊说明,本博所有文章均为博主原创。

评论啦~