Board logo

标题: 结束除指定外的所有非法进程 [打印本页]

作者: 379061296     时间: 2008-12-4 00:41    标题: 结束除指定外的所有非法进程
这个扑处理是我在本论坛找到的相干文章结合写出来的,有没有高手 把此批处理再简化 再优化 提高此批处理 我是新手 @echo off mode con:cols=60 lines=18 title 结束除指定外的所有非法进程 color 17 :head @echo. @echo. @echo. @echo. @echo 输入1开始结束除指定外的所有非法进程 @echo. @echo 输入2开始循环运行结束除指定外的所有非法进程 @echo. @echo 输入3退出本次批处理所要执行的任务 @echo. @echo. @echo. @echo. @set /p C= 请输入数字按回车键确认: @if %C%==1 goto start @if %C%==2 goto test @if %C%==3 goto sound @echo. @echo 输入有误,请重新输入... @goto :head :sound exit :start c: cd C:\Documents and Settings\Administrator\Local Settings\Temp @echo 要保留的系统进程>nul @echo System>>1.txt @echo cmd.exe>>1.txt @echo=========================================>>1.txt @echo 进程为会话管理子系统用以初始化系统变量,ms-dos驱动名称类似lpt1以及com,调用win32壳子系统和运行在windows登陆过程。>nul @echo smss.exe>>1.txt @echo 客户端服务子系统,用以控制windows图形相关子系统。>nul @echo csrss.exe>>1.txt @echo windows nt用户登陆程序。>nul @echo winlogon.exe>>1.txt @echo 用于管理windows服务系统进程。>nul @echo services.exe>>1.txt @echo 本地安全权限服务控制windows安全机制。>nul @echo lsass.exe>>1.txt @echo service host process是一个标准的动态连接库主机处理服务。>nul @echo svchost.exe>>1.txt @echo 输入控制图标用于更改类似国家设置、键盘类型和日期格式。>nul @echo internat.exe>>1.txt @echo console ime ime输入法控制台软件。>nul @echo conime.exe>>1.txt @echo 是微软的虚拟磁盘共享的程序>nul @echo iscsiexe>>1.txt.exe>>1.txt @echo host process是一个标准的动态连接库主机处理服务。>nul @echo services.exe>>1.txt @echo 一个合法的系统进程,请切勿结束>nul @echo wmiprvse.exe>>1.txt @echo windows program manager或者windows explorer用于控制windows图形shell,包括开始菜单、任务栏,桌面和文件管理。>nul @echo explorer.exe>>1.txt @echo Explorer.exe>>1.txt @echo microsoft internet explorer浏览器用于浏览网页。>nul @echo IEXPLORE.EXE>>1.txt @echo notepad字符编辑器用于打开文档。在windows中附带。>nul @echo notepad.exe>>1.txt @echo 任子行监控插件>nul @echo dismanager.exe>>1.txt @echo waterframe.exe>>1.txt @echo TerminalManager.exe>>1.txt @echo Terminal.exe>>1.txt @echo 网维大师>nul @echo BarClientView.exe>>1.txt @echo ProcessSafe.exe>>1.txt @echo 驱动防火墙>nul @echo DrvAnti.exe>>1.txt @echo 冰点还原>nul @echo DF5Serv.exe>>1.txt @echo FrzState2k.exe>>1.txt @echo Pubwin2007网吧记费管理程序>nul @echo PubwinClient.exe>>1.txt @echo 万象网吧记费管理程序>nul @echo Clsmn.exe>>1.txt @echo 360安全卫士>nul @echo 360tray.exe>>1.txt @echo 360Safe.exe>>1.txt @echo QQ聊天工具>nul @echo QQ.exe>>1.txt @echo 网络游戏\大话西游>nul @echo xy2.exe>>1.txt @echo 讯雷5>nul @echo Thunder5.exe>>1.txt @echo 世界之窗浏览器>nul @echo TheWorld.exe>>1.txt @echo=========================================>>1.txt tasklist>>2.txt for /f "eol== tokens=1 delims= " %%i in (2.txt) do echo %%i>>3.txt del 2.txt findstr /v /g:1.txt 3.txt >>4.txt del 1.txt 3.txt for /f "delims=" %%a in (4.txt) do taskkill /im %%a /f >nul 2>nul del 4.txt exit :test color 1a c: cd C:\Documents and Settings\Administrator\Local Settings\Temp @echo 查看当前进程>nul @echo 要保留的系统进程>nul @echo System>>1.txt @echo cmd.exe>>1.txt @echo=========================================>>1.txt @echo smss.exe>>1.txt @echo csrss.exe>>1.txt @echo winlogon.exe>>1.txt @echo services.exe>>1.txt @echo lsass.exe>>1.txt @echo svchost.exe>>1.txt @echo internat.exe>>1.txt @echo conime.exe>>1.txt @echo iscsiexe>>1.txt.exe>>1.txt @echo services.exe>>1.txt @echo wmiprvse.exe>>1.txt @echo explorer.exe>>1.txt @echo Explorer.exe>>1.txt @echo IEXPLORE.EXE>>1.txt @echo notepad.exe>>1.txt @echo dismanager.exe>>1.txt @echo waterframe.exe>>1.txt @echo TerminalManager.exe>>1.txt @echo Terminal.exe>>1.txt @echo BarClientView.exe>>1.txt @echo ProcessSafe.exe>>1.txt @echo DrvAnti.exe>>1.txt @echo DF5Serv.exe>>1.txt @echo FrzState2k.exe>>1.txt @echo PubwinClient.exe>>1.txt @echo Clsmn.exe>>1.txt @echo 360tray.exe>>1.txt @echo 360Safe.exe>>1.txt @echo QQ.exe>>1.txt @echo xy2.exe>>1.txt @echo Thunder5.exe>>1.txt @echo TheWorld.exe>>1.txt @echo=========================================>>1.txt tasklist>>2.txt for /f "eol== tokens=1 delims= " %%i in (2.txt) do echo %%i>>3.txt del 2.txt findstr /v /g:1.txt 3.txt >>4.txt del 1.txt 3.txt for /f "delims=" %%a in (4.txt) do taskkill /im %%a /f >nul 2>nul del 4.txt @cls @echo. @echo. @echo. @echo 正在循环运行结束除指定外的所有非法进程... goto test

作者: 379061296     时间: 2008-12-4 04:40
不过我这个批处理只可以结束没有隐藏的进程,比如网吧里的机子桌面老是有垃圾广告弹出,用这个批处理满管用的,只是有的进程结束了会重新启动,希望高手能再改进下

作者: huahua0919     时间: 2008-12-4 07:45
昨天电脑中了驱动级的病毒,病毒通过进程注入到svchost进程,下载劫持列表,劫持所有杀毒及防御软件,修改host文件禁止访问相关杀软网页。 和以前病毒不一样的是,由于病毒拥有了系统最高权限,根本不产生进程及服务,无论以多快的速度删除劫持列表的文件都会被立刻恢复,电脑奇慢无比,打开我的电脑要半天,但在命令行下可以访问分区盘符。 LZ的隐藏的进程在WMIC下是可见的,用以用
wmic process where name^<^>ProcessName
的方式指定 系统进程不一定都是安全的,能看到的不一定就是真的