home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / BATCHCOL.ZIP / MISC.ZIP / BATFELLW.TXT
Text File  |  1996-12-12  |  6KB  |  131 lines

  1.                         ╔════════════════════╗
  2.                         ║ Batch File Viruses ║
  3.                         ╚════════════════════╝
  4.  
  5. Usually virus writers strive to make their viruses as complex as
  6. possible to prevent anti-virus programs from detecting them. Certain
  7. writers, however, try to push their creations to the utmost limits of
  8. simplicity. Some of them have wanted to create the smallest possible
  9. virus -- at the moment, the smallest virus consists of just 25 bytes --
  10. while others have taken advantage of DOS's relatively simple batch
  11. language and written viruses infecting BAT files.
  12.  
  13. BAT viruses do not usually pose a serious threat due to their
  14. simplicity. They are generally unable to spread quickly between
  15. computers, so infections that do happen are normally limited to small
  16. areas.
  17.  
  18. Ralf Burger published the world's first known BAT virus in his book Das
  19. große Computerviren-Buch in 1987, calling it VR.BAT. VR.BAT did not,
  20. however, function purely on DOS batch language, for it used also
  21. machine-language code located in a separate file. Since the virus
  22. destroyed its victim, it generally did not take long for a user to smell
  23. something fishy.
  24.  
  25. Batman
  26. ------
  27.  
  28. A few other simple BAT viruses have been found since Burger's VR.BAT. At
  29. the turn of the year, however, a batch file virus unlike any other BAT
  30. virus previously encountered, called Batman, was discovered. What made
  31. Batman stand apart from other BAT viruses was its ability to install
  32. itself into memory. This is possible, since the Batman virus contains
  33. binary-form machine language code inside the BAT listing.
  34.  
  35.         @ECHO OFF
  36.         REM  <binary code>
  37.         copy %0 b.com>nul
  38.         b.com
  39.         del b.com
  40.         rem  <binary code>
  41.  
  42. In other words, the virus first renames itself as B.COM, after which it
  43. executes this file as a normal COM program. This is made possible by the
  44. fact that the capital-letter @ECHO OFF and REM commands at the beginning
  45. of the file translate to machine language commands which have no bearing
  46. on the functioning of the virus whatsoever.
  47.  
  48.         Text                 Code
  49.         -----------------------------------
  50.         @                    INC AX
  51.         E                    INC BP
  52.         C                    INC BX
  53.         H                    DEC AX
  54.         O                    DEC DI
  55.         <space>OF            AND [BX+46],CL
  56.         F                    INC SI
  57.         <enter><next line>R  OR AX,520A
  58.         E                    INC BP
  59.         M                    DEC BP
  60.  
  61. The first part of the binary code includes a jump command to the end
  62. part of Batman's code. The end part contains the commands for installing
  63. the virus into memory. Since Batman does not check memory before
  64. installing itself, the virus reinstalls itself into memory every time an
  65. infected file is executed. Little by little, it eats away the available
  66. memory.
  67.  
  68. The virus monitors write operations to files while it is active in
  69. memory. It checks the beginning of files every time they written to. If
  70. the file in question starts with the command @ECHO, the virus judges it
  71. to be a batch file and infects it. Since Batman makes no attempt to
  72. check whether it has already infected a file, the same file can be
  73. infected many times over. Moreover, if several copies of the virus have
  74. installed themselves into memory, every single one of them infects the
  75. batch files that are being written to.
  76.  
  77. Case: The Batch Virus "BAT-Parasite" in Finland
  78. -----------------------------------------------
  79. At the beginning of June, the F-PROT Support of Data Fellows Ltd.
  80. received a letter from Lahti, Finland, signed by a person using the
  81. pseudonym Pelimies (Player). A diskette containing a virus that spreads
  82. via BAT files was included in the letter. In the letter, the writer
  83. explained that the virus had infested his and his friends' computers for
  84. months, and that it had also infected the microcomputers of his school.
  85.  
  86. Closer examination proved the virus to be wholly functional, if somewhat
  87. simple. It consists of BAT files, the joint length of which measures
  88. 1111 bytes. The virus conceals itself by hiding three of its four BAT
  89. files by using the DOS command ATTRIB. One of its files, CHECK.BAT,
  90. contains the following text in its beginning:
  91.  
  92.         Copyright (c) 1993 damage program laboratory,  Finland
  93.         Program  PARASITE
  94.         This version is harmless voyager
  95.  
  96. The virus was duly named BAT-Parasite.
  97.  
  98. The virus spreads via diskettes. A contaminated diskette contains one
  99. visible file, PELI.BAT (Peli is Finnish and means "game"), which, when
  100. executed, copies itself and the hidden virus files to the \DOS directory
  101. of the logical disk C. At the same time, BAT-Parasite renames the file
  102. FORMAT.COM, giving it the name F.COM. A compensating file called
  103. FORMAT.BAT has been included in the virus to prevent the user from
  104. noticing the switch.
  105.  
  106. BAT-Parasite infects diskettes when they are formatted. When a user
  107. tries to run the FORMAT program, the viral FORMAT.BAT file first
  108. executes F.COM, using the command line switches the user has given.
  109. Having done that, the CHECK.BAT file copies the viral files to the
  110. diskette.
  111.  
  112. All the diskettes formatted in a contaminated computer contain the
  113. visible file PELI.BAT and the three hidden viral files. The creator of
  114. BAT-Parasite has relied on an enticing name to have people execute the
  115. BAT file in their computers. When PELI.BAT is executed, the virus copies
  116. itself from the diskette to the hard disk and displays the message:
  117.  
  118.         ERROR,  game not start
  119.  
  120. after which it terminates its execution.
  121.  
  122. The virus is unable to spread if a computer does not contain the
  123. directory C:\DOS. The functioning of BAT-Parasite is also hindered, but
  124. not completely blocked, by the lack of the programs ATTRIB and FORMAT.
  125.  
  126. Even though BAT-Parasite is not a serious threat, it can spread quite
  127. unnoticed despite its simple structure. The virus can be removed by
  128. simply deleting the files PELI.BAT, RESIDENT.BAT, CHECK.BAT and
  129. FORMAT.BAT, and changing the name of F.COM back to FORMAT.COM.
  130.  
  131.