home *** CD-ROM | disk | FTP | other *** search
/ Hacker 2 / HACKER2.mdf / virus / 40hex_5.007 < prev    next >
Text File  |  1995-01-03  |  3KB  |  70 lines

  1. 40Hex Number 5 Volume 2 Issue 1                                      File 007
  2.  
  3.                 HOW TO MODIFY A VIRUS SO SCAN WON'T CATCH IT
  4.                                 PART II
  5.   
  6.   
  7.   In Issue 1 of 40Hex, Hellraiser presented a simple (though incredibly
  8.   tedious) method of searching for scan strings.  In short, this was his
  9.   method:
  10.   
  11.     1) Make a small carrier file.
  12.     2) Infect the carrier with the virus.
  13.     3) Fill parts of the virus with a dummy value until you isolate the
  14.        scan string.
  15.     4) Modify the virus so it is not detectable, i.e. switch the order of
  16.        the instructions.
  17.   
  18.   The problem is, of course, that step 3 takes a maddeningly inordinate
  19.   amount of time.  I shall present a tip which will save you much time.
  20.   The trick is, of course, to find out where the encryption mechanism and
  21.   hence the unencrypted portion where the scan string is usually located.
  22.   Once the encryption mechanism is located, isolating the scan string is
  23.   much simpler.
  24.   
  25.   Of course, the problem is finding the encryption mechanism in the first
  26.   place.  The simplest method of doing this is using V Communication's
  27.   Sourcer 486, or any similar dissassembler.  Dissassemble the file and
  28.   search for the unencrypted portions.  Most of the file will be DBs, so
  29.   search for any part which isn't.  Once you have located those parts, all
  30.   you have to do is subtract 100h from the memory location to find its
  31.   physical offset in the file.  You now have a general idea of where the
  32.   scan string is located, so perform step 3 until you find it.
  33.   
  34.   Ack, you say, what if you don't have Sourcer?  Well, all is not lost.
  35.   Load up the infected carrier in good old DEBUG.  The first instruction
  36.   (in COM infections) should be a JMP.  Trace (T) into the JMP and you
  37.   should be thrown into the area around the encryption mechanism.  Use the
  38.   memory offset (relative to the PSP segment) and subtract 100h to find
  39.   the physical location of the unencrypted portion in the file.  Once
  40.   again, once you have this, perform step 3.  Simple, no?
  41.  
  42.   Sometimes, SCAN looks for the writing portion of the code, which
  43.   generally calls INT 21h, function 40h.  This is usually, though not
  44.   always, located somewhere near the encryption mechanism.  If it is
  45.   not near there, all you have to do is trace through the virus until
  46.   it calls the write file function.
  47.  
  48.   Another method of looking for scan codes is to break the infected carrier
  49.   file into a series of 50 byte overlapping chunks.  For example, the first
  50.   chunk would be from offset 0 to 49, the second from 24 to 74, the third
  51.   from 49 to 99, etc.  Then use SCAN to see which chunk holds the scan code.
  52.   This is by far the easiest, not to mention quickest, method.
  53.   
  54.   One side note on step 1, making the carrier file.  Some virii don't
  55.   infect tiny files.  What you must do is create a larger file (duh).
  56.   Simply assemble the following two lines:
  57.   
  58.       int 20h
  59.       db  98 dup (0)
  60.   
  61.   (with all the garbage segment declarations and shit, of course) and
  62.   you'll have a nice 100 byte carrier which should be sufficient in most
  63.   cases, with maybe the exception of the Darth Vaders.
  64.   
  65.   Enjoy!
  66. -------------------------------------------------------------------------------
  67.                                                                      Dark Angel
  68.  
  69. Downloaded From P-80 International Information Systems 304-744-2253
  70.