win7一键关闭危险端口的方法

时间:2016-10-07 16:05:41 来源:51学吧 编辑:www.51xue8.com

对于win7这个系统来讲,有一些开放的端口,很容易被入侵,而且这些大多数人根本用不到,不如直接关闭,这样系统会更安全。

但端口的关闭,想着容易,操作起来难度还是很大的,一些小白用户可能不会操作,下面教给大家一招:win7一键关闭危险端口的方法。

下面有一个文件,可以帮助大家自动关闭大部分危险端口:

@echo off
color 1f
title 关闭常见的危险端口
echo.
echo.
echo 本批处理用于启动XP系统的防火墙并关闭常见的危险端口
echo.
echo 请确认您正在使用的是XP系统 并且未安装其他防火墙
echo.
echo 以避免与XP系统的防火墙发生冲突
echo.
echo.
echo.
pause
cls
echo 正在启动防火墙 请稍候…
sc config SharedAccess start= auto > nul
net start SharedAccess > nul
echo 防火墙已经成功启动
echo.
echo 正在关闭常见的危险端口 请稍候…
echo.
echo 正在关闭135端口 请稍候…
netsh firewall set portopening protocol = ALL port = 135 name = 135 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭137端口 请稍候…
netsh firewall set portopening protocol = ALL port = 137 name = 137 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭138端口 请稍候…
netsh firewall set portopening protocol = ALL port = 138 name = 138 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭139端口 请稍候…
netsh firewall set portopening protocol = ALL port = 139 name = 139 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭445端口 请稍候…
netsh firewall set portopening protocol = ALL port = 445 name = 445 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭593端口 请稍候…
netsh firewall set portopening protocol = TCP port = 593 name = 593 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭1025端口 请稍候…
netsh firewall set portopening protocol = TCP port = 1025 name = 1024 mode = DISABLE scope = ALL profile = ALL
echo 正在关闭3389端口 请稍候…
netsh firewall set portopening protocol = ALL port = 3389 name = 3389 mode = DISABLE scope = ALL profile = ALL
cls
echo.
echo.
echo.
echo 常见的危险端口已经关闭
echo.
echo.
echo.
echo.
echo
echo.
echo.
echo.
echo 按任意键退出
pause>nul

 

我们只需要把上面的文件复制到记事本中,然后把后辍.TXT更改为.BAT文件,然后点击就会自动执行,也就可以自动把这些危险的端口给屏蔽掉了。