批处理 一秒关闭危险端口 方便!快速!有效!
发布时间:2012-06-21 00:16:49作者:知识屋
@echo off
echo 本工具可以帮助您关闭危险端口 避免您的电脑遭受黑客攻击 by jlm
echo 请按任意键关闭危险端口
pause>nul
echo 正在关闭危险端口.....................
gpupdate >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/135" -f *+0:135:TCP -n BLOCK -x >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/135" -f *+0:135:UDP -n BLOCK -x >nul
echo 关闭TCP/UDP 135端口.................成功!
ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/445" -f *+0:445:TCP -n BLOCK -x >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/445" -f *+0:445:UDP -n BLOCK -x >nul
echo 关闭TCP/UDP 445端口.................成功!
ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/1025" -f *+0:1025:TCP -n BLOCK -x >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/1025" -f *+0:1025:UDP -n BLOCK -x >nul
echo 关闭TCP/UDP 1025端口.................成功!
ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/139" -f *+0:139:UDP -n BLOCK -x >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/139" -f *+0:139:TCP -n BLOCK -x >nul
echo 关闭TCP/UDP 139端口.................成功!
echo ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/6129" -f *+0:6129:TCP -n BLOCK -x >nul
ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/6129" -f *+0:6129:UDP -n BLOCK -x >nul
echo 关闭TCP/UDP 6129端口.................成功!
ipseccmd -w REG -p "HFUT_SECU" -r "Block ICMP/255" -f *+0:255:ICMP -n BLOCK -x >nul
echo 关闭ICMP 255端口.................成功!
ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/43958" -f *+0:43958:TCP -n BLOCK -x >nul
echo 关闭UDP 43958端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/1434" -f *+0:1434:UDP -n BLOCK -x >nul
echo 关闭UDP 1434端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/137" -f *+0:137:UDP -n BLOCK -x >nul
echo 关闭UDP 137端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block UDP/138" -f *+0:138:UDP -n BLOCK -x >nul
echo 关闭UDP 138端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/139" -f *+0:139:TCP -n BLOCK -x >nul
echo 关闭TCP 139端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/3389" -f *+0:3389:TCP -n BLOCK -x >nul
echo 关闭TCP 3389端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/4899" -f *+0:4899:TCP -n BLOCK -x >nul
echo 关闭TCP 4899端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/1433" -f *+0:1433:TCP -n BLOCK -x >nul
echo 关闭TCP 1433端口.................成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/8000" -f *+0:18000:TCP -n BLOCK -x >nul
echo 关闭TCP 灰鸽子木马默认端口.......成功!
rem ipseccmd -w REG -p "HFUT_SECU" -r "Block TCP/5022" -f *+0:5022:TCP -n BLOCK -x >nul
echo 关闭TCP 华夏同盟远程控制木马默认端口.成功!
echo 关闭危险端口.........................成功!
echo 请按任意键设置 IP 筛选器!
pause>nul
gpupdate >nul
echo 正在设置 IP 筛选器.....................
rem if exist %temp%ipfilter.reg del %temp%ipfilter.reg
echo Windows Registry Editor Version 5.00>%temp%ipfilter.reg
echo.>>%temp%ipfilter.reg
echo [HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesTcpipParameters]>>%temp%ipfilter.reg
echo "EnableSecurityFilters"=dword:00000001>>%temp%ipfilter.reg
echo.>>%temp%ipfilter.reg>>%temp%ipfilter.reg
echo [HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesTcpipParametersInterfaces{F3BBAABC-03A5-4584-A7A0-0251FA38B8B1}]>>%temp%ipfilter.reg
echo "TCPAllowedPorts"=hex(07):32,00,31,00,00,00,38,00,30,00,00,00,34,00,30,00,30,>>%temp%ipfilter.reg
echo 00,30,00,00,00,00,00>>%temp%ipfilter.reg
echo.>>%temp%ipfilter.reg
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParameters]>>%temp%ipfilter.reg
echo "EnableSecurityFilters"=dword:00000001>>%temp%ipfilter.reg
echo.>>%temp%ipfilter.reg
echo [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesTcpipParametersInterfaces{F3BBAABC-03A5-4584-A7A0-0251FA38B8B1}]>>%temp%ipfilter.reg
echo "TCPAllowedPorts"=hex(07):32,00,31,00,00,00,38,00,30,00,00,00,34,00,30,00,30,>>%temp%ipfilter.reg
echo 00,30,00,00,00,00,00>>%temp%ipfilter.reg
echo.>>%temp%ipfilter.reg
regedit /s %temp%ipfilter.reg
del %temp%ipfilter.reg
echo IP 筛选器设置成功!
echo 请按任意键退出!
pause>nul
利用ipseccmd 和 IP 筛选器 来关闭危险端口
记事本-保存扩展名为.bat(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)