home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / cops_104.zip / cops_104 / docs / CRC.README < prev    next >
Text File  |  1992-03-10  |  4KB  |  87 lines

  1.  
  2.   This README.suid and everything but the C programs has been hacked up be
  3. me, so all problems you have are probably due to me, unless you can't compile
  4. the files.  Then blame Jon :-)
  5.  
  6.   This checks for unexpected file system corruption or security breaches.
  7. It's nice to be able to say that you know all your files are as they should
  8. be.  Mark Mendel wrote most of crc.c and Jon Zeef wrote crc_check.c.  Seems
  9. to work fine on BSD or SYS V.
  10.  
  11. To use it:
  12.  
  13. 1) You first create a crc list with the script "crc.chk", which takes one
  14. argument, the seed for the crc generator.  It reads the file "crc_list"
  15. for a list of files to check; what I have are some of the more interesting
  16. binaries, but you can add or delete from this list to your hearts content.
  17. Wildcards or specific file names are fine.  The first time you run it,
  18. it will create a file called "crc.files", which contains all the crc
  19. values you generated.  Optionally, you can do a:
  20.  
  21. find / -mount -print | sort | xargs ./crc -v > crc.tmp
  22.  
  23.   However, "xargs" is a security problem, when combined with find.  Use
  24. this judiciously, if at all, unless your vendor puts some "safe" options
  25. to find in.
  26.  
  27. 2) You can now use "crc.chk" to compare this "crc.files" file to a crc list
  28. created each time you run the shell program.  If everything is ok, nothing
  29. is outputted, otherwise, the results are either mailed to the user INFORM,
  30. on line xxx, or saved to a file "crc.results".  You *MUST* use the same
  31. seed each time you run the program, or the numbers generated will be
  32. different each time you run the program, which kind of makes it useless.
  33.  
  34. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  35. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  36. IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT
  37.  
  38.   Have I got your attention?  Good.  There are some fundamental problems
  39. with using a crc program like this.  *If* you use a seed that is hardcoded
  40. in the program, or no seed at all, this is *bad*.  That means to really
  41. use this program usefully, you can't run it in crontab, like the rest
  42. of COPS.  Even worse, you should really store the results offline, since
  43. anyone who breaks into your machine can modify a binary file, run the
  44. crc checker again, then put the new values in your file.  That's the
  45. right way.  But I know that most of you won't do this, so by default,
  46. "crc.chk" just stores everything like everything else, in the COPS secure
  47. directory.  It can still help you, if the attacker doesn't know where
  48. you keep stuff, or doesn't know enough to trash your database of old
  49. crc values.  If nothing else, be sure that you keep your older values
  50. on tape or secondary medium, so when your system gets kicked around a
  51. bit, you can grab the crc program off the tape (the intruder could modify
  52. that, too, you know), run it on your binaries, and finally compare it
  53. to your old values.  Believe me, this is a lot easier, though still not
  54. perfect, than reloading everything on your system from tape, then still
  55. not knowing.  I've put it in the "cops" shell script, but left it commented
  56. out, on line 123, so if you want to use it this way, just uncomment this
  57. line.
  58.   One thing you can do, if you keep the numbers online, is do a crc on the
  59. file of values you keep; write it down, or memorize it, then if it is ever
  60. tampered with, you can detect it.
  61.  
  62.   Jon goes on about the initial crc value, and other stuff:
  63.  
  64. =========================================================================
  65.   ... don't tell anyone what this is, you can 
  66.   make it nearly impossible for anyone to modify a file in such a way 
  67.   that it has the same crc value as the old one (primarily because they 
  68.   don't know what the old one was).  If anyone does discover a way to 
  69.   make files of the same size that produce the same unknown crc value 
  70.   for any unknown -i value, let me know.  
  71.  
  72.   To really do it right, you need to 
  73.  
  74.   1) Run find_crc in single user mode (unless you modify the crc source).
  75.   2) Store all crc results offline.
  76.   3) Don't let anyone see your -i value or the crc results.
  77.  
  78.   Please send me any modifications you make.
  79.  
  80.   Jon Zeeff
  81.   zeeff@b-tech.ann-arbor.mi.us
  82. =========================================================================
  83.  
  84.   Send 'em to me, too!
  85.  
  86.  -- dan
  87.