home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / VIRUS / PCV4RPT.ZIP / NOMENK.RPT < prev    next >
Encoding:
Text File  |  1991-05-28  |  11.0 KB  |  214 lines

  1.  
  2.              *********************************************
  3.              ***   Reports collected and collated by   ***
  4.              ***            PC-Virus Index             ***
  5.              ***      with full acknowledgements       ***
  6.              ***            to the authors             ***
  7.              *********************************************
  8.  
  9.  
  10.   Report from Jim Bates - The Virus Information Service - November
  11.   1990
  12.  
  13.   === Nomenklatura Virus ===
  14.  
  15.   The recent shift amongst virus writers towards self-encrypting,
  16.   self- protecting and anti-disassembly code does not mean that the
  17.   more primitive types have ceased to appear.  One of the latest
  18.   emanations from the bored and irresponsible Bulgarian virus
  19.   "factories" is a 1024 byte virus named "NOMENKLATURA" (from the
  20.   title within the code).
  21.  
  22.   This is a primitive and untidy parasitic virus which infects COM and
  23.   EXE files.  No attempt is made to hide the code either on disk by
  24.   means of encryption, or in memory by means of interrupt redirection.
  25.   The code is also quite easy to disassemble since it contains little
  26.   that is not completely straightforward.  However, NOMENKLATURA
  27.   easily qualifies as one of the nastier viruses because of the nature
  28.   of its payload and the inconvenience caused by even a slight
  29.   infection.
  30.  
  31.   The operation of the virus is as follows:
  32.  
  33.   INSTALLATION
  34.  
  35.   The virus code will be appended to the host file in the usual
  36.   fashion, with appropriate modifications having been made to the
  37.   beginning of the file to ensure that the virus code is executed
  38.   first.  The code begins by issuing an "Are you there?"  call to the
  39.   operating system. This consists of placing a value of 4BAAH into the
  40.   AX register and issuing an INT 21H call.  If the interrupt handler
  41.   returns with the Carry Flag set, then the virus is not resident and
  42.   the installation routine is invoked.  Otherwise processing continues
  43.   by repairing the header of the host file and then passing control to
  44.   it.  The installation routine first accesses page zero of memory and
  45.   collects the INT 13H vector address.  This is then swapped into the
  46.   INT 13H handler by calling the 13H function of the multiplex
  47.   interrupt at 2FH.  This swapping process reveals the vector address
  48.   of the specific machine disk handler (usually in ROM) which is
  49.   pushed onto the stack.  The INT 2FH is then immediately called again
  50.   to repair the vectors and the saved address is popped from the stack
  51.   into memory.  The INT 21H vector is then collected by directly
  52.   accessing the interrupt table in low memory.  Once these vectors
  53.   have been collected and stored, the code continues by modifying the
  54.   memory pointers stored in the Program Segment Prefix area to make
  55.   room for the whole of the virus code to be moved up to high memory.
  56.   43 paragraphs (1072 bytes) of memory are made available in this way
  57.   but before the code is moved, the multiplex interrupt 2FH is called
  58.   again to insert the virus' own vector into the handler chain.  Then
  59.   the virus code is then resited with a block move.  THe final step of
  60.   this section of code is to repair the host program header (or
  61.   original jump in the case of a COM file) and then transfer control
  62.   to it.  Once the virus is installed and "hooked in" to the operating
  63.   system interrupts, further virus control is established via the
  64.   newly installed interrupt handler routines.
  65.  
  66.  
  67.   Interrupt 21H Handler
  68.  
  69.   NOMENKLATURA intercepts only the Load and Execute (4BH) and ASCIIZ
  70.   Open (3DH) functions of INT 21H.  On receipt of either of these
  71.   function calls, the relevant file will be checked and infected where
  72.   possible.  The only exception is the virus' own recognition call of
  73.   4BAAH which simply clears the carry flag (by reference to the stack)
  74.   and then returns to the calling routine.  The infection process is
  75.   exactly similar, regardless of which function has been received:
  76.   The ASCIIZ filename of the target file is first examined to find
  77.   either a COM or EXE extension.  If neither of these is found then
  78.   the virus allows the function request to continue unaltered.  At
  79.   this point, no note is taken of which type of extension was
  80.   discovered and both types are treated similarly until a later check
  81.   for the presence of the 'MZ' header which typifies EXE files.  First
  82.   the file date and time stamps are collected and stored, then the
  83.   file is opened for Read/Write access using function 3DH of the
  84.   original (ie: pre-virus installation).  If the Open request is
  85.   successful, then a routine is invoked which installs two temporary
  86.   vectors for use only during the infection cycle.  The vectors
  87.   involved are INT 24H which is modified to prevent DOS from reporting
  88.   disk errors to the screen, and an INT 13H function dispatcher which
  89.   is installed to prevent possible FAT corruption during the infection
  90.   cycle.  Once these temporary vectors have been set, the virus reads
  91.   the first 24 bytes of the file header into a prepared buffer area.
  92.   It is at this point (if the read was performed successfully) that a
  93.   check is made for the 'MZ' header marker and according to its
  94.   presence or absence, the appropriate infection appending routine is
  95.   called.
  96.  
  97.  
  98.   INFECTION CRITERIA
  99.  
  100.   Ignoring the differences necessary for infecting either COM or EXE
  101.   files, each infection routine functions in substantially similar
  102.   fashion with one or two small exceptions.  With EXE files, any file
  103.   greater than 1023 bytes in length is a candidate for infection,
  104.   while with COM files only those with a length between 1025 and 63999
  105.   bytes may be infected.  The method by which this virus recognises
  106.   infected files (for both EXE and COM) is to check the available code
  107.   after the initial jump destination (or the initial IP setting for
  108.   EXE files) and if this is exactly 1024 bytes then the file is
  109.   assumed to be infected.  This method is somewhat hit and miss but as
  110.   someone once said, "When did the recipient of a virus ever complain
  111.   that it didn't work properly?".  Once infection is completed, the
  112.   file date and time stamps are reset to their original values, the
  113.   file is closed, the temporary interrupt handlers are removed and
  114.   processing continues with the original INT 21H function call.  Since
  115.   at no time is a check made of the Read/Write attribute of the target
  116.   file, infection spread can be prevented by the simple expedient of
  117.   setting all EXE and COM files to Read Only.  However, this will NOT
  118.   stop an already infected file from installing the virus and the
  119.   corruption described in the next section may still occur.
  120.  
  121.  
  122.   Interrupt 13H Handler
  123.  
  124.   This is essentially a flag controlled routine which monitors
  125.   subfunctions 0, 1, 2 and 3 of INT 13H.  The monitoring processing
  126.   consists of generating two distinct counts from the contents of each
  127.   word of the sector buffer.  The words are examined sequentially as
  128.   if they were FAT cluster markers and any word with a value of less
  129.   than 0FFF7H (ie: EOF marker) causes Counter 1 to increment.  At the
  130.   same time, any word which has a value of exactly one less than the
  131.   succeeding word (ie: denoting contiguous clusters) also increments
  132.   Counter 2.  The contents of Counter 1 are then halved and if the
  133.   original value was an even number, then processing continues
  134.   uninterrupted.  However, if the original value was odd then a
  135.   comparison is made between Counter 2 and the halved Counter 1 and if
  136.   Counter 1 is the lower value then the "payload" is delivered.  This
  137.   process is described in detail to give some idea of the random
  138.   nature of the occurrence of the "payload" routine and in tests on a
  139.   sacrificial machine, corruption began to appear as files numbers
  140.   were increased and the disk passed the half-full mark.  It is quite
  141.   possible that NO corruption would occur on a badly fragmented disk
  142.   but the nature of this virus is such that it is almost impossible to
  143.   verify whether corruption has occurred or not.
  144.  
  145.   The corruption introduced by the "payload" consists of swapping a
  146.   pair of words in random positions within the sector buffer.  This is
  147.   done by using a modified reading from the system clock as a double
  148.   index into the sector buffer and exchanging the words found at each
  149.   index point.  The effect on machine operation is totally
  150.   unpredictable since any two clusters, anywhere on the disk will be
  151.   transposed.  Thus any file occupying an affected cluster will
  152.   suddenly contain completely different data at that point and such
  153.   data may or may not actually belong to another file (no attempt is
  154.   made to check the contents of the transposed cluster words).
  155.   Obviously any type of file (data, program, system, control) may be
  156.   affected as will both of the File Allocation Tables - but
  157.   differently.
  158.  
  159.   File Recognition
  160.  
  161.   Since this virus is non-encrypting, file recognition is easily
  162.   accomplished by searching for the signature listed in last month's
  163.   Virus Bulletin -
  164.  
  165.          B8AA 4BCD 2173 785E 5606 33C0 8ED8 C41E  at Offset 2DD
  166.  
  167.  
  168.   Conclusion
  169.  
  170.   NOMENKLATURA is poorly written and untidy in its coding.  Mention
  171.   has already been made of its failure to check the attribute of
  172.   target files but there are several other indications that the author
  173.   does not fully understand many of the functions and capabilities of
  174.   the PC environment.  This leads me to conclude that the author is
  175.   probably someone quite new to computing and who may well have become
  176.   involved in the "virus fervour" currently reported as rampant in
  177.   Bulgaria.
  178.  
  179.   Nevertheless the virus works and the fact that its payload is
  180.   delivered on such a random basis and at such a vital section of the
  181.   disk architecture makes this a particularly nasty specimen.  If this
  182.   virus has been executed on a machine, then ALL files on that machine
  183.   are subsequently suspect!  The best course is is to delete them and
  184.   reconfigure the machine from scratch.  Note that even a secure CRC
  185.   checking program which has taken unique footprints of ALL files may
  186.   itself have suffered corruption along with any associated key files.
  187.   The only alternative to complete reconfiguration is separate
  188.   verification of the integrity of EACH file against a known good copy
  189.   or previously calculated, reliable CRC.
  190.  
  191.   VIS Classification - CcEAX1024A
  192.  
  193.  
  194.   The information contained in this report is the direct result of
  195.   disassembling and analysing a specimen of the virus code.  I take
  196.   great pains to ensure the accuracy of these analyses but I cannot
  197.   accept responsibility for any loss or damage suffered as a result of
  198.   any errors or omissions.  If any errors of fact are noted, please
  199.   let me know at :-
  200.  
  201.     The Virus Information Service,
  202.     Treble Clef House,
  203.     64, Welford Road,
  204.     WIGSTON MAGNA,
  205.     Leicester  LE8 1SL
  206.  
  207.   or call +44 (0)533 883490
  208.  
  209.   Jim Bates
  210.  
  211.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  212.   ++++++++++++++++++++++++++ end of reports ++++++++++++++++++++++++
  213.   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  214.