home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / virus / vcheck40.sit / readme next >
Encoding:
Text File  |  1988-07-05  |  17.5 KB  |  505 lines  |  [TEXT/TPAS]

  1.  
  2. Vcheck - Startup System Test program - Version 1.3 7/5/88
  3. by Albert Lunde, Northwestern University 
  4. Copyright ⌐ 1988 - All Rights Reserved
  5.  
  6. See "Terms of Distribution","Use","Getting Started" below: 
  7.  
  8. This is a program to detect software viruses by checking for 
  9. changes in the contents of the active system folder, the boot 
  10. blocks and all applications on connected volumes.  It does 
  11. not prevent viruses from spreading in your system, but can 
  12. alert you to their existence. It is not designed to be 
  13. specific to particular viruses, except for warning of 
  14. "dangerous" resource types when found.
  15.  
  16.         Albert Lunde 
  17.         Academic Computing 
  18.         Northwestern University 
  19.         2129 Sheridan Road 
  20.         Evanston, IL 60208
  21.  
  22.  
  23.  
  24. Terms of Distribution:
  25.  
  26. Non-commercial distribution is encouraged, with several 
  27. conditions:
  28.  
  29. 1) You must distribute the source code if you distribute the 
  30. compiled program. (The main purpose of this is to make it 
  31. difficult for viruses to spread. Users are encouraged to 
  32. recompile from the source code, since source code cannot 
  33. carry a virus.)
  34.  
  35. 2) If you modify the source code, distribute both the 
  36. original code and the modified code and include the original 
  37. comment headers with copyright notice and remarks in both 
  38. files. List a summary of your changes after the header, and 
  39. add the word "Modified" to the two Version identifiers. You 
  40. may not attach additional restrictions to distribution of the 
  41. modified code.  If I receive useful modifications, I may add 
  42. them to my versions. (Distributing the original source makes 
  43. it clearer what has been changed and may aid support.)
  44.  
  45. 3) You may change a copying fee not to exceed $10 or the cost 
  46. of media whichever is greater.  (The intent is to put 
  47. distribution of the original program and/or modified versions 
  48. into non-profit channels to allow wider distribution)  Normal 
  49. communications and connect charges for downloading software 
  50. are permitted.
  51.  
  52. ***********************************************************
  53. Version 1.3
  54.  
  55. New features and changes since version 1.2
  56.  
  57. 1) Checksums may change from earlier versions since the list 
  58. "safe" resources and files has been changed to work better 
  59. with system update 6.0.
  60.  
  61. 2) Added automatic full checksum on applications that have 
  62. changed size - this reduces false alarms on an "Application 
  63. Scan".
  64.  
  65. 3) Fixed a bug which caused named resources with trailing blanks 
  66. in the name to be treated as not equal to themselves.
  67.  
  68.  
  69. New features and changes since version "1.0 Beta":
  70.  
  71. It is easier to keep your checksums file up to date. Features 
  72. have been added to do checksums of new applications and/or 
  73. replace the old checksums file with the new file.
  74.  
  75. It is possible to check other system folders than the 
  76. currently active system.
  77.  
  78. Several options that previously were available only by 
  79. recompiling the program are now specified in a dialog and the 
  80. input file.
  81.  
  82. Checksums may change from the earlier version since the list 
  83. "safe" resources has changed.
  84.  
  85. Four bugs fixed - 
  86.  
  87. 1) a bug affecting the results when an output file was 
  88. written after an application scan. 
  89.  
  90. 2) errors in  folder names on non-boot disk volumes, 
  91.  
  92. 3) a bug causing applications to be falsely declared as "new" 
  93. in some circumstances 
  94.  
  95. 4) a bug causing the program to freeze or bomb just after 
  96. checking the boot blocks.
  97.  
  98. Changes have been made in heap and stack treatment which I 
  99. hope will fix the intermittent errors in previous version (I 
  100. suspect a heap/stack collision during an interrupt handler).
  101.  
  102. ***********************************************************
  103.  
  104. Hardware and Software:
  105.  
  106. Written in Turbo Pascal 1.1 for the Mac (tested on a Mac SE 
  107. and a Mac II) this should run on a Mac Plus,Mac SE or Mac II. 
  108. I am not sure if a Mac 512E has enough memory.  This assumes 
  109. you have HFS and a relatively recent system so it is not 
  110. appropriate for the 128K or 512K Macs with the old 64K ROMs. 
  111. Some versions of the program compiled and ran with Turbo 1.0 
  112. but I haven't tested this much.
  113.  
  114. Use:
  115.  
  116. The program expects to find an input file named 
  117. "OldSystemCheckSum" in either the default folder or the 
  118. system folder.  It will optionally write an output file in 
  119. the same format as the input file.  (Both are text files with 
  120. items separated by tab characters.  The output file is named 
  121. "OldSystemCheckSum" if no input file exists and 
  122. "NewSystemCheckSum" otherwise.)  
  123.  
  124. The program compares the contents of your system folder with 
  125. information in the input file, and tells you about changes. 
  126. It also does a less detailed check of applications. It monitors 
  127. the existence of hidden files.
  128.  
  129. You have the option of replacing the input file with the 
  130. output file after reviewing changes on-screen. 
  131.  
  132. Use of this program does not prevent a virus infecting your 
  133. system, but it may give you an indication that you are 
  134. infected, and thereby prevent infection of your backups. (Yet 
  135. another reason to keep several sets of backups.)
  136.  
  137. When the program starts you are presented with a choice of 
  138. five buttons:
  139.  
  140. "System Only" button:
  141.  
  142.   This does a complete check of the system folder, and does 
  143.   nothing with applications and hidden files elsewhere.
  144.  
  145. "Application Scan" button:
  146.  
  147.   This will start a complete check of the system folder and 
  148.   a check for changes in the sizes the resource forks of 
  149.   applications. After about 10 seconds the Mac will continue as 
  150.   if you had clicked this option. This is faster but less 
  151.   accurate than the "Full Check". Because some applications 
  152.   write preferences information to their own resource fork, 
  153.   checking the size is not an ideal check. When an application 
  154.   appears to have changed size, a full checksum is done on it. 
  155.   This reduces false alarms. However, the size check can still 
  156.   be evaded by a careful virus.
  157.  
  158. "Full Check" button:
  159.  
  160.   This does a complete check of the system folder and a 
  161.   check for changes in resources of applications. Only resource 
  162.   types marked as known to contain executable code are checked 
  163.   in applications and invisible files.  It is recommended that 
  164.   you use "Full Check" periodically, especially before making 
  165.   backups, as it is much more difficult than "Application Scan" 
  166.   for a virus to evade.  It is not the default, because it can 
  167.   take several minutes to run.
  168.  
  169. "Skip It" button:
  170.  
  171.   Halts the program
  172.  
  173. "ShutDown" button:
  174.  
  175.   Flush all drives and do a system shutdown. (similar to 
  176.   the item in the Finder Special Menu).
  177.  
  178. If you press the option key before or while clicking one of 
  179. these buttons, you will be presented with additional options, 
  180. including the option to write an output file and/or to check 
  181. a different system folder than the startup system. (More 
  182. about this below).
  183.  
  184. Key Commands:
  185.  
  186.      (the command key is ignored)
  187.  
  188.  
  189.   "Q"- Quit after closing files 
  190.  
  191.   "F"- same as "Full Check" button 
  192.  
  193.   "A"- same as "System Only" Button 
  194.  
  195.  
  196.   "Y"- same as Yes Button 
  197.  
  198.   "N"- same as No  Button 
  199.  
  200.   "."- Quit immediately 
  201.  
  202.   Return Key - Default button (with bold outline) 
  203.  
  204.   "*"- invoke MacsBug debugger and turn on additional output.
  205.  
  206.        (don't use this command without a debugger) 
  207.  
  208.   "^"- invoke MacsBug debugger
  209.        (don't use this command without a debugger) 
  210.  
  211.   "&"- turn on debugging output 
  212.  
  213.   "#"- turn on debugging output for resource/application detail
  214.        comparison routines
  215.  
  216. After the program starts, at any time you may quit the 
  217. program by clicking the "Halt" button or pressing the "Q" 
  218. key. You may shut down the system with the "Shutdown" button.
  219.  
  220. To get started:
  221.  
  222. Place the compiled program anywhere outside the system folder 
  223. and run it, clicking on "Full Check". It may be necessary to 
  224. increase the memory allowed by MultiFinder using the Get Info 
  225. dialog. (500K is reasonable).
  226.  
  227. The first time you run it, the program will not find the 
  228. input file, and will ask you if you want to specify another 
  229. input file. Click on NO. Click YES when it asks you to 
  230. specify an output file.  You will then see a standard dialog 
  231. to save a file using the name "OldSystemCheckSum". Click on 
  232. the save button.  
  233.  
  234. When the program runs, the output file should contain a 
  235. summary of resources in the system file and of applications 
  236. and hidden files. This checks all connected disk drives, 
  237. optionally excluding floppies and folders on AppleShare file 
  238. servers.
  239.  
  240. Now, whenever you run the program, it will use the file 
  241. "OldSystemCheckSum" as a standard of comparison and inform 
  242. you of changes.  If you want maximum protection, make this 
  243. program your startup application with Set Startup.
  244.  
  245. When you install new software in the system folder or make 
  246. some changes in system settings you may get messages about 
  247. new or changed resources.  You will also get messages when 
  248. you add an application, or move, rename or duplicate an 
  249. application.  If an application writes setup/preferences 
  250. information into itself, it will be listed as a "Safe change 
  251. in size", provided no unsafe resource types are changed.
  252.  
  253. To see how these messages look, move some small application 
  254. into the system folder and re-run the program.
  255.  
  256. These messages reporting changes will continue to appear 
  257. until you create an new output file (default name 
  258. "NewSystemCheckSum") and rename it to  "OldSystemCheckSum". 
  259. You will be offered the option to create an output file and 
  260. later to rename it whenever changes are reported.
  261.  
  262. If you have not done a full checksum, and you choose to write 
  263. an output file the program will recompute checksums for some 
  264. applications, usually new application or applications moved 
  265. between folders. This is a feature designed to keep your 
  266. checksums file up to date. To be safe and informed of all 
  267. changes, however, you should run "FullCheck" periodically, 
  268. and only OK replacing your input file at other times when you 
  269. know the reason for changes in the system or applications.
  270.  
  271. To get a complete check and create a output file, hold down 
  272. the option key while clicking of the "FullCheck" button at 
  273. startup. Running "FullCheck" whenever you write an output 
  274. file gives you the information necessary to do a complete 
  275. comparison later.
  276.  
  277. If changes seem minor (like a moved or new application), you 
  278. can rename the output file within the program and replace the 
  279. input file, or you can compare and or print the input and 
  280. output files with a text editor after running the program, 
  281. then rename the output file with the Finder.
  282.  
  283. In the output file, new or changed resources are flagged 
  284. "new??" or "changed??". Deletions are not marked. 
  285. Applications are marked as "moved/renamed??',"new??", 
  286. "changed??" or "safe changed??". Hidden files are marked as 
  287. "(hidden)" if they are not applications.
  288.  
  289. The output file is first written, then you are asked if you 
  290. want to rename it. If you say yes, the input file is deleted 
  291. and then the output file is moved and renamed to the same 
  292. folder and filename used by the input file.
  293.  
  294. You will not be offered the option to rename the output file 
  295. if it and the input file are on different disk drives.
  296.  
  297. Since the output file is written before deleting the input, 
  298. there must be space on disk for both files. You can quit 
  299. anytime prior to telling the computer to rename the output 
  300. without affecting the input file.
  301.  
  302. Options:
  303.  
  304. Pressing the option key before or while you click on the 
  305. startup dialog buttons will cause the program to offer you a 
  306. number of options.
  307.  
  308. You are asked if you want to write an output file.
  309.  
  310. Several options that control what is checked are collected 
  311. together on a dialog screen.
  312.  
  313. "Check Floppies" is a check box that controls if floppy 
  314. diskettes are checksummed. (no by default)
  315.  
  316. "Check Non-Startup Drives" is a check box that controls if 
  317. disk volumes besides the volume containing the system folder 
  318. being checked are checked.
  319.  
  320. By default the program only looks at the top level of 
  321. AppleShare file Servers, and does not descend into folders 
  322. unless you are the owner. The "Appleshare Access" buttons 
  323. allows you to change this, and search all folders for which 
  324. you have read/write access or "everything in sight" (folders 
  325. for which you have search access). (Using these options can 
  326. place quite a load on Appleshare.)
  327.  
  328. All the options in the dialog screen are stored in the output 
  329. file and default values are read from the input file if any.
  330.  
  331. Specifying a different system to check:
  332.  
  333. If you hold down the options key, another question you are 
  334. asked is if you want to specify another system folder to 
  335. check. If you say yes, you are presented with a file dialog. 
  336. Pick a system folder and select the "System" or any other 
  337. file in the folder.
  338.  
  339. This is useful when checking a system you believe to be 
  340. infected after booting from a floppy disk. 
  341.  
  342. If you want to check the system on a suspect floppy disk, 
  343. turn on "Check Floppies", turn off "Check Non-Startup Drives" 
  344. and then select the system folder on the floppy disk to 
  345. check. (DO NOT BOOT from a suspect disk or run any 
  346. applications on it).
  347.  
  348. More about the Checksums:
  349.  
  350. In order to reduce unnecessary messages and speed processing, 
  351. some resources and some parts of the boot blocks are excluded 
  352. from the checks. Resources types are classified as:
  353.  
  354.      0 "Safe"
  355.  
  356.        (Not containing executable code) 
  357.        for example: 
  358.        "STR#","FONT","ICON"
  359.  
  360.      1 "Unknown"
  361.  
  362.         (Not otherwise classified)
  363.  
  364.      2 "Unsafe"
  365.  
  366.         (Containing executable code) 
  367.         for example:"CODE","INIT" 
  368.         (or sometimes occurring in reported viruses,
  369.         sometimes in normal use)
  370.  
  371.      3 "Dangerous"
  372.  
  373.         (Known only to occur in reported viruses)
  374.  
  375. "Safe" resources are excluded from system folder checksums.
  376.  
  377. Only "unsafe" resources are checked in application and hidden 
  378. files and only a file by file checksum is kept, not a 
  379. resource by resource checksum.
  380.  
  381. A basic list of resource types is in the program, and 
  382. "unknown" resources can be reclassified by changing the input 
  383. file.
  384.  
  385. There is also a list of key phrases which indicate a file in 
  386. the system folder may safely contain changes in "unknown" 
  387. resource types. If one of these keywords is found as a 
  388. substring in the filename both "safe" and "unknown" resources 
  389. are excluded from checksums. This is used to reduce 
  390. unnecessary warnings about changes in the Clipboard, 
  391. Scrapbook, Macro and settings files stored in the system folder.
  392.  
  393. A checksum of checksums is done across resource types.  This 
  394. will change when any contents of the checked resources change 
  395. or when the criteria for what is to be checked change.  This 
  396. will change when resources are deleted, while the resource by 
  397. resource lists of changes only indicate new or changed 
  398. resource.
  399.  
  400. No grand checksum is done for applications. The way that 
  401. applications are identified is by their 4 character creator 
  402. signature and creation date and time.
  403.  
  404. Hidden files are not checked for size on a short check and 
  405. they are only checked for "unsafe" resource type changes on a 
  406. full check. This is because the DeskTop and other normal 
  407. hidden files change size.
  408.  
  409. To make it more difficult to evade checksums, users are 
  410. encouraged to change the value of the constant 
  411. "checksumsaltinc" from $00010001 to some other longword hex 
  412. value containing mostly zeros, but some non-zero digits in 
  413. both the lower and upper half. Changing this value changes 
  414. the non-linearity of the checksums, and changes the results, 
  415. so that a change that would be undetected for one value might 
  416. not be for another.
  417.  
  418. Disclaimers:
  419.  
  420. I do not warrant that this software will alert you to all 
  421. viruses. (It won't.) I don't claim to be an expert in 
  422. eradicating software viruses and can not do long-distance 
  423. consulting on problems with them. I have designed this 
  424. program from general considerations rather than experience 
  425. with particular viruses.
  426.  
  427. I have taken reasonable care that this program do no harm, 
  428. but I cannot assure this.  My main consideration has been to 
  429. put something together quickly to help detect viruses and 
  430. reduce their spread. Getting this out the door in time to be 
  431. useful precludes exhaustive testing.
  432.  
  433. Northwestern University Apple Tech Support is assisting in 
  434. distributing this program, but they do not take 
  435. responsibility for its continued support.
  436.  
  437. Acknowledgements:
  438.  
  439. Thanks to Bob Hablutzel and John Norstad for their advice and 
  440. support during the development of the program.
  441.  
  442. This code owes a lot to a number of sources. My resources 
  443. include:
  444.  
  445. "Inside Macintosh" Volumes I to V
  446.  
  447. (A lot of use is made of the resource section and the Volume 
  448. IV parameter block file system calls}
  449.  
  450. Apple Tech Notes (in particular):
  451.  
  452. 67  Finding the blessed folder 
  453. 68  Searching all Directories on an HFS Volume 
  454. 69  Setting ioFDirIndex in PBGetCatInfo Calls 
  455. 77  HFS ruminations
  456.  
  457. "MacTutor" Magazine 
  458. "Macintosh Revealed" Vol I & II by Stephen Chernicoff 
  459. "How to Write Macintosh Software" by Scott Knaster 
  460. "Macintosh Programming Secrets" by Scott Knaster 
  461. "Programming with Macintosh Programmer's Workshop" by Joel 
  462. West 
  463. "Fundamentals of Data Structures" by Ellis Horowitz and 
  464. Sartaj Sahni 
  465. "Programming Pearls" Jon Bentley
  466.  
  467. MacNosy disassembler/debugger by Steve Jasik
  468.  
  469. Bug Reporting:
  470.  
  471.     I can be reached at:
  472.  
  473. E-Mail
  474.  
  475.         LUNDE@NUACC.BITNET
  476.  
  477.         LUNDE@NUACC.ACNS.NWU.EDU  (Internet)
  478.  
  479. U.S. Mail
  480.  
  481.         Albert Lunde 
  482.         Academic Computing 
  483.         Northwestern University 
  484.         2129 Sheridan Road 
  485.         Evanston, IL 60208
  486.  
  487. Related messages can also be sent to me care of Northwestern 
  488. University Apple Tech Support:
  489.  
  490.         A42 - AppleLink;
  491.  
  492.             or
  493.  
  494.         76474,154   - CompuServe
  495.  
  496. If you get system bombs, record the ID number and what was 
  497. happening prior to the error. If you have Macsbug, use "wh" 
  498. to see where you are in memory. If you have any debugger, 
  499. record the registers. Since this is a non-commercial effort, 
  500. and I am giving out the source code, whatever you can do to 
  501. localize and diagnose bugs will be appreciated.   I do not 
  502. know at this time how much time I can or will spend on 
  503. support and revisions.
  504.  
  505.