2018-2019-2 网络对抗技术 20165227 Exp4 恶意代码分析

2018-2019-2 网络对抗技术 20165227 Exp4 恶意代码分析

实验步骤:

  • 使用的设备:Win7(虚拟机)、kali(虚拟机)

实验一:使用如计划任务,每隔一分钟记录本身的电脑有哪些程序在联网,链接的外部IP是哪里。运行一段时间并分析该文件,综述一下分析结果。目标就是找出全部连网的程序,连了哪里,大约干了什么(不抓包的状况下只能猜),你以为它这么干合适不。若是想进一步分析的,能够有针对性的抓包。

一、在win7命令行中输入命令,建立任务计划
算法

二、建立文本文档,另存为脚本“netstat5227.bat”,再拖入C盘中chrome

date /t >> c:\netstat5227.txt
time /t >> c:\netstat5227.txt
netstat -bn >> c:\netstat5227.txt

三、打开“任务计划程序”,找到刚刚建立的进程任务,双击进行设置shell

(PS:须要在常规页面里开启以最高权限执行 不然会出现不能运行的状况)网络

四、过了第一个五分钟后,txt中就会有更新的内容
工具

五、将txt文件导入excel进行统计分析

命令行

实验二:安装配置sysinternals里的sysmon工具,设置合理的配置文件,监控本身主机的重点事可疑行为

一、建立sysmon5227.txt 做为配置文件3d

<Sysmon schemaversion="4.20">
  <!-- Capture all hashes -->
  <HashAlgorithms>*</HashAlgorithms>
  <EventFiltering>
    <!-- Log all drivers except if the signature -->
    <!-- contains Microsoft or Windows -->
    <ProcessCreate onmatch="exclude">     
      <Image condition="end with">chrome.exe</Image> 
    </ProcessCreate>

    <FileCreateTime onmatch="exclude" >
      <Image condition="end with">chrome.exe</Image>
    </FileCreateTime>
    
    <NetworkConnect onmatch="exclude">
      <Image condition="end with">chrome.exe</Image>
      <SourcePort condition="is">137</SourcePort>
      <SourceIp condition="is">127.0.0.1</SourceIp>
    </NetworkConnect>
    <NetworkConnect onmatch="include">     
      <DestinationPort condition="is">80</DestinationPort>      
      <DestinationPort condition="is">443</DestinationPort>    
    </NetworkConnect>

    <CreateRemoteThread onmatch="include">
      <TargetImage condition="end with">explorer.exe</TargetImage>
      <TargetImage condition="end with">svchost.exe</TargetImage>
      <TargetImage condition="end with">winlogon.exe</TargetImage>
      <SourceImage condition="end with">powershell.exe</SourceImage>
    </CreateRemoteThread>
  </EventFiltering>
</Sysmon>

二、进入sysmon 解压的路径执行sysmon.exe -i C:\sysmon\sysmon5227.txt 进行安装
excel

三、进入事件查看器
code

四、进入kali,打开msfconsole,win7运行后门进行回连
blog

五、查询到进程号

六、在事件查看器里以进程号查找关键字

实验三:使用各类软件进行恶意软件分析

一、使用VirusTotal分析恶意软件

  • 在其中能获得SHA-一、MD5摘要值、文件类型、大小、TRiD文件类型识别结果和算法库支持状况

二、使用Process Monitor分析恶意软件

  • 获得进程号

  • 使用程序中的filter 功能查找到进程

  • 获得结果

三、使用Process Explorer分析恶意软件

  • 运行后门,打开软件分析

四、使用PEiD分析恶意软件

  • 打开软件,先分析未带壳的后门程序

  • 再分析带壳的

五、使用systracer分析恶意软件

  • 合理运用快照比对分析,可以分析恶意软件运行状况
  • 保存了两个快照:Snapshot #1是运行后门前;Snapshot #2是运行后门后

  • 经过compare发现注册表出现了改动

  • 查看“opened handles”,进行对比

  • 查看"open port",进行对比

实验问题

  • 在建立netstat5227.bat 时候,运行发现对应的txt文件没有更新
  • 解决:在任务计划程序中的设置应该改成以最高权限运行 ,不然权限不够不能运行

实验感想

  • 此次的实验目的是分析恶意代码,在实验过程当中知道了许多分析软件,也是知道了杀毒软件干不了的活,分析软件能很好地完成,本身至关于多了一项技能,同时也对后门程序的运行情况有了更深的理解
相关文章
相关标签/搜索