home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / pc / virus / vas043.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  18.7 KB  |  363 lines

  1.  
  2. ╔═════════════════════════════════════════════════════════════════════════════╗
  3. ║ ─────────────────────── ▀▄     █ █▀▀▀█ █▀▀▀▀ ────────────────────────────── ║
  4. ║ ───────────────────────── ▀▄   █ █   █ █▄▄▄▄ ────────────────────────────── ║
  5. ║ ─────────────────────────── ▀▄ █ █▀▀▀█     █ ────────────────────────────── ║
  6. ║ ───────────────────────────── ▀█ █   █ ▄▄▄▄█ ────────────────────────────── ║
  7. ╠═════════════════════════════════════════════════════════════════════════════╣
  8. ║                Vaginal and Anal Secretions Newsletter #0043                 ║
  9. ╟─────────────────────────────────────────────────────────────────────────────╢
  10. ║          Date Released : [07/01/92]       Author: The Smurfs (PROBE-X)      ║
  11. ╟─────────────────────────────────────────────────────────────────────────────╢
  12. ║                           Mutation Engine Report                            ║
  13. ╙─────────────────────────────────────────────────────────────────────────────╜
  14.  
  15.    Hello everyone,
  16.    following report is provided for your information. More tests are being
  17.    conducted and results will be posted soon.
  18.    -----------------------------------------------------------------------
  19.                                  22 Jun 92
  20.  
  21.                             Mutation Engine Report
  22.  
  23.  
  24.             Copyright (c) 1992 by  VDS Advanced Research Group
  25.                            All Rights Reserved
  26.  
  27.                              P.O. Box 9393
  28.                           Baltimore, MD 21228
  29.                             (410) 247-7117
  30.  
  31.                               prepared by
  32.  
  33.                              Tarkan Yetiser
  34.  
  35.  
  36.       This report is provided to satisfy the curiosity of the
  37.       public. We were approached by some third parties to perform an
  38.       analysis on MtE. We would like to share the results of our
  39.       analysis with everyone. If you find an error or inaccuracy in
  40.       this report, please feel free to contact us. All constructive
  41.       criticism is welcome.
  42.  
  43.  
  44.                                TABLE of CONTENTS
  45.  
  46. I.  Mutation Engine and Viruses. . . . . . . . . . . . . . . . . . . 1
  47.  
  48. II.   How to Catch Viruses and MtE-based Viruses . . . . . . . . . . 2
  49.  
  50. III.  Mutation Types and Detection Algorithms. . . . . . . . . . . . 3
  51.  
  52. IV.   Live Tests and Results . . . . . . . . . . . . . . . . . . . . 5
  53.            A. Comments on Test Results . . . . . . . . . . . . . . . 5
  54.  
  55. V.    A Simple Message . . . . . . . . . . . . . . . . . . . . . . . 6
  56.  
  57.  
  58.                   I. Mutation Engine and Viruses
  59.  
  60.       We have analyzed the so-called MtE (Mutation Engine by a "Dark
  61. Avenger" from Bulgaria), and sample viruses based on it; namely,
  62. Pogue and Dedicated. We have also conducted tests to examine what
  63. kind of a potential this miscreant has, and collected empirical
  64. data on how popular scanners deal with the MtE. We have also implemented a
  65. little program (CatchMTE) that can recognize MtE-based code using an
  66. algorithmic technique. The program in executable form is available free of
  67. charge as a service to the public. Due to possible misuse, the source code
  68. and a more detailed (at the opcode and bit-mask level) analysis with
  69. decryptor samples and algorithms necessary to detect MtE will be made
  70. available in a limited fashion. Under no circumstances, actual virus
  71. samples will be provided; except the missed samples can be sent to known
  72. anti-viral product developers who wish to enhance their programs.
  73.  
  74.       For those who are not familiar with the MtE, some preliminary
  75. info will be presented first:
  76.  
  77.       MtE is NOT a virus per se, but an object module that can be
  78. linked into a virus to give it polymorphic capabilities. MtE
  79. expects to be called as a routine that can encrypt a certain
  80. portion of code and can generate a suitable decryption routine. It
  81. uses a random number generator to vary each mutation so that it
  82. will not be possible to recognize the new variant by using simple
  83. scanning techniques. The random number generator is not part of the
  84. MtE object module. A sample pseudo-random number generator is
  85. included with the archive Dark Avenger distributes. A virus writer
  86. could also supply his own random number generator.
  87.       Though all this may sound ordinary, MtE got so much attention
  88. not because it is just another encryptive virus but because it can
  89. provide even simple viruses with a feature that makes it difficult
  90. to scan for them. MtE is just like a library routine that you link
  91. into your virus and call when needed. It is a little over 2K in an
  92. object module named MTE.OBJ. A person who calls himself "Dark
  93. Avenger" claims to have developed MtE, and distributes it by
  94. uploading to BBSes in Bulgaria. The archive contains a fairly
  95. detailed documentation on how to use MtE, and even includes a
  96. demonstration virus, a non-resident COM infector known as
  97. "Dedicated". Shortly after MtE made its appearance, a modified copy
  98. of this virus called "Fear" is also seen. Why this person is
  99. engaged in such potentially harmful activity, or how he/she gets
  100. away with it is not something we know about. Curious individuals
  101. who would like to learn more about the history of virus production
  102. in Bulgaria and other social as well as technical issues are
  103. invited to read an excellent paper written by anti-virus researcher
  104. Mr. Vesselin Bontchev of Virus Testing Center, University of
  105. Hamburg. The paper is titled "Bulgarian Virus Factory", and it is
  106. available via anonymous FTP. It provides insight into some of the
  107. cultural aspects of the virus underground in Bulgaria. Mr.
  108. Bontchev's contribution to anti-virus research is much appreciated;
  109. otherwise, we probably would have never known what goes on inside
  110. the Bulgarian virus factories.
  111.  
  112.             II. How to Catch Viruses and MtE-based Viruses
  113.  
  114. You disassemble a sample, extract a sequence of bytes that would
  115. exist in each infected executable object, put it into a pattern
  116. matching engine, and then look for that pattern in executable
  117. objects that that virus is known to target. This method proved to
  118. be quite useful in fighting many viruses seen in the wild. Assuming
  119. a carefully chosen scan string, you can find the virus easily
  120. without too many false positives. Not so for polymorphic viruses.
  121.       These viruses try to defeat common scanning methods. They keep
  122. their body encrypted to defy analysis, and encrypt the new copy
  123. inserted into an executable object using a different key so that it
  124. will "look" as if a different virus infection has occurred.
  125. However, even these viruses require a plaintext code that will
  126. decrypt the rest of the virus. Scanners can use strings extracted
  127. from the plaintext portion of the virus to identify them. It is
  128. usually necessary to include wildcard bytes (don't-care bytes) to
  129. be able to deal with the varying parts of the decryption routine.
  130. Naturally, false alarms are more likely to occur. MtE is more
  131. advanced than such viruses seen before.
  132.       We would like to emphasize that the contents of each mutation
  133. and the corresponding decryption routine MtE generates is far too
  134. variable to extract a simple (or even wildcard) scan string. It is
  135. necessary to analyze the MtE itself as well as many sample
  136. mutations. After that, certain characteristics of the code MtE
  137. generates can be used as telltale signs to detect its presence.
  138. Avoiding false positives while maintaining 100% detection ratio is
  139. quite difficult.
  140.       Armed with an 80x86 instruction set guide (we used Turbo
  141. Assembler 3.0 Quick Reference Guide), and a good disassembler (we
  142. used Mr. Zandt's DIS86 available via anonymous FTP), and a few
  143. known viruses based on MtE (Pogue and Dedicated with payload
  144. removed), we analyzed the MtE code, and the mutations generated.
  145. Tests were conducted on a 40Mhz 386 with a 100 meg HD and MS-DOS
  146. 5.0, and a 4.77Mhz IBM/XT with a 30 meg HD and PC-DOS 3.3
  147. installed. A simple program that generated decoys (small, fully
  148. functional programs) was used to create a large number of samples.
  149. In the case of Pogue, the virus was allowed to remain resident and
  150. infect each decoy program as it is created. Since the Dedicated
  151. virus is not resident, it was necessary to create decoys first and
  152. then infect them by running the virus (infects in the current
  153. directory). After the tests, we archived the samples and stored
  154. them on floppy diskettes, and removed them from the hard drives of
  155. the test machines.
  156.       In the Intel 80x86 architecture, it is possible to express a
  157. computation in very dissimilar ways. This is possible because
  158. certain registers can be substituted in place of another one and
  159. still achieve the same result. For example, you can index an array
  160. by using SI, DI, BP or BX registers. Or you could XOR a certain
  161. value at a given memory location by loading that value in AX, BX,
  162. CX or DX first, and performing the XOR on that register, and then
  163. putting the result back into memory, etc. Even other possibilities
  164. exist. When stepping through elements in an array, you can
  165. increment the index register by ADDing to it, INCing it, or ADDing
  166. and then SUBtracting from it. It should be clear that such
  167. flexibility helps MtE significantly. Of course, variability is
  168. something string scanners do not handle too well, since there are
  169. many combinations to search for.
  170.       MtE goes even further than that. The size of the decryption
  171. routine is also variable, making it infeasible to assume certain
  172. things that would hold for many polymorphic viruses. It also sets
  173. up a lengthy sequence of redundant instructions before the
  174. decryptor enters the decryption loop.
  175.       For over 90% of the mutations, MtE generates a convoluted
  176. 16-bit XOR-type encryption; however, in many cases it uses indirect
  177. ways to apply the XOR mask to a memory value. For example, it
  178. computes the mask, and then gets the value to be decrypted into a
  179. register, applies the mask and put the result back into that memory
  180. location. Besides, memory access is done using many different
  181. instructions such as MOV and XCHG. There are also many redundant
  182. instructions peppered freely throughout the decryptor.
  183.       In some cases (5.5%), MtE generates a decryptor with a null
  184. effect. The decryptor does not actually decrypt anything, and the
  185. virus code is in plaintext. The frequency of such cases seems to
  186. depend on the random number generator. It is funny to note that
  187. some popular scanners misidentify such extreme cases where the
  188. virus is not even encrypted. To handle these mutations, it is
  189. sufficient to extract a signature from the MtE itself. It is also
  190. possible to extract one from known MtE-based viruses and identify
  191. the virus directly. At any rate, a scan string from MtE itself
  192. should be used in case a future virus creates a plaintext variant.
  193.       We must also mention that even these plaintext mutations
  194. contained a fully working copy of MtE. They successfully propagated
  195. and generated encrypted mutations in future generations. MtE
  196. appears to generate correct code in all cases. The deviation
  197. between new generations started using plaintext parents and new
  198. generations started using encrypted parents was negligible.
  199.  
  200.                        III. Mutation Types and Detection Algorithms
  201.  
  202.       MtE generates 4 "types" of mutations. They are as follows:
  203.  
  204.       1.  Double-reference (detectable using Method-1) ( ~ 91.0% )
  205.       2.  SUB-NEG (detectable using Method-2)   ( ~  2.0% )
  206.       3.  Single-reference (detectable using Method-3) ( ~  1.5% )
  207.       4.  Plaintext or no-reference  ( ~  5.5% )
  208.  
  209.       By implementing three algorithms and one scan string for the
  210. plain mutations, it is possible to recognize MtE-based viruses
  211. while keeping false positives to an acceptable level. We have one
  212. such program that achieved 100% hit rate during our tests. Some
  213. others also claim 100% hit rate; and we have tested them as well.
  214.       A more detailed analysis of mutation types is not made public
  215. due to possible misuse of such information.
  216.  
  217.                   IV.   Live Tests and Results
  218.  
  219.       Test #1     Base Virus Name: Dedicated
  220.  
  221.                              SCAN 91     F-PROT 2.04       CatchMTE 1.0
  222.  
  223.       by Name (1)             67                69          60
  224.       as MtE  (2)             933               931         940
  225.       misidentified           -0                -0          N/A
  226.       missed                  -0                -0          -0
  227.       Hit Rate                100%              100%        100%
  228.  
  229. (1)  SCAN91 --> [Mut],  F-PROT 2.04 --> Dedicated, CatchMTE --> Dedicated
  230. (2)  SCAN91 --> [DAME], F-PROT 2.04 --> MtE,       CatchMTE --> MtE-based
  231.  
  232.       Test #2     Base Virus Name: Pogue
  233.  
  234.                              SCAN 91     F-PROT 2.04       CatchMTE 1.0
  235.  
  236.       by Name (1)             0           0                 56
  237.       as MtE  (2)             935         936               944
  238.       misidentified (3)       -65         -61               N/A
  239.       missed                  -0          -3                -0
  240.       Hit Rate                93.5%       93.6%             100%
  241.  
  242. (1)  SCAN91 --> N/A,  F-PROT 2.04 --> N/A,    CatchMTE --> Pogue
  243. (2)  SCAN91 --> [DAME], F-PROT 2.04 --> MtE,  CatchMTE --> MtE-based
  244. (3)  SCAN91 --> [7S], F-PROT 2.04 --> Gotcha, CatchMTE --> N/A
  245.  
  246.                       A.    Comments on Test Results
  247.  
  248.       It seems that both F-PROT 2.04 and SCAN 91 misidentify some
  249. Pogue mutations that are in plaintext. F-PROT "quickscan" missed
  250. ALL mutations. You are advised to use SECURE scan mode of this
  251. product. The extra speed comes with 0% hit rate on MtE-based
  252. viruses!
  253.       F-PROT 2.04 missed three encrypted Pogue mutations. We
  254. examined these samples and found them to be of Type-3, and
  255. detectable using Method-3. The samples worked as expected. One of
  256. those three that were missed was called "suspicious" and guessed to
  257. be a variant of the Gotcha virus. We can only speculate that F-PROT
  258. lacks Method-3 detection algorithm and uses a heuristic in such
  259. cases. Surprisingly, Virx 2.3 missed one of these same mutations.
  260. Due to annoying user interface, we were unable to include Virx 2.3
  261. in our full test suite.
  262.       It should be noted that misidentification of 6% of Pogue
  263. mutations is a little alarming. All these misidentified mutations
  264. were found to be working and capable of generating new mutations.
  265.  
  266.                     V. A Simple Message
  267.  
  268.       It is dangerous to assume that scanning is adequate since
  269. there are some products that can detect MtE-based viruses 100% of
  270. the time. We identified at least two ways to make MtE less
  271. predictable. Of course, such information will not be disseminated.
  272. However, considering the availability of MtE to the hackers all
  273. around the world, and the "glory" Dark Avenger will enjoy due to
  274. media hype, it's only a matter of time such improvements will be
  275. discovered by irresponsible individuals. Besides, this may start a
  276. new trend among virus writers to create things like MtE. Keeping up
  277. with new virus signatures was hard enough (though manageable), but
  278. keeping up with many mutation engines is not going to be trivial.
  279. Unfortunately, locking up these "mutant engineers" is not a
  280. practical solution, and not even legally possible in many parts of
  281. the world.
  282.       The message is clear. The first line of defense against
  283. viruses is NOT using scanners. Although they proved to be very
  284. useful, you are highly encouraged to consider other approaches such
  285. as integrity checkers as a first line of defense. Even the less
  286. sophisticated integrity checkers have a better chance to catch
  287. mutating viruses, long before their developers get a chance to
  288. analyze the virus samples. The reason is that viruses have a
  289. tendency to modify existing code to propagate in most cases. Their
  290. spread can be controlled using a non-virus-specific solution that
  291. concentrates on the main characteristic of most viruses. Such an
  292. approach is not only more cost-effective but also more secure. If
  293. your company still relies on a virus scanner to protect its PC-
  294. based computing resources against viruses, you are walking on thin
  295. ice.
  296.  
  297. - -------------------------------------------------------------
  298. Regards,
  299.  
  300. Tarkan Yetiser
  301. VDS Advanced Research Group               P.O. Box 9393
  302. (410) 247-7117                            Baltimore, MD 21228
  303. e-mail:  tyetiser@ssw02.ab.umd.edu
  304.  
  305. ---------------------------------------------------------
  306. Response:
  307.  
  308. >      It seems that both F-PROT 2.04 and SCAN 91 misidentify some
  309. >Pogue mutations that are in plaintext. F-PROT "quickscan" missed
  310. >ALL mutations. You are advised to use SECURE scan mode of this
  311. >product. The extra speed comes with 0% hit rate on MtE-based
  312. >viruses!
  313.  
  314. True, but Keep in mind that Quick scan is a very primitive
  315. "single-point" scanner - it is fast, but if a virus cannot be found
  316. with a single string, located a fixed offset from the entry point,
  317. Quick will not find it.
  318.  
  319. Actually, I will probably drop Quick scan in the near future, as the
  320. speed of my secure scan has been steadily improving, and it is now
  321. almost as fast as Quick scan on certain machines.
  322.  
  323. >F-PROT 2.04 missed three encrypted Pogue mutations. We
  324. >examined these samples and found them to be of Type-3, and
  325. >detectable using Method-3. The samples worked as expected. One of
  326. >those three that were missed was called "suspicious" and guessed to
  327. >be a variant of the Gotcha virus.
  328.  
  329. It did not guess. Pogue IS a variant of Gotcha, just with MtE added.
  330. My scanner simply picked up the Gotcha signature, probably that part
  331. of the virus was not encrypted.  This is also the reason the
  332. "non-encrypted" samples are identified as Gotcha-variants.
  333.  
  334. > We can only speculate that F-PROT
  335. >lacks Method-3 detection algorithm and uses a heuristic in such
  336. >cases.
  337.  
  338. Well, you may speculate, of course, but you are wrong :-) I have what
  339. you call a "Method-3", but I guess it is simply not perfect - I would
  340. have to look at those three samples, to determine where the flaw is -
  341. I simply am not going to disassemble the MtE! - I did spend two days
  342. on it, and that is far too much when 3 new viruses arrive every
  343. day....
  344.  
  345. PS: The heuristics are only used if specifically requested, and will
  346. never report a particular virus, just the presence of virus-like
  347. code...
  348.  
  349. - -frisk
  350.  
  351.                   ───═════[ VaS DiSTRiBuTioN SiTeS ]═════───
  352. ╔═════════════════════════════════════════════════════════════════════════════╗
  353. ║  BBS Name                 Number       Baud   Sysop                Title    ║
  354. ╟─────────────────────────────────────────────────────────────────────────────╢
  355. ║  LiVe WiRE BBS        (313)464-1470    14.4   Studmuffin          World HQ  ║
  356. ║  PoT BBS              (313)462-1906    24oo   Phreak_Accident     World HQ  ║
  357. ║  TcH BBS              (713)373-4031    14.4   One Meg Cacher      Dist. #1  ║
  358. ║  Floating Pancreas    (305)551-0311    14.4   Majestic Cockster   Dist. #2  ║
  359. ║  Phantasm III         (313)884-2617    14.4   Scavenger           Dist. #3  ║
  360. ╚═════════════════════════════════════════════════════════════════════════════╝
  361.  
  362.  
  363.