教你写杀毒脚本,自己清除Autorun病毒

教你写杀毒脚本,自己清除Autorun病毒

游戏|数码彩彩2024-04-04 7:45:03348A+A-

AutoRun本身是windows系统的一种自动运行机制作,用于方便移动介质的使用,主要的原始意图是使用光盘时,当插入光盘即可自动运行光盘里的内容。

教你写杀毒脚本,自己清除Autorun病毒

 

但这一机制却被病毒利用,形成了一种Autorun类型病毒。在使用U盘、移动硬盘时,很容易感染这种病毒。

病毒传播体的文件内容格式通常为:

OPEN=AutoRun.exe:指定设备启用时运行之命令行。
ICON=Autorun.ico:指定设备显示图标。

当把它保存为autorun.inf时,如果存在于U盘根目录,那么插U盘被插入电脑时,Autorun.exe就会运行。如果此处的Autorun.exe是病毒,那么相当于插入U盘,电脑自动就中病毒了。

下面是一段VBS脚本,把它保存行“杀Autorun病毒.vbs“(名称可以任意,后缀名需为.vbs),双击运行就可以杀灭这种病毒了。

这么有用的内容,快收藏起来吧!

option explicit
'copyleft by ShareWAF.com
'auther: WangLiwen
dim fso
dim drivers
dim driver
dim sfile
dim sline
dim svir
dim stemp
set fso=createobject("scripting.filesystemobject")
set drivers=createobject("scripting.filesystemobject").drives
for each driver in drivers
 if fso.fileexists(driver &"autorun.inf") then
 set sfile=fso.opentextfile(driver & "autorun.inf",1,true)
 do while sfile.atendofstream<>true
 sline=sfile.readline
 if instr(1,ucase(sline),ucase(".exe")) then
 svir=right(sline,len(sline)-instr(1,ucase(sline),"="))
 if msgbox("发现autorun病毒:" & driver & "" & svir & vbcrlf & vbcrlf & "是否要清除?",vbyesno,"请确认")=vbyes then
 if fso.fileexists(driver & "" & svir) then
 fso.deletefile(driver & "" & svir)
 end if
 end if
 end if
 loop
 sfile.close
 fso.deletefile(driver & "autorun.inf")
 end if
next
msgbox "检测完毕"
点击这里复制本文地址 版权声明:本文内容由网友提供,该文观点仅代表作者本人。本站(https://www.angyang.net.cn)仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

昂扬百科 © All Rights Reserved.  渝ICP备2023000803号-3网赚杂谈