最近发现公司员工都是使用的是360、金山、nod32等杀毒软件,只是运行在电脑上,没有详细的调试,我这样做除了能解决一下明显的病毒外,其他的加壳的病毒基本防御不了,所以我就简单的弄了个脚本,参照网络的一下脚本知识,弄了个关闭不安全端口,希望多大家有用!

    @echo off

    title 关闭常见的危险端口

    echo.

    echo 本批处理用于启动XP系统的防火墙并关闭常见的危险端口

    echo.

    echo 请确认您正在使用的是XP系统 并且未安装其他防火墙

    echo.

    echo 以避免与XP系统的防火墙发生冲突

    echo.

     pause


    echo 正在启动防火墙 请稍候…

    netsh firewall set opmode mode=enable

    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 正在关闭161端口 请稍候…

    netsh firewall set portopening protocol = ALL port = 161 name = 161 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 正在关闭2745端口 请稍候…

    netsh firewall set portopening protocol = TCP port = 2745 name = 2745 mode = DISABLE scope = ALL profile = ALL

    echo 正在关闭3127端口 请稍候…

    netsh firewall set portopening protocol = TCP port = 3127 name = 3127 mode = DISABLE scope = ALL profile = ALL
 
    echo 正在关闭3389端口 请稍候…

    netsh firewall set portopening protocol = ALL port = 3389 name = 3389 mode = DISABLE scope = ALL profile = ALL
  
    echo 正在关闭6129端口 请稍候…

    netsh firewall set portopening protocol = TCP port = 6129 name = 6129 mode = DISABLE scope = ALL profile = ALL
    cls

    echo.

    echo          常见的危险端口已经关闭

    echo.

    echo                                By: Alan.deng

    echo.

    echo 按任意键退出

    pause>nul