计算机中如何通过批处理关闭135 137 445等端口

发布时间:2021-05-31 13:34:07 作者:小新
来源:亿速云 阅读:645

这篇文章将为大家详细讲解有关计算机中如何通过批处理关闭135 137 445等端口,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

主要是通过bat操作防火墙添加规则,一般是tcp与udp。

日前,全球近百个国家和地区都有电脑系统遭受一个名为WannaCry的病毒攻击,被攻击者被要求支付比特币才能解锁。12日,安全软件制造商Avast表示,它已经在99个国家观察到超过57000个感染例子。

13日,中国国家互联网应急中心发文称,互联网上出现针对Windows操作系统的勒索软件的攻击案例,勒索软件利用此前披露的Windows SMB服务漏洞(对应微软漏洞公告:MS17-010)攻击手段,向终端用户进行渗透传播,并向用户勒索比特币或其他价值物。

从5月12日晚间起,中国多个高校的师生陆续发现自己电脑中的文件和程序无法打开,而是弹出对话框要求支付比特币等赎金后才能恢复。

方法

请将以下代码存为 关闭端口.bat ,以管理员身份运行就可以了,运行前记得打开防火墙双击使用。

%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
@echo off 
color 1f
title 关闭135 137 138 139 445 端口
echo. 
echo. 
echo. 
echo 正在关闭135端口 请稍候… 
netsh advfirewall firewall add rule name = "Disable port 135 - TCP" dir = in action = block protocol = TCP localport = 135
echo. 
netsh advfirewall firewall add rule name = "Disable port 135 - UDP" dir = in action = block protocol = UDP localport = 135
echo. 
echo 正在关闭137端口 请稍候… 
netsh advfirewall firewall add rule name = "Disable port 137 - TCP" dir = in action = block protocol = TCP localport = 137
echo. 
netsh advfirewall firewall add rule name = "Disable port 137 - UDP" dir = in action = block protocol = UDP localport = 137
echo. 
echo 正在关闭138端口 请稍候… 
netsh advfirewall firewall add rule name = "Disable port 138 - TCP" dir = in action = block protocol = TCP localport = 138
echo. 
netsh advfirewall firewall add rule name = "Disable port 138 - UDP" dir = in action = block protocol = UDP localport = 138
echo. 
echo 正在关闭139端口 请稍候… 
netsh advfirewall firewall add rule name = "Disable port 139 - TCP" dir = in action = block protocol = TCP localport = 139
echo. 
netsh advfirewall firewall add rule name = "Disable port 139 - UDP" dir = in action = block protocol = UDP localport = 139
echo. 
echo 正在关闭445端口 请稍候… 
netsh advfirewall firewall add rule name = "Disable port 445 - TCP" dir = in action = block protocol = TCP localport = 445
echo. 
netsh advfirewall firewall add rule name = "Disable port 445 - UDP" dir = in action = block protocol = UDP localport = 445
echo.
echo 按任意键退出 
pause>nul

注意事项

关闭端口只是降低电脑中毒的几率,如果要完全防止病毒入侵,还是要安装系统补丁,修复系统漏洞
防止该病毒入侵电脑方法:1.关闭445等端口,关闭网络共享;2.安装系统补丁或系统进行更新,修复系统漏洞。

%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit

很多朋友对第一句话不太熟悉,其实这个就是以 管理员权限启动应用程序

关于“计算机中如何通过批处理关闭135 137 445等端口”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. 如何关闭135、137、138、139、445端口方法
  2. 一键屏蔽135、137、138、139、445危险端口和服务

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

计算机

上一篇:pandas中对特征进行硬编码和onehot编码的实现方法

下一篇:dos中net如何创建管理员用户

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》