服务器常见危险端口关闭命令

服务器上面很多时候会默认开启一些弱端口,这些端口对于一般的用户来说用不上的,所以为了防止出现这些弱端口被利用,我们可以在服务器上面点击运行——cmd然后输入以下的命令:

netsh ipsec static ^
add policy name=关闭危险端口
netsh ipsec static ^
add filteraction name=阻止端口 action=block
netsh ipsec static ^
add filterlist name=危险端口关闭
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP445端口 dstport=445 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP445端口 dstport=445 protocol=udp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP135端口 dstport=135 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP135端口 dstport=135 protocol=udp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP139端口 dstport=139 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP593端口 dstport=593 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP1025端口 dstport=1025 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP2531端口 dstport=2531 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP2745端口 dstport=2745 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP3127端口 dstport=3127 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝TCP6129端口 dstport=6129 protocol=tcp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP123端口 dstport=123 protocol=udp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP137端口 dstport=137 protocol=udp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP138端口 dstport=138 protocol=udp mirrored=yes
netsh ipsec static ^
add filter filterlist=危险端口关闭 srcaddr=any dstaddr=me description=拒绝UDP1900端口 dstport=1900 protocol=udp mirrored=yes
netsh ipsec static ^
add rule name=BlockAllAccess policy=关闭危险端口 filterlist=危险端口关闭 filteraction=阻止端口
netsh ipsec static set policy name=关闭危险端口 assign=y
exit


   

香港總公司:香港縱然雲計算國際有限公司 HK ZONGRAN CLOUD COMPUTING INT'L LIMITED

Copyright © 2016 香港縱然雲計算國際有限公司HK ZONGRAN CLOUD COMPUTING INT'L LIMITED www.zongran.net Corporation, All Rights Reserved

合作站點: 安全狗