home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 May / Chip_1998-05_cd.bin / sharewar / hmvs / HMVS.TXT < prev    next >
Text File  |  1998-01-24  |  20KB  |  446 lines

  1.  
  2.         ┌──────────────────────────────────────────────────────────┐
  3.         │          Heuristic Macro Virus Scanner/cleaner           │
  4.         │                      (user's manual)                     │
  5.         │                                                          │
  6.         │           (c) Jan Valky & Lubos Vrtik, Slovakia          │
  7.         └──────────────────────────────────────────────────────────┘
  8.  
  9.                           Last update: 25-jan-98
  10.  
  11. Sorry, this is only short version of DOX, because we're lazzy to
  12. write full DOX :)
  13.  
  14. Excuse us our english plz, it is not our native language ;(
  15.  
  16. IF YOU WANT HELP US TO IMPROVE HMVS, PLZ SEND US ANY COMMENTS OR IDEAS,
  17. NEW MACRO VIRUSES ARE WELCOMED TOO. SEND US PLZ ALL MACRO VIRUSES HMVS
  18. CAN NOT DETECT BY NAME.
  19.  
  20. ══════════════════════════════════════════════════════════════════════════
  21.                                CONTENTS
  22.  
  23. 1.   HOW TO USE HMVS
  24. 2.   METHODS USED IN HMVS
  25. 2.1  Available options, when virus was found
  26. 3.   WHAT IS MACRO VIRUS :)
  27. 4.   HEURISTIC FLAGS DISPLAYED BY HMVS
  28. ══════════════════════════════════════════════════════════════════════════
  29.  
  30. 1.   HOW TO USE HMVS
  31. ──────────────────────────────────────────────────────────────────────────
  32.  
  33. If you run HMVS without paramaters it will display the following help:
  34.  
  35. Usage: HMVS drive:[\path] switches
  36. switches:
  37.  
  38. /H,/?        - this help
  39. /ALL         - scan all files (*.*)
  40. /REP         - output to log file hmvs.log
  41. /REP=file    - output to specified log file
  42. /NOH         - disable heuristics, only scanning
  43. /NOS         - disable scanning, only heuristics
  44. /MAC         - prompt if file contains macros
  45. /IA          - nonstop scanning without prompt
  46. /CA          - automatically cleaning all infected files
  47. /RA          - automatically renaming all infected files
  48. /NOB         - disable user break with ESC key
  49. /EXT         - decrypt execute only macros (reg. version only)
  50. /FLG         - enables displaying heur. flags
  51. /HLO /HHI    - use low or high heuristics instead of standard heuristics
  52. /CV[+|-]     - force/disable converting to document
  53. /SIMPLE      - use simplified output to screen
  54. /OK          - display OK after file name if file is clean
  55. /SOURCE      - generate source code of macros
  56.  
  57. Undocumented switches:
  58. /EXPORT             - export binary images of macros to files
  59.                       (reg. version only)
  60.                       Usage: HMVS C:\BADVIR\Stragly.doc /EXPORT
  61. /LST                - display known virus names from signature file
  62.                       Usage: HMVS C:\ /LST (path is required)
  63. /HEUREXP=filename   - export informations for neural network
  64.                       (there is no benefit of using this switch for
  65.                       users except authors)
  66.                       Usage: HMVS C:\BADVIRS /HEUREXP=virii.dat
  67.  
  68. Short description of command line parameters:
  69.  
  70. /H
  71. /?           Displays help about HMVS using
  72. /ALL         All files will be scanned (*.*)
  73.              Without this parameter only files *.DOC and *.DOT
  74.              will be scanned.
  75.  
  76. /REP         Report will be logged to file HMVS.LOG
  77.  
  78. /REP=file    Report will be logged to user specified file
  79.  
  80. /NOH         Disables heuristic analysis. Only standard scanning
  81.              method will be used.
  82.              WARNING: If you disable heuristics, some polymorphic viruses
  83.                       will not be detected by name !
  84.  
  85. /NOS         Disables standard scanning method. Only heuristics
  86.              will be used.
  87.              You can use both switch (/NOS /NOH) together :)
  88.              This combination can save your time, if you want get
  89.              informations about macros in file (use also /MAC
  90.              or /REP switch)
  91.  
  92. /MAC         If this switch was entered program will stop at each
  93.              file that contains one or more macros. Otherwise program
  94.              will stop only when file is infected by known virus,
  95.              when file is probably infected or suspected.
  96.              We recommend to use this switch if you want to see
  97.              the macros or the result of neural network.
  98.  
  99. /IA          With this option program won't stop on any file.
  100.              You will use probably this option together with /REP
  101.              switch.
  102.  
  103. /CA          If you want to automatically clean any infected
  104.              or probably infected files, use this switch.
  105.              Files will be cleaned only if creating of backup copy
  106.              was succesfull.
  107.  
  108.              WARNING: ALL MACROS WILL BE REMOVED FROM INFECTED FILE
  109.  
  110.              After cleaning you should check if cleaned file is OK.
  111.              If something went wrong, you can restore original
  112.              file from backup copy. If HMVS fails plz send us file, that
  113.              couldn't be cleaned.
  114.  
  115. /RA          With this switch HMVS'll automatically rename any infected
  116.              or probably infected files.
  117.  
  118. /NOB         With this option HMVS can't be stopped with ESC key.
  119.              Otherwise you can break program in any time with pressing
  120.              the ESC key.
  121.  
  122. /EXT         This option allow you to decrypt execute only macros.
  123.              (Available only for registered users).
  124.              With this option you will be prompted at each file
  125.              containing execute-only macro(s), if you want to
  126.              decrypt it. If yes, program will first create a backup
  127.              copy of file (*.VI?) and them decrypt all execute-only
  128.              macros.
  129.              This is nice option for AV researcher or experienced
  130.              users.
  131.  
  132.              WARNING: If you use this option, scanning is disabled !
  133.  
  134. /FLG         Enable displaying heur. flags (disabled default)
  135.  
  136. /HLO         Switch to low heuristics. This options take in account
  137.              the result of neural network.
  138.              If this options hasn't been specified default heuristics
  139.              will be used.
  140.  
  141. /HHI         Heuristics will be performed for whole macro. Without
  142.              this switch only the first 32 kB of macro is analyzed
  143.              If this options hasn't been specified default heuristics
  144.              will be used.
  145.  
  146. /CV[+|-]     When files with DOC extension are cleaned, they are
  147.              automatically converted from template back to document.
  148.              You can disable this feature by using /CV- switch.
  149.              Files with extension different than DOC are converted
  150.              to document only if you'll use /CV+ switch
  151.  
  152. /SIMPLE      Use more user friendly output like this one:
  153.  
  154.              C:\Concept\A\CONC-A.DOC (Neural: 99.893942%) - <WinWord.Concept.A>
  155.              C:\Concept\B\CONC-B.DOC (Neural: 99.893942%) - <WinWord.Concept.B>
  156.              C:\Concept\C\CONC-C.DOC (Neural: 99.893942%) - <WinWord.Concept.C>
  157.              C:\Concept\D\CONC-D.DOC (Neural: 99.908847%) - <WinWord.Concept.D>
  158.              C:\Concept\E\CONC-E.DOC (Neural: 99.672042%) - <WinWord.Concept.E>
  159.  
  160.              If you use the /SIMPLE switch than the following switches
  161.              will be ignored
  162.              /FLG /CV+ /IA /CA /RA /EXT
  163.  
  164.              Simultaneously use of switches /NOH a /NOS is not allowed
  165.              in this case.
  166.  
  167. /OK          Include clean files to the output and put OK after name of
  168.              file.
  169.  
  170. /SOURCE      Use this switch to unpack or detokenize source code of macros.
  171.              At the moment MS Word 6,7, Excel'97 and Word'97 files
  172.              are supported.
  173.              If you want to inspect incomming or suspected files just
  174.              use this switch and check the contents of macros.
  175.  
  176.              For experienced users might be very precious !
  177.  
  178.              Usage: HMVS filename /SOURCE
  179.  
  180.              Note: This option doesn't work with long file names
  181.                    (directories or files)
  182.  
  183.              PLEASE LET US KNOW IF THIS OPTION HELPED YOU :)
  184.  
  185. 2.   METHODS USED IN HMVS
  186. ──────────────────────────────────────────────────────────────────────────
  187.  
  188. When MS Word documents or templates are scanned, HMVS do the following:
  189. When scanned file contains a MS Word document or a Excel Sheet with
  190. macros HMVS will:
  191.  
  192. - search for macros in document or template
  193. - decrypt each macro (if it is encrypted)
  194. - use standard scanning methods (so only macros are scanned, not whole file !)
  195. - use algorithmic scanners
  196. - use heuristics
  197.   Each macro is analysed and checked for suspicious operations, that can
  198.   be useful to discover an unknown virus. If heuristics found some
  199.   suspicious actions in file it will inform the user.
  200. - use neural network driven scanner
  201.  
  202. HMVS uses a few ways to determine that file is infected:
  203.  
  204. ■ Standard 'pattern searching' method based on 'identifications strings'
  205.   This is well know method frequently used in most virus scanners.
  206.   Search string method is fast and reliable, but can search only for
  207.   known viruses.
  208.  
  209. ■ CRC16 method
  210.   This is a good method for exact identification of static viral macros.
  211.   However, this method is usable only for old generation of macro viruses.
  212.  
  213. ■ Smart CRC16
  214.   Intelligent checksumming driven by heuristics.
  215.   This method is used for detecting such type of viruses like Hunter.C,
  216.   Slow A/B and similar one.
  217.  
  218. ■ Algorithmic scanner
  219.   Is based on searching for some specific action for virus. This method
  220.   is used to search for very polymorphic macro viruses (like Uglykid.A).
  221.  
  222. ■ Heuristic analysis
  223.   HMVS uses unique heuristic technology. HMVS uses special semi-emulator
  224.   of word macro commands (something like length disassembler, if you
  225.   know, what is it ...). It trace trough each command in macro,
  226.   step by step, and try to understand the macro code. This is very
  227.   reliable method and we hope, that we can detect with heuristics almost
  228.   every virus.
  229.  
  230. ■ Neural network driven scanner
  231.   HMVS is probably the only one known scanner using this method for
  232.   scanning MS Word 6.x, 7.x files.
  233.   Results of neural network are strongly dependent on the amount of
  234.   information about viruses and clean macros.
  235.   Because the ratio viral macros to clean macros is too high and there
  236.   is much more available viral macros then clean macros this method
  237.   may leads to uncertain result. It is due to lack of information
  238.   about clean method.
  239.   At the moment neural scanner is used to eliminate false alarm caused
  240.   by HMVS heuristics (it requires usage of /HLO switch)
  241.  
  242.   Math coprocessor is required to use this method !
  243.  
  244. Of course, each of these methods are usable in a little bit different
  245. cases, but we think, these technologies are enough to identify any
  246. virus. Standards method can detect macro virus exactly by its name,
  247. heuristics can detect known and unknown viruses.
  248.  
  249. Good antivirus products should use several methods. With large virus
  250. databases they can reach top hit-rate and they can detect unknown
  251. viruses too.
  252.  
  253. Heuristics is not a 100% method of virus scanning so it may produce
  254. false alarms in some cases. From the other side heuristics is only one
  255. method that can discover new or unknow viruses. This is very great
  256. feature and we think, this is a best solution of virus scanning. So when
  257. HMVS detects unknown virus on one or two documents don't be afraid. They
  258. needn't be a realy viruses. But when HMVS finds many infected documents,
  259. you are probably infected.
  260.  
  261. We've checked HMVS with some files containing antimacros (for example
  262. DOCGUARD.DOC). Because this file contains macros and it is doing some
  263. operations typical for viruses, this file seems for HMVS to be infected
  264. with a macro virus.
  265.  
  266. There is an example of false alarm (file DOCGUARD.DOC)
  267.  
  268. C:\FALSEPOS\DOCGUARD.DOC
  269. Stream: WordDocument (MS Word)
  270. * document contains 7 macros with total length 15065 bytes
  271. {AutoOpen} {Remove} {Install} {AutoClose} {NormalAutoExec} {NormalAutoOpen} {NormalFileOpen} 
  272. ! Copies macros into the template ('MacroCopy') [3 x]
  273. + Contains execute-only (encrypted) macros
  274. + Detects if macro is execute-only ('IsExecuteOnly()')
  275. + Uses the 'FileSaveAs' macro command
  276. + Enables auto macro processing ('DisableAutoMacro')
  277. + Detects number of macros in template or document ('CountMacros()')
  278. + Detects macros names in template or document ('MacroName$()')
  279. ! Deletes other files ! ('Kill') [2 x]
  280. + Contains macros but is named *.DOC
  281. ! Creates or edits macro ('ToolsMacro .Edit')
  282. + Inserts text into document
  283. + Deletes macro ('ToolsMacro .Delete')
  284. Result of heuristics: POLY.CRYPT.COMPANION.MACRO virus
  285. Result of neural network: CLEAN (1.330692%)
  286.  
  287. PROBABLY INFECTED WITH A MACRO VIRUS !!!
  288.  
  289. 2.1  Available options, when virus was found
  290. ──────────────────────────────────────────────────────────────────────────
  291.  
  292. If HMVS detect that file is infected, it displays something like
  293. the following example:
  294.  
  295. Note: Macros enclosed in [] are unencrypted, macros enclosed in {} are
  296.       encrypted.
  297.  
  298.       Flags used for result of heuristics:
  299.  
  300.       POLY        - might be polymorph or self modifying or antiheuristic
  301.                     virus
  302.       CRYPT       - encrypted virus
  303.       STEALTH     - uses 'stealth' method
  304.       COMPANION   - companion macro virus (links template with document)
  305.       MACRO       - macro virus
  306.  
  307. C:\Xenixos\A\xenixos.doc
  308. Stream: WordDocument (MS Word)
  309. * document contains 11 macros with total length 31342 bytes
  310. {Drop} {Dummy} {AutoExec} {AutoOpen} {Datei╓ffnen} {ExtrasMakro} {DateiBeenden} {DateiDrucken} {DateiSpeichern} {DateiSpeichernUnter} {DateiDruckenStandard} 
  311. ! Copies macros into the template ('MacroCopy') [60 x]
  312. + Contains execute-only (encrypted) macros
  313. + Uses the 'FileSaveAs' macro command
  314. + Disables global template write access warnings
  315. + Enables auto macro processing ('DisableAutoMacro')
  316. - Might prevent the ESC key from interrupting a macro ('DisableInput')
  317. + Detects number of macros in template or document ('CountMacros()')
  318. + Detects macros names in template or document ('MacroName$()')
  319. - Gets parameters from WIN.INI or WINWORD6.INI ('GetProfileString$()')
  320. ! Executes other DOS or Windows programs ! ('Shell') [1 x]
  321. ! Writes directly to a sequential file ! ('Print #') [381 x]
  322. + Changes DOS attributes of other files ('SetAttr')
  323. - Changes current directories ('ChDir')
  324. - Opens a sequential file for input or output of text ('Open #')
  325. - Closes an open sequential file ('Close #')
  326. + Contains macros but is named *.DOC
  327. + Inserts text into document
  328. Contains viral macro: <WinWord.Xenixos.A> 
  329. Result of heuristics: CRYPT.STEALTH.MACRO virus
  330. Result of neural network: VIRUS (99.870585%)
  331.  
  332. INFECTED WITH A MACRO VIRUS !!!
  333.  
  334. 1-Skip  2-Remove all macros  3-Rename file  4-Ignore all
  335. 5-Automatically remove all macros  6-Automatically rename all files  :
  336.  
  337. Now program waits for user input ...
  338.  
  339. Available actions:
  340.  
  341. 1-Skip
  342.   Program will ignore potentially infected file. HMVS will continue
  343.   to scan other files.
  344. 2-Remove all macros
  345.   HMVS will attempt to clean this file. All macros will be scotched.
  346. 3-Rename file
  347.   Renames file to *.VI?
  348. 4-Ignore all
  349.   Program will ignore any other infected file and will scan until ESC
  350.   pressed or there isn't any file to process in scanned path.
  351. 5-Automatically remove all macros
  352.   Like 2, but for any infected file
  353. 6-Automatically rename all files
  354.   Like 3, but for any infected file
  355.  
  356. For experienced users it is recommended to inspect suspected file. Just
  357. create the listing of macros by using /SOURCE switch and check its contents.
  358.  
  359. 3.   WHAT ARE MACRO VIRUSES :)
  360. ──────────────────────────────────────────────────────────────────────────
  361.  
  362. If you don't know what is a macro virus, you have big chance to be a
  363. potential victim of macro virus :) Don't worry, HMVS is here to solve
  364. your troubles (we hope ...)
  365.  
  366. 4.   HEURISTIC FLAGS DISPLAYED BY HMVS
  367. ──────────────────────────────────────────────────────────────────────────
  368.  
  369. Current version of HMVS can detect the following flags:
  370. (Currently we do not plan to add new flags in next version)
  371.  
  372. ! Copies macros into the template ('MacroCopy')
  373. + Might copy macros to template with using 'Organizer .Copy'
  374. ! Copies macros to template with using 'Organizer .Copy'
  375. ! Adds a template or WLL to the list of global templates ('AddAddIn')
  376. + Contains execute-only (encrypted) macros
  377. + Detects if macro is execute-only ('IsExecuteOnly()')
  378. + Uses the 'FileSaveAs' macro command
  379. + Disables global template write access warnings
  380. + Enables the fast save option 'FastSaves'
  381. - Might enable auto macro processing ('DisableAutoMacro')
  382. + Enables auto macro processing ('DisableAutoMacro')
  383. - Might prevent the ESC key from interrupting a macro ('DisableInput')
  384. + Prevents the ESC key from interrupting a macro ('DisableInput')
  385. + Detects number of macros in template or document ('CountMacros()')
  386. + Detects macros names in template or document ('MacroName$()')
  387. - Sets up a background timer that runs a macro at the specified time ('OnTime')
  388. - Gets parameters from WIN.INI or WINWORD6.INI ('GetProfileString$()')
  389. - Sets parameters in WIN.INI or WINWORD6.INI ('SetProfileString$()')
  390. - Gets parameters from initiating file ('GetPrivateProfileString$()')
  391. - Sets parameters in initiating file ('SetPrivateProfileString$()')
  392. + Removes document protection ('LockDocument')
  393. - Manipulates with protection for form fields
  394. - Removes protection for form fields
  395. - Renames menu items ('RenameMenu')
  396. ! Executes other DOS or Windows programs ! ('Shell')
  397. ! Deletes other files ! ('Kill')
  398. ! Writes directly to a sequential file ! ('Write')
  399. ! Writes directly to a sequential file ! ('Print #')
  400. + Removes directory ('RmDir')
  401. + Changes DOS attributes of other files ('SetAttr')
  402. - Detects number of subdirectories ('CountDirectories')
  403. - Changes current directories ('ChDir')
  404. - Opens a sequential file for input or output of text ('Open #')
  405. - Closes an open sequential file ('Close #')
  406. + Makes available a routine stored in DLL or WLL 4 use in a macro ('Declare')
  407. - Detects environment variable ('Environ$')
  408. + Contains macros but is named *.DOC
  409. - Detect whether the active document was changed ('IsDocumentDirty()')
  410. + Converts document to the template ('FileSaveAs .Format = 1')
  411. + Sets a password for opening the document ('FileSaveAs .Password = ')
  412. ! Creates or edits macro ('ToolsMacro .Edit')
  413. + Inserts text into document
  414. + Uses an AutoText entry ('EditAutoText ...')
  415. + Uses variable of document ('Get|SetDocumentVar ...')
  416. + Deletes macro ('ToolsMacro .Delete')
  417. + Removes virus protection ('ToolsOptionsGeneral .VirusProtection')
  418.  
  419.  
  420. !   means dangerous operation
  421. +   means warning (suspect)
  422. -   only for your information
  423.  
  424. Sorry, we haven't time to explain these messages. We thinking for AV
  425. researchers and experienced users it is sufficient.
  426.  
  427. We can add detailed descriptions in the next release, if we'll get lot of
  428. requests and questions.
  429.  
  430. 5.   MACRO VIRUS CLEANING
  431. ──────────────────────────────────────────────────────────────────────────
  432. The main aim of HMVS authors was to write really safe anti-macro virus
  433. program so HMVS tries to create a backup copy before any modifications
  434. of document. This copy will be named *.VI? (e.g. CONCEPT.DOC will be
  435. backuped as CONCEPT.VIC). If this action fails, HMVS will not clean
  436. document. After that HMVS will wipe macro and finally delete links to
  437. macro (if MS Word macro). Cleaned file will contain dummy areas but they
  438. will be physicaly deleted after document is saved in MS Word.
  439.  
  440. At the moment HMVS can safely remove all macros from MS Word version 6,7,
  441. Excel version 5/7, Word'97 and Excel'97.
  442.  
  443.      ───────────────────────   that's all    ───────────────────────────
  444.  
  445. BTW, We don't like writting user's manual  ...
  446.