home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / utils / condom.zip / CONDOM.DOC next >
Text File  |  1988-05-30  |  5KB  |  141 lines

  1.           DOCUMENTATION FOR CONDOM.ARC - May 30, 1988
  2.  
  3.     "The only protection against the virus, short of total
  4. abstinence is the use of a condom."
  5.  
  6.     I first became aware of the existence of the software
  7. virus in magazine articles, and I wondered what I could do to
  8. protect my computer from their insidious attack.  The prime
  9. target was usually reported to be COMMAND.COM, although just
  10. about any program could be its target.
  11.  
  12.     I reasoned that if I could compare COMMAND.COM against a
  13. known healthy copy, I could be sure that at least it had not
  14. been contaminated.  I figured I would use FC.EXE (file compare)
  15. that came with MS-DOS, in my AUTOEXEC.BAT file to check
  16. COMMAND.COM each time I booted up, and if there was a
  17. difference, flag it so I could replace COMMAND.COM before any
  18. damage was done.
  19.  
  20.     Let me regress for a minute.  The demented individuals who
  21. write these viruses, want to make sure it gets spread around,
  22. so they design them to work a few days, or a few bootups after
  23. the virus installs itself.  It is done this way to insure that
  24. the virus will be spread by formatting other diskettes, or
  25. looking at a directory in another drive that contains the
  26. program the virus installs itself in (usually COMMAND.COM).
  27. This being the case, you can most likely catch it when you
  28. bootup the computer for the next session.  If it did its dirty
  29. work immediately, I would call it a 'Trojan Horse' problem, and
  30. that requires different techniques, although you could use some
  31. of those protection methods along with the one I am describing
  32. to get close to 100% protection.
  33.  
  34.     I wanted the bootup to be automatic, stopping only if
  35. COMMAND.COM was changed.  Using FC.EXE would not work as it
  36. doesn't send an errorlevel code after it terminates, so I
  37. decided to write my own 'File Compare' utility that would
  38. output an errorlevel code.  I wanted it to be fast, and it
  39. would not have to show every byte that was different, just tell
  40. me that the two files were not identical.  I could use FC.EXE
  41. later to get a complete report of the differences.
  42.  
  43.     I called my program FCBIN.EXE (File Compare Binary), it is
  44. written in Turbo Pascal vers 4.0, and it will compare any file,
  45. reporting all the general differences, such as, Date, Length,
  46. and that the bytes did not compare.  It also tells you at which
  47. byte the first difference occured.
  48.  
  49.     I decided to check all my files in the root directory as
  50. well, by creating a sub-directory called ZROOT in which were
  51. placed uncontaminated copies of all the files in the root
  52. directory.  The file copies were renamed for additional safety,
  53. COMMAND.COM is called CMD.BAK, CONFIG.SYS is called CFG.BAK,
  54. etc.  The following examples show the contents of my root
  55. directory, the ZROOT directory, and the contents of my
  56. AUTOEXEC.BAT file.
  57.  
  58.  
  59.  Directory of  C:\
  60.  
  61. AUTOEXEC BAT        711
  62. DMDRVR   BIN       7699
  63. COMMAND  COM      23612
  64. ANSI     SYS       1651
  65. CONFIG   SYS        104
  66. MSMOUSE  SYS       6732
  67.  
  68.  
  69.  Directory of  C:\ZROOT
  70.  
  71. ANS      BAK       1651
  72. ATX      BAK        711
  73. CFG      BAK        104
  74. CMD      BAK      23612
  75. DMD      BAK       7699
  76. MSM      BAK       6732
  77.  
  78.  
  79. Contents of AUTOEXEC.BAT
  80.  
  81. echo off
  82. cls
  83. fcbin \command.com \zroot\cmd.bak
  84. if errorlevel 1 goto :stop
  85. fcbin \ansi.sys \zroot\ans.bak
  86. if errorlevel 1 goto :stop
  87. fcbin \msmouse.sys \zroot\msm.bak
  88. if errorlevel 1 goto :stop
  89. fcbin \config.sys \zroot\cfg.bak
  90. if errorlevel 1 goto :stop
  91. fcbin \dmdrvr.bin \zroot\dmd.bak
  92. if errorlevel 1 goto :stop
  93. fcbin \autoexec.bat \zroot\atx.bak
  94. if errorlevel 1 goto :stop
  95. if errorlevel 0 goto :finish
  96. :stop
  97. echo This file is different!
  98. echo Hit Ctrl-C to terminate batch file.
  99. pause
  100. :finish
  101.  
  102.  
  103.     Of course you can also have the AUTOEXEC.BAT file run the
  104. programs of your choice, and also have FCBIN check any file you
  105. might be concerned about.
  106.  
  107.     When setting this system up, you should carefully perform
  108. the following steps:
  109.  
  110.  1.  Using a cherry, uncontaminated copy of DOS, bootup the
  111. computer from a diskette in drive A:, NOT FROM THE HARD DISK.
  112.  
  113.  2.  Copy COMMAND.COM from the diskette over the COMMAND.COM on
  114. the hard drive.
  115.  
  116.  3.  Copy COMMAND.COM into your backup sub-directory, renaming
  117. it as you copy it.
  118.  
  119.  4.  Copy your CONFIG.SYS file to the backup sub-directory,
  120. renaming it as you copy it.
  121.  
  122.  5.  Copy any other files you want to check on bootup into your
  123. backup sub-directory, renaming them as you copy them.
  124.  
  125.  6.  Change your AUTOEXEC.BAT file to include the file compare
  126. routines demonstrated in the above example, and then copy it
  127. into your backup sub-directory, renaming it as you copy it.
  128.  
  129.  7.  Place FCBIN.EXE either in your root directory, or into a
  130. sub-directory with a path to it.
  131.  
  132.  8.  Reboot and check it out.
  133.  
  134.     FCBIN.EXE will output an errorlevel of zero (0) if the
  135. files are identical, and a one (1) if they are different.  It
  136. will send its report to the screen, or to a file if you desire.
  137.  You can suppress all output (except the errorlevel code - of
  138. course), by using the '/s' command line option when you run
  139. FCBIN.  Just type FCBIN without any parameters to get a short
  140. help screen.
  141.