home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 April / Chip_2001-04_cd1.bin / tema / Igi / 000605.txt < prev    next >
Text File  |  2000-06-05  |  10KB  |  219 lines

  1. ;
  2. ;  ┌──════════──┌─────────────────────────────────────────────┐──════════──┐
  3. ;  : Prizzy/29A :          Win32.Dream              : Prizzy/29A :
  4. ;  └──════════──└─────────────────────────────────────────────┘──════════──┘
  5. ;
  6. ;   Hello people, here is my third virus especially when it is designed for
  7. ;   whole Win32  platform. It  infects    only EXE (PE - Portable Executable)
  8. ;   files and also HLP (Windows Help File Format).
  9. ;
  10. ;   When infected EXE file is started, EIP goes through my easy polymorphic
  11. ;   engine, which isn't so important in this virus, then  hooks CreateFileA
  12. ;   function, installs itself  into memory and only  then it can put EIP to
  13. ;   the host - there're two returns, one for EXE the other for HLP files.
  14. ;
  15. ;   With might and mind I wanted to use only it the best from new high-tech
  16. ;   vx methods we know. And I think is nothing worst than virus equipped of
  17. ;   interprocess communication (IPC). I also changed my coding style and
  18. ;   this source is most optimization as I could.
  19. ;
  20. ;
  21. ;                 Detailed Information
  22. ;                ──────────────────────
  23. ;
  24. ;
  25. ;   1. Interprocess Communication (IPC)
  26. ;   ───────────────────────────────────
  27. ;   You could see one IPC virus (Vulcano) by Benny/29A but I used this fea-
  28. ;   ture other way than he. His IPC virus is only in one process and it can
  29. ;   communicate with others viruses in another process.
  30. ;
  31. ;   The parts of my Win32.Dream virus work in several processes and in fact
  32. ;   it behades like one whole virus. After installing to memory, virus will
  33. ;   remove itself from memory of the infected program.
  34. ;
  35. ;
  36. ;   1.1. Creating processes
  37. ;   ───────────────────────
  38. ;   This virus is divided into seven 'independent' functions which have own
  39. ;   process. To create new process I would build a dropper and via the Cre-
  40. ;   ateProcessA I would run them.
  41. ;
  42. ;   The dropper wait than new function for its process is ready, if yes, it
  43. ;   shares two mapped blocks (OpenFileMappingA) for that process (it's Glo-
  44. ;   bal memory and Function's body) and creates thread on the function. The
  45. ;   process can't terminate it    can only Sleep.  All created  processed are
  46. ;   hiden in Windows 95, not in WinNT/2k (is't more complex).
  47. ;
  48. ;
  49. ;   1.2. IPC in action
  50. ;   ──────────────────
  51. ;   Hooked CreateFileA functions  retrieves control, sets  flag for certain
  52. ;   process and awakes its. That process  finishes own task and returns re-
  53. ;   sults.
  54. ;
  55. ;
  56. ;   1.3. Global memory
  57. ;   ──────────────────
  58. ;   It's necessary to share some important information among all processes.
  59. ;   There are:
  60. ;
  61. ;      + [thandle]    : When the dropper will create new thread here is re-
  62. ;            turned handle. It indicates the thread's errorcode.
  63. ;      + [th_mempos]  : Here is stored the name of the Function's mapped
  64. ;            object. The dropper will open that memory area.
  65. ;      + [process]    : hProcess, ProcessID values of the all created pro-
  66. ;            cesses because of opening/runing them.
  67. ;      + [apiz]       : The addresses of the all APIz I call are on this
  68. ;            place.
  69. ;      + [active]     : If other process wants to run me, sets certain flag
  70. ;            here and the thread tests it.
  71. ;      + [paramz]     : This is place where the virus store some parameters
  72. ;            among processes (see below).
  73. ;      + [vbody]      : Here is the copy of the virus, useful for changing
  74. ;            values inside and for poly engine.
  75. ;      + [filename]   : The future infected filename. New CreateFileA func-
  76. ;            tion stores the name here.
  77. ;      + [cinfected]  : Two FPU memory buffers, one for creating of the in-
  78. ;            fection mark the other for checking.
  79. ;      + [poly_vbody] : Output from polymorphic engine.
  80. ;
  81. ;
  82. ;   1.4. Parameters
  83. ;   ───────────────
  84. ;   As I wrote above I have to get some parameters of the input processes.
  85. ;   Here is the description of them:
  86. ;
  87. ;      + [1st param] : Out of polymorhpic engine, the new size of the virus
  88. ;      + [2nd param] : Filesize for checksum (+poly size yet).
  89. ;      + [3rd param] : The name of the mapped file (for OpenFileMappingA).
  90. ;      + [4th param] : a. Filesize for check_infected (without poly size).
  91. ;               b. Out of checksum.
  92. ;      + [5th param] : Input for check_infected, if '1', then it wants to
  93. ;               get an angle for create_infected.
  94. ;      + [6th param] : Terminate all processes ? (WinNT/2000 only)
  95. ;      + [7th param] : Terminate all processes ? (Win95/98   only)
  96. ;               (because of Win95/98 kernel bug)
  97. ;
  98. ;
  99. ;   1.5. Termination of the all processes
  100. ;   ─────────────────────────────────────
  101. ;   I remember it was a nut for me but of course I'd to solve it.  At first
  102. ;   I changed flags of the process (SetErrorMode, it means, the process 'll
  103. ;   not show any message box if it will do bad instructions), then I had to
  104. ;   check if the host lives yet. In Win95/98 I have discovered a kernel bug
  105. ;   so that I couldn't use WinNT version (OpenProcess) to check if the host
  106. ;   still exists because Win95/98 don't delete its process id handle.
  107. ;   Win95 - you can only read some value the from allocated memory by host.
  108. ;   WinNT - that allocated memory is opened by other process, you can't
  109. ;        identify if the host still exists.
  110. ;
  111. ;
  112. ;   1.6. The scheme of the all processes
  113. ;   ────────────────────────────────────
  114. ;
  115. ;
  116. ;    ╔═────────────────────────────────────────────────────────────────═╗
  117. ;    │             new CreateFileA API function            │
  118. ;    ╚═────╤───────────────────────────────────────────────────────────═╝
  119. ;       │
  120. ;    ╔═────────────═╗
  121. ;    │  infect file    │    ╔═──────────────═╗
  122. ;    ╚═─╤───────────═╝   ┌───   infect HLP     │
  123. ;       ├────────────────┘    ╚═──────────────═╝
  124. ;       │
  125. ;       │   ╔═────────═╗
  126. ;       │   ║      ║       ┌── [check_infected]
  127. ;       │   │      ├───────┘
  128. ;       │   │  infect  ├────┼────── [poly_engine]
  129. ;       └───      │    │
  130. ;           │   EXE      ├────┼────── [create_infected]
  131. ;           │      ├───────┐
  132. ;           ║      ║       └── [checksum]
  133. ;           ╚═─────────╝
  134. ;
  135. ;
  136. ;   2. Optimalization and comments
  137. ;   ──────────────────────────────
  138. ;   Sometimes I heard my last virus Win32.Crypto is too huge and  also some
  139. ;   people had a fun from  me (benny, mort - gotcha bastards!) that my next
  140. ;   virus will be bigger than one megabyte. I wanted to  optimize  next one
  141. ;   and I've not told them it so I think it'll be  surprise for them I pro-
  142. ;   ved. Nevertheless I've a taste of the second side and  now I can return
  143. ;   myself without any major problems. But now    I can say the virus is more
  144. ;   optimization than benny's bits and pieces. The source  code is not com-
  145. ;   mented enough because I think no many  people will taste something like
  146. ;   IPC is. If yes, they can contact me.
  147. ;
  148. ;
  149. ;   3. Check infected routine
  150. ;   ─────────────────────────
  151. ;   Long ago in Win32.Crypto I tasted to use  unique math technique  how to
  152. ;   check if the file is infected. Now I  thought up new more  complex way.
  153. ;   At first from infected file I'll compile the equation, for example:
  154. ;            y = 32*x^7 + 192*x^3 - 8212*x^5 - 72*x
  155. ;   and I'll get two points on that curve, for example x1=4 and x2=7.  Then
  156. ;   I will calculate  what angle is between the  tangents to the curve from
  157. ;   that two points, it  means: I have to  calculate derivation y' of  that
  158. ;   equation and if I know y=x1 and y=x2 then I will determine:
  159. ;         & = arc tg | log(x1 - x2) - log(1 + x1*x2) |
  160. ;   If the angle will be greater e.g. than 75 degree, file is infected.
  161. ;
  162. ;   This algorithm has been coded only for fun so that I know we've  easier
  163. ;   methods but I couldn't call to remembrance on any.
  164. ;
  165. ;
  166. ;   4. Pearls behind the scene
  167. ;   ──────────────────────────
  168. ;   * Only two weeks before release I've think the virus name up at last.
  169. ;   * At a time, during coding, I stopped writing and this virus  I haven't
  170. ;     coded for two months. Later when I started again I  couldn't remember
  171. ;     what that code does and so on.
  172. ;   * In present exists over than fifty backup copies.
  173. ;   * The worst part of the virus was the dropper, there were  many changes
  174. ;     because of Win9x and WinNT compatibility; many bugs were there.
  175. ;   * After a hour of the coding I unwillingly deleted new version. So that
  176. ;     I'd to save more than one gigabytes from FAT32 on another  hard disk.
  177. ;     Only there I found that lost version.
  178. ;   * The best thing I like on the whole virus is main comment.
  179. ;   * Working directory was 'E:\X_WIN\' and this file name was 'WIN.AS!'.
  180. ;   * Last week I was looking for help on mirc
  181. ;    <prizzy> i used also OpenFileMapping, but I think yes; if ...
  182. ;    <Bumblebee> mmm
  183. ;    <Bumblebee> OpenFileMapping?
  184. ;    <prizzy> yes :)
  185. ;    <Bumblebee> i've never used it           [bumble~1.log, 18:59:17]
  186. ;     ...but much help I haven't found there (although Bumblebee helped
  187. ;     me with another bug).
  188. ;   * During whole coding I've read five books and three film scripts.
  189. ;
  190. ;
  191. ;   5. List of greetings
  192. ;   ────────────────────
  193. ;     Darkman           The master of the good optimistic mood
  194. ;     Bumblebee        Thanks for your help during coding
  195. ;     Billy Belcebu    So, our communication has started yet
  196. ;     GriYo           All the time busy man
  197. ;     Lord Julus       Waiting for your new virus and its meta engine
  198. ;     Mort           So did you think this source will be bigger then
  199. ;               one megabytes? Sorry, maybe later :).
  200. ;     J.P.           I look forward on future with you, dude.
  201. ;     Ratter           No, no. Stop reading and let you show us what you
  202. ;               are hiding inside.
  203. ;     VirusBuster      Here is that secret bin with savage poly engine as
  204. ;               you wrote on #virus.
  205. ;     Benny           It the best in the end, benny. Haha, at last this
  206. ;               source is optimized and you will stop to worry me.
  207. ;               Thanks for all you have e'er done for me.
  208. ;     ...and for flush, asmodeus, mlapse, mgl, f0re and evul.
  209. ;
  210. ;
  211. ;   6. Contact me
  212. ;   ─────────────
  213. ;     prizzy@coderz.net
  214. ;     http://**********
  215. ;
  216. ;
  217. ;   (c)oded by Prizzy/29A, June 2000
  218. ;
  219. ;