Windows禁用445端口

今天来公司有好多电脑感染了0day病毒,

 

 

写个脚本,一键执行禁用445,135-139端口。Windows7测试没有问题。

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NetBT\Parameters" /v SMBDeviceEnabled /t REG_DWORD /d 0 /f

net stop Server /y

sc config "LanmanServer" start= disabled

net start sharedaccess
net start "Windows Firewall"
sc config "MpsSvc" start= auto

netsh advfirewall firewall add rule name="deny445" protocol=TCP dir=in localport=445,135-139 action=block
netsh advfirewall firewall add rule name="deny445udp" protocol=UDP dir=in localport=445,135-139 action=block

  

 

无耻的求一下赞助

posted @ 2017-05-15 10:39  一起走过的路  阅读(646)  评论(0编辑  收藏  举报