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
版权归属:
Z先森
许可协议:
本文使用《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》协议授权
评论区