home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / upchek_b.lzh / Upchek.doc < prev   
Text File  |  1993-08-26  |  14KB  |  338 lines

  1.  
  2.  
  3.  
  4.                                  Upchek (beta)
  5.                                  August 25, 1993
  6.                                  Kim Bergman
  7.  
  8.  
  9.  
  10. Upchek.cmd is a REXX program that automates the process of checking ZIP, 
  11. ZOO, LZH, ARJ, ARC and uncompressed files for viruses.  It also checks for 
  12. damaged (corrupted) archives.  
  13.  
  14. Although non-sysops might find Upchek useful too, it was designed and 
  15. written primarily to assist Maximus/2 sysops who want to check uploads.  It 
  16. should be multi-line compatible but I haven't tested it that far.  It has
  17. been thoroughly tested on my single line Max system and I think it's 
  18. bug free.  However, you never know.  This is, therefore, a beta version 
  19. with an extra little warning to multi-line systems ..... test it before 
  20. you trust it!  Do let me know how it works for you, please.  My addresses
  21. are listed near the end of this document.
  22.  
  23.  
  24. License Agreement
  25. ================= 
  26.  
  27. You are permitted to use Upchek (beta) in private, personal or commercial 
  28. environments free of charge.  Kim Bergman retains copyright and sole 
  29. ownership.  You may distribute Upchek (beta) freely as long as you
  30. distribute the archive intact.  You are allowed to modify Upchek.cmd for
  31. your own purposes but are not allowed to distribute the modified code to
  32. other parties under the name Upchek or any similar name.  
  33.  
  34.  
  35. Disclaimer
  36. ========= 
  37.  
  38. I am neither an expert on virus detection nor an accomplished OS/2 
  39. programmer.  There is no guarantee that Upchek will meet your needs 
  40. regarding virus detection and I assume no responsibility for losses or 
  41. damage due to deficiencies in Upchek.  
  42.  
  43.   
  44. Rationale
  45. ======== 
  46.   
  47. OS2SCAN v.1.06 by McAfee and Associates is incapable of detecting a virus 
  48. planted in a file that has been archived.  Files must be unarchived before 
  49. they can be properly checked for viruses and sysops who accept uploads often 
  50. find that this can be a time consuming process.  Normally each upload must 
  51. be dearchived then the files must be scanned and deleted.  Upchek.cmd 
  52. automates that process almost completely.  
  53.  
  54. My purpose in writing Upchek was to use Maximus/2's facility for virus 
  55. checking a file immediately after a caller uploads it.  As soon as a caller 
  56. uploads and before he logs off Maximus will, if configured properly, call a 
  57. batch file specified in Maximus.ctl to check the upload.  Upchek.cmd is 
  58. simply that batch file.  Although Upchek was written specifically to serve 
  59. Maximus/2, it will serve anybody when invoked from the command prompt with 
  60. the proper parameters.  
  61.  
  62.  
  63. Overview
  64. ======== 
  65.  
  66. Upchek.cmd performs the following steps:  
  67.  
  68. 1. Checks the parameters it receives, responds intelligently to "?", "help" 
  69.    and insufficient parameter situations.
  70.  
  71. 2. Copies the file specified by the parameters from its home or upload 
  72.    directory into a temporary work directory.
  73.  
  74. 3. If the file is an archive then dearchives it and deletes it from the work 
  75.    directory, leaves the original copy in the home or upload directory.
  76.  
  77. 4. Calls OS2SCAN to scan the files in the work directory.  
  78.  
  79. 5. Checks to see if there were archives in the previous archive.  If yes 
  80.    then goes back to step 3. If no then goes to step 6.
  81.  
  82. 6. Writes 2 reports:  1 for caller and 1 for sysop.  
  83.  
  84. 7. Either deletes or moves bad upoads to a "bad directory" or leaves them 
  85.    where they are.
  86.  
  87. 8. Deletes the work directory.  
  88.  
  89. The need for step 5 and the possible return to step 3 may not be immediately 
  90. obvious.  Hopefully the section "Loopholes" will explain.
  91.  
  92.  
  93.  
  94. System Requirements
  95. =================== 
  96.  
  97. Upchek is written in the REXX language and was developed and tested under 
  98. OS/2 2.0 and 2.1.  The basic REXX interpreter is required but the REXX 
  99. extensions are not.  Upchek.cmd will not run under DOS or Windows unless 
  100. there are REXX interpreters for DOS and Windows that I am unaware of.  
  101.  
  102. Upchek.cmd does absolutely no dearchiving or virus scanning on its own.  It 
  103. relies on external programs to do those chores.  If you want Upchek to 
  104. handle a variety of archives then you must install dearchiving utilities 
  105. too.  A virus scanner is also required.  Upchek.cmd is configured to work 
  106. with the following OS/2 programs and with a few modifications it might work 
  107. with others too:  
  108.  
  109. 1. Unzip 5.0 from Infozip.  
  110.  
  111. 2. Arc2, the official OS/2 release from SEA.  
  112.  
  113. 3. Unarj, the demo version by Robert Jung, Scott Dudley's port will likely 
  114.    work as well but may require changes to the switches.
  115.  
  116. 4. LH2, version 2.22 from Peter Fitzsimmons.  
  117.  
  118. 5. Zoo, version 2.1 by Rahul Dhesi.  
  119.  
  120. 6. OS2SCAN, version 1.06 from McAfee Associates.  
  121.  
  122. If you do not have all the above (or equivalent) dearchivers then you can 
  123. still run Upchek.cmd.  However a non-fatal error will occur when it tries to 
  124. dearchive a file for which you do not have the required dearchiver.  The 
  125. error is interpreted to mean that the archive is corrupted and Upchek will 
  126. delete the file if you have configured Upchek to delete bad files.  A 
  127. temporary solution you can use until you get all the dearchivers is to use 
  128. Badact Rename or Badact Move in Upchek.cfg.  
  129.  
  130.  
  131. Installing and Configuring Upchek
  132. ================================= 
  133.  
  134. 1. Copy Upchek.cmd, Scanopts.txt and Upchek.cfg to the directory in which
  135.    Maxp.exe resides.  Copy Cdoor.mec to the directory in which your other
  136.    mecca files (*.mec files) reside.  If you are not a Maximus sysop then
  137.    copy Upchek.cmd and Scanopts.txt to whatever directory you wish to run
  138.    Upchek.cmd from.  Non-sysops do not require Cdoor.mec and may delete it. 
  139.  
  140.  
  141. 2. Configure Upchek by editing Upchek.cfg.  The comments in Upchek.cfg will
  142.    guide you.
  143.  
  144.  
  145. NOTE:  Installation steps 1 and 2 are all that is necessary to use
  146.         Upchek.cmd from the command line.  To complete the setup for 
  147.         Maximus you should proceed with steps 3 to 5.
  148.  
  149.  
  150. 3. Edit Max.ctl and define the name of the batch file on the Upload Check
  151.    Virus line in Maximus.ctl.  Edit the line to read:
  152.  
  153.                  Upload Check Virus Upchek.cmd
  154.  
  155.    Consult Max_ref.prn, page 42, for more details.
  156.  
  157.  
  158. 4. Edit Menus.ctl and find the line that invokes Max's upload procedure.  It
  159.    is usually in the "Menu File" section and will look something like:
  160.  
  161.                  Upload Disgrace "Upload(send)"
  162.  
  163.    Change that line to:
  164.  
  165.                  NoDsp Upload                Disgrace "U"
  166.  
  167.  
  168.    Make sure there is a space after NoDsp.  Now add a line that runs
  169.    Chekdoor.bbs when a caller uploads.  Chekdoor.bbs must run before Max's
  170.    upload procedure so put the following line or something more suitable for
  171.    your system on the line above the one that invokes the upload procedure:
  172.  
  173.                Display_File   misc/cdoor     Disgrace "Upload(send)"
  174.  
  175.    The final result should look something like:
  176.  
  177.                Display_File   misc/cdoor     Disgrace "Upload(send)"
  178.                NoDsp Upload                  Disgrace "U"
  179.  
  180. Usually Max's *.mec and *.bbs files are stored in the "misc" subdirectory of 
  181. Max's main directory.  If your "misc" directory is called something else 
  182. then make the appropriate change to the line that begins with 
  183. "Display_File".  The file Cdoor.mec should be in that directory and should 
  184. be compiled to Cdoor.bbs with Meccap.  Refer to the Maximus docs for more 
  185. information on running the MECCA compiler.  
  186.  
  187. 5. Now run "siltp max" and "meccap misc\cdoor".  
  188.  
  189. 6. Go back to step 1 and check your work.  
  190.  
  191.  
  192. Command Line Usage
  193. ================== 
  194.  
  195. If you have completed installation steps 1 and 2 then you can run Upchek.cmd 
  196. from the command prompt with:  
  197.  
  198.             Upchek <parameter1> <parameter2> <parameter3> <parameter4>
  199.  
  200. All four parameters are required and they must be separated by spaces.  
  201.  
  202. PARAMETER1 = The path to the directory in which the file to be scanned 
  203. currently resides, also referred to as the file's "home directory".  If 
  204. "help" or "?"  is used for parameter1 then help will be provided.  If 
  205. parameter1 is a path then it must end with a "\" character.  
  206.  
  207. PARAMETER2 = The root filename (stem) of the file.  
  208.  
  209. PARAMETER3 = The extension, including a leading ".", of the root filename 
  210. specified in parameter2.  
  211.  
  212. PARAMETER4 = "/L", "L", "/l" or just "l".  This parameter causes Upchek.cmd 
  213. to run in Local Mode or, you could say, non-BBS mode.  Both examples below 
  214. would dearchive and scan NIX.ZIP which resides in directory d:\main\corr 
  215. use:  
  216.  
  217.           Upchek d:\main\corr\ nix .zip /L
  218.           Upchek d:\main\corr\ nix .zip l
  219.  
  220.  
  221. Serving Maximus/2
  222. ================= 
  223.  
  224. All sysops should read Max_ref.prn, page 42, for a better understanding of 
  225. what actually happens when Max invokes (calls) Upchek.cmd.  
  226.  
  227. To be sure that Upchek has installed properly you might try running Upchek 
  228. from the command line in local mode first.  If it doesn't work that way it 
  229. won't work with Max either.  Once it's installed and configured properly, 
  230. Upchek should be ready to serve Max with very little intervention from you.  
  231. All you need to do is read and occassionally delete the log file and decide 
  232. what to do with files moved to the bad uploads directory.  Whenever a caller 
  233. uploads a file Maximus will call Upchek.cmd and pass the proper parameters.  
  234.  
  235. Upchek.cmd will dearchive the upload if it is an archive in ARC, ZIP, ZOO, 
  236. ARJ or LZH format.  It will not dearchive PAK archives.  If there are 
  237. archives inside the archive then they will be dearchived too as well as any 
  238. archives inside those, etc., etc.  until there are no more archives, just 
  239. uncompressed files.  
  240.  
  241.  
  242. Loopholes
  243. ========= 
  244.  
  245. Hackers use all sorts of little tricks to spread their virus into other 
  246. computers and there is no fool proof scheme for detecting all viruses.  
  247. However, some schemes are better than others.  Consider the following 
  248. scenario.  
  249.  
  250. I take an innocent game called Game.exe and archive it with Readme.txt into 
  251. Readme.zip.  Then I plant a virus in another copy of Game.exe.  Next I 
  252. archive the infected Game.exe, Game.doc, Game.cfg and Readme.zip into 
  253. Game.zip.  Then I upload Game.zip to a BBS that uses a program similar to 
  254. but not as thorough as Upchek.  It dearchives Game.zip then notices that 
  255. Readme.zip exists and dearchives it too.  Now the infected Game.exe has been 
  256. overwritten by the clean Game.exe from Readme.zip.  Then, all the files are 
  257. scanned and of course, no virus is detected.  Later, a caller downloads 
  258. Game.zip and dearchives it but for some reason does not dearchive 
  259. Readme.zip.  Or maybe he does dearchive Readme.zip but to save a little time 
  260. he chooses not to overwite the virus bearing Game.exe with the Game.exe in 
  261. Readme.zip.  Although he might think it a little strange that a second 
  262. Game.exe exists in the Readme.zip there is no guarantee that he will 
  263. investigate.  Unaware, he installs the infected Game.exe and runs it.  
  264.  
  265.  
  266. (The point is NOT that we should always overwrite second copies in archives 
  267. when we dearchive.)  
  268.  
  269. To close the loophole demonstrated in the scenario above, Upchek proceeds 
  270. according to the steps in section "Overview".  The virus scanner is invoked 
  271. each time an archive is unpacked so that each and every file in the original 
  272. archive is scanned including duplicates.  Although this method takes more 
  273. time it is more thorough.  
  274.  
  275.  
  276. Discriminating Archives From "Normal" Files 
  277. ======================================== 
  278.  
  279. Any file that Upcheck.cmd thinks is neither ARC, ARJ, LZH, ZIP nor ZOO is 
  280. referred to as a normal file.  GIF, EXE, BMP, CMD and PAK files are examples 
  281. of normal files.  Self extracting archives are regarded as normal files too 
  282. which is one "feature" of Upcheck that I am not pleased with.  At this time 
  283. I don't know what to do with self extracting archives and welcome any 
  284. suggestions.  Future versions of Upchek will address the concern.  
  285.   
  286. Upchek "sniffs" for the identity bytes that all archives are stamped with so 
  287. it will recognize ARJ, LZH, ZIP, ZOO and ARC files even if they have an 
  288. abnormal extension, for example .XYZ.  
  289.  
  290. PAK archives are not supported and will also be treated like normal files.  
  291.  
  292.  
  293. Reports
  294. ======= 
  295.  
  296. The supplied file Report.txt contains examples of typical reports.  There 
  297. are 2 sections: log reports for sysops and online reports for callers.  Look
  298. at the first section and note that log reports are seperated by a line of 
  299. asterisks.
  300.  
  301. The first log report shows what happens when Upchek.cmd can't find the file
  302. it is supposed to process.
  303.  
  304. The second log report is typical of a file that is OK in all respects.  The 
  305. caller would receive a report similar to the first report in Section 2 of 
  306. Reports.txt.
  307.  
  308. The third log report is for an upload that has a restricted file, an
  309. archive that is corrupted and one or more viruses.  The LISTSCAND option in 
  310. Upchek.cfg was set True for this upload so the lines that start with the "+"
  311. character were produced.  With LISTSCAND False the lines starting with "+ 
  312. are not produced.  The caller would receive a report similar to the second
  313. report in Section 2 of Reports.txt.  The lines beginning with the "+"
  314. character are produced only when the DISCOURAGE option in Upchek.cfg is set
  315. True.
  316.  
  317.  
  318. Contacting the Author
  319. ================== 
  320.  
  321. I may be moving soon so the addresses below may not be valid when you 
  322. receive Upchek.  Though I may disappear from the Fido nodelist temporarily 
  323. when (and if) I move, it won't be long before I have a new FidoNet address.  
  324. If you have suggestions, ideas or bugfixes that you would like to see 
  325. incorporated into Upchek then please find some way of contacting me, if not 
  326. by netmail then perhaps via the Muffin echo.  
  327.  
  328. Kim Bergman
  329. Box 312
  330. Nobleford, Alberta
  331. T0L 1S0
  332.  
  333. voice:  (403) 824-3923
  334. data:  (403) 824-3019
  335. 1:358/25@Fidonet.org 
  336. 102:381/1@Intersports.ftn 
  337.  
  338.