Batch file example to collect a virus

Here is a small batch file i used to collect an autorun.inf virus from a previous post and submit to McAfee

rem stephen

:TOP
set /a counter+=1
set /a counter2+=1

subst p: C:\Virus\virusholder
@ping 127.0.0.1 -n 2 -w 1000 > nul

subst p: /d
attrib C:\Virus\virusholder\autorun.inf -r -h -s
attrib C:\Virus\virusholder\system.exe -r -h -s
move C:\Virus\virusholder\autorun.inf c:\virus\autorun_%counter%.inf
move C:\Virus\virusholder\system.exe c:\virus\system_%counter%.exe
copy c:\virus\system_%counter%.exe C:\Virus\avtest

if %counter2% == 9 GOTO CompressandDelete
GOTO TOP




:CompressandDelete
7zip\7z.exe a sample%counter%.zip *.inf -pinfected
7zip\7z.exe a sample%counter%.zip *.exe -pinfected
del *.inf
del *.exe
set /a counter2=0
goto TOP

Leave a Reply

Your email address will not be published. Required fields are marked *

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