編寫autorun病毒免疫工具

autorun病毒的危害相信中過招的人都有體會(huì)。其最大的特點(diǎn)就在于很難清除干凈,現(xiàn)在可以提前對(duì)系統(tǒng)分區(qū)做一次免疫工作,而那些已經(jīng)中了autorun病毒的用戶也能順便將病毒清除。  
    
有人曾經(jīng)使用系統(tǒng)組策略的方法,不過對(duì)于初學(xué)者來說有點(diǎn)復(fù)雜。現(xiàn)在復(fù)制以下代碼到文本文件中,保存為bat文件即可。
    @echo off
cls
echo          按 S 鍵刪除Autorun.inf并進(jìn)行免疫
echo.
echo          按 D 鍵刪除免疫程序
echo.
echo          按其他任意鍵退出
echo.
echo.
SET Choice=
SET /P Choice=        請(qǐng)選擇要進(jìn)行的操作:  
IF /I ’%Choice:~0,1%’==’s’ GOTO setup
IF /I ’%Choice:~0,1%’==’d’ GOTO Delset
IF /I ’%Choice:~0,1%’==’q’ GOTO Exit
exit
:Setup
taskkill /im explorer.exe /f
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @(
    if exist %%a: (
        rd %%a:\autorun.inf /s /q
        del %%a:\autorun.inf /f /q
        mkdir %%a:\autorun.inf
        mkdir %%a:\autorun.inf\"病毒免疫勿刪除../" 
        attrib +h +r +s %%a:\autorun.inf
        
    ) 
)
start explorer.exe
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
  if exist %%a:\nul (
    >1.vbs echo msgbox^ "%%a:免疫成功",64,"提示:"
    1.vbs
  )
)
del 1.vbs
echo.
echo.
echo                        按任意鍵退出...
pause>nul
exit
:delset
For %%a In (C D E F G H I J K L M N O P Q R S T U V W X Y Z) Do @(
    If Exist %%a: (      
        rd %%a:\autorun.inf /s /q
                
    ) 
)
echo.
echo.
echo                        操作完畢,按任意鍵退出...
pause>nul
exit

    具體原理為通過檢測(cè)autorun.inf和刪除相應(yīng)文件達(dá)到直接消滅病毒的目的。操作比較簡(jiǎn)單,只要按兩個(gè)鍵就可以了。

發(fā)表評(píng)論

(required)

This site uses Akismet to reduce spam. Learn how your comment data is processed.