home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / virus / 4869 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  5.5 KB

  1. Path: sparky!uunet!think.com!yale.edu!jvnc.net!netnews.upenn.edu!netnews.cc.lehigh.edu!news
  2. From: bontchev@fbihh.informatik.uni-hamburg.de (Vesselin Bontchev)
  3. Newsgroups: comp.virus
  4. Subject: How to measure polymorphism?
  5. Message-ID: <0022.9301071651.AA16031@barnabas.cert.org>
  6. Date: 6 Jan 93 21:21:12 GMT
  7. Sender: virus-l@lehigh.edu
  8. Lines: 120
  9. Approved: news@netnews.cc.lehigh.edu
  10.  
  11. Hello, everybody!
  12.  
  13. There are already two polymorphic engines available (MtE and TPE) and
  14. we are going to see more and more polymorphic viruses in the future.
  15. An interesting question arises - how to determine how polymorphic a
  16. virus is? How to determine which of two viruses is "more polymorphic"?
  17. In other words - how to measure polymorphism in an objective way?
  18.  
  19. There are several ways one could think about:
  20.  
  21. 1) Determining the total number of different instance that a
  22. particular virus can take. Obviously, a virus that can take 6
  23. different appearances (V-Sign) is less polymorphic than a virus that
  24. can take 65,536 (Cascade).
  25.  
  26. Unfortunately, this does not work. First, for some viruses it is
  27. almost impossible (well, at least too difficult) to count the total
  28. number of appearances. Nobody has succeeded yet to determine the exact
  29. number of different decryptors that MtE can generate. 
  30.  
  31. Second, a variably encrypted virus with the following decryptor
  32.  
  33.         mov    si,code_end
  34.         mov    cx,code_length
  35.         mov    ax,key
  36.     decode:
  37.         xor    word ptr [si],ax
  38.         jmp    short skip
  39.  
  40.     garbage    db    ?
  41.  
  42.     skip:
  43.         dec    si
  44.         dec    si
  45.         loop    decode
  46.  
  47. where the byte 'garbage' can take any value is not very polymorphic,
  48. regardless that the number of possible decryptors is 256. If we change
  49.  
  50.     garbage    db    ?
  51.  
  52. to
  53.  
  54.     garbage    dw    ?
  55.  
  56. this will mean that the number of possible decryptors is 65,536, but
  57. the virus is not more polymorphic...
  58.  
  59. 2) The second idea is to divide the polymorphisms is classes. Class 0
  60. means no polymorphism, class 1 means variable encryption with constant
  61. decryptor, class 2 means variable encryption with a decryptor that can
  62. be detected by a wildcard scan string, class 3 is a virus that cannot
  63. be detected even with a wildcard string. E.g., Vienna (class 0) is
  64. less polymorphic than Cascade (class 1), which is less polymorphic
  65. than Suomi (class 2), which is less polymorphic than V2P2 (class 3).
  66.  
  67. Unfortunately, this is not good enough. First, what to do with viruses
  68. that use a limited set of decryptors, one of which is selected
  69. randomly (Whale). Such viruses are obviously more polymorphic than
  70. Cascade. But are they more or less polymorphic than Suomi? They can be
  71. detected by a set of non-wildcard strings...
  72.  
  73. Second, what about Bad Boy? It consists of 9 segments of code, 8 of
  74. which can appear in any order. This gives 8! = 40,320 variants. But
  75. the virus is even not encrypted, so it can be detected with a simple
  76. (non-wildcard) scan string...
  77.  
  78. Third, what is a "wildcard string"? A string allowing "don't care"
  79. bytes? A string allowing "don't know how many don't care bytes"? A
  80. string allowing "don't care" bits? For instance, Maltese Amoeba cannot
  81. be detected by the user-defined scan strings of SCAN or F-Prot, but
  82. can be with the wildcard scan strings of HTScan/TbScan... So, is
  83. Maltese Amoeba class 2 or class 3 polymorph?
  84.  
  85. Fourth, what about V2P2 and V2P6Z? None of them can be detected by a
  86. scan string (even a wildcard one), but most experts agree that V2P6Z
  87. is "more polymorphic" than V2P2 - because the decryptor can be of
  88. different length, the virus too, and many other things...
  89.  
  90. 3) The third idea was proposed by Dr. Solomon. He proposes to use the
  91. length of the longest byte sequence that is present in the decryptor.
  92. As an addition, one could use the sum of the length of all constant
  93. byte sequences in the decryptor - if there are several short ones that
  94. can appear in any order (like it is in V2P2).
  95.  
  96. This is already better, but still not good enough. According to this
  97. criterium, the MtE-based viruses have polymorphism 1 - because all
  98. decryptors contain only a single constant byte (the JNZ instruction),
  99. which does not appear at a constant place. (Obviously, by this
  100. criterium, the higher the number, the less polymorphic the virus is.)
  101.  
  102. Unfortunately, as I said, this is still not good enough. There are
  103. other viruses with only a single constant byte in the decryptor, which
  104. are much less polymorphic than the MtE-based ones. On the other side,
  105. the TPE-based viruses can have 0 constant bytes in the decryptor, but
  106. this does not imply that they are more polymorphic than the MtE-based
  107. ones... In fact, if one looks at them very carefully, it is possible
  108. to see that the different decryptors are pretty similar, if you remove
  109. the garbage ("do-nothing") instructions...
  110.  
  111. It seems that what each anti-virus researcher considers as "level of
  112. polymorphism" is dependent somehow on the technique he uses in his
  113. anti-virus product to detect polymorphic viruses. For instance, V2P6Z
  114. might look "more difficult" (i.e., more polymorphic) than the
  115. MtE-based viruses to those people whose scanners depend on the number
  116. of addressing modes used by the instruction that performs the actual
  117. decoding...
  118.  
  119. This article is not meant to provide a solution of the problem. I am
  120. trying just to explain the problem and am asking for solutions. Any
  121. ideas are welcome - we really need an objective way to measure the
  122. level of polymorphism...
  123.  
  124. Regards,
  125. Vesselin
  126. - -- 
  127. Vesselin Vladimirov Bontchev          Virus Test Center, University of Hamburg
  128. Tel.:+49-40-54715-224, Fax: +49-40-54715-226      Fachbereich Informatik - AGN
  129. < PGP 2.1 public key available on request. > Vogt-Koelln-Strasse 30, rm. 107 C
  130. e-mail: bontchev@fbihh.informatik.uni-hamburg.de    D-2000 Hamburg 54, Germany
  131.