20155218 《网络对抗技术》 MAL_恶意代码分析

20155218 《网络对抗技术》 MAL_恶意代码分析

实验内容:

一、使用schtasks指令监控系统运行

  • 一、在C盘下新建一个文本文档,输入一下内容后,改名为netstatlog.bat
date /t >> c:\netstatlog.txt
time /t >> c:\netstatlog.txt
netstat -bn >> c:\netstatlog.txt
  • 二、以管理员身份运行powershell或者cmd,并输入指令
schtasks /create /TN netstat /sc MINUTE /MO 2 /ru "System" /TR "d:\netstatlog.bat"

其中,TN是TaskName的缩写,咱们建立的计划任务名是netstat5303;sc表示计时方式,咱们以分钟计时填MINUTE;TR=Task Run,要运行的指令是 netstat -bn,b表示显示可执行文件名,n表示以数字来显示IP和端口。算法

  • 三、在netstatlog.txt中就能够看到一些记录
2018/04/13 周五 
17:49
请求的操做须要提高。
2018/04/13 周五 
17:49
请求的操做须要提高。
2018/04/13 周五 
17:51

活动链接

  协议  本地地址          外部地址        状态
2018/04/13 周五 
17:52

活动链接

  协议  本地地址          外部地址        状态
  TCP    192.168.1.107:49461    180.163.251.163:80     SYN_SENT
 [SoftupNotify.exe]
  TCP    192.168.1.107:49462    106.120.160.155:80     SYN_SENT
 [360tray.exe]
  TCP    192.168.1.107:49463    106.120.160.155:80     SYN_SENT
 [360tray.exe]
2018/04/13 周五 
17:53

活动链接

  协议  本地地址          外部地址        状态
  TCP    192.168.1.107:49479    180.163.251.163:80     SYN_SENT
 [360tray.exe]
2018/04/13 周五 
17:54

活动链接

  协议  本地地址          外部地址        状态
  TCP    192.168.1.107:49482    122.193.207.44:80      SYN_SENT
 [DgService.exe]
  TCP    192.168.1.107:49483    210.52.217.139:80      SYN_SENT
 [360tray.exe]
  TCP    192.168.1.107:49484    210.52.217.139:80      SYN_SENT
 [360tray.exe]
  TCP    192.168.1.107:49485    210.52.217.139:80      SYN_SENT
 [360tray.exe]
2018/04/13 周五 
17:55

用excel对schtasks获得的数据进行分析

  • 删除重复的ip地址剩余185个;
  • 导入到whois查看ip
    chrome

  • 四、遇到的问题:
    (1)
    程序没法执行,缘由就在于个人运行条件中的设置,须要使用电源才能执行,而我正好没接电源。shell

二、使用sysmon工具监控系统运行

  • 根据老师要求须要记录一下三个事件:
    windows

  • 一、 sysmon微软Sysinternals套件中的一个工具,要使用sysmon工具先要配置文件网络

<Sysmon schemaversion="3.10">
  <!-- Capture all hashes -->
  <HashAlgorithms>*</HashAlgorithms>
  <EventFiltering>
<!-- Log all drivers except if the signature -->
<!-- contains Microsoft or Windows -->
<DriverLoad onmatch="exclude">
  <Signature condition="contains">microsoft</Signature>
  <Signature condition="contains">windows</Signature>
</DriverLoad>

<NetworkConnect onmatch="exclude">
  <Image condition="end with">chrome.exe</Image>
  <Image condition="end with">iexplorer.exe</Image>
  <SourcePort condition="is">137</SourcePort>
</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.exe -i C:\Sysmoncfg.txt指令对sysmon进行安装:

    出现小错误,可是可是按照提示作就能够了;
  • 三、在事件查看器里查看相应的日志:
  • 四、对Sysmoncfg.txt配置文件进行修改,重点监视80和443端口的联网状况
<Sysmon schemaversion="3.10">
  <!-- Capture all hashes -->
  <HashAlgorithms>*</HashAlgorithms>
  <EventFiltering>
<!-- Log all drivers except if the signature -->
<!-- contains Microsoft or Windows -->
<DriverLoad onmatch="exclude">
  <Signature condition="contains">microsoft</Signature>
  <Signature condition="contains">windows</Signature>
</DriverLoad>

<NetworkConnect onmatch="exclude">
  <Image condition="end with">SogouExplorer.exe</Image>
</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>

prcess creation :使用netasta.exe程序来统计联网信息的事件的创建。

process terminaled :使用netasta.exe程序来统计联网信息的事件的终止。

network connection

三、使用systracer工具分析恶意软件

使用systracer工具创建了4个状态的快照

  • 未放入病毒
  • 注入病毒
  • 运行病毒
  • kali执行命令
    工具

    回连执行后,能够程序打开的端口和handles信息:

四、使用火绒剑

-实现成功回连后,查看火绒剑的进程监控:

-查看其回连ip地址;

-查看其调用栈,而且能够进行反汇编

-查看进程,能够发现20155218.exe为未知文件;
学习

五、使用VirusTotal分析恶意软件

  • 把生成的恶意代码放在VirusTotal进行分析:66个杀软共有15个查出;
  • 查看该恶意代码的基本状况:
  • 该恶意代码的算法库支持状况:

六、实验问题回答

(1) 若是在工做中怀疑一台主机上有恶意代码,但只是猜测,全部想监控下系统一每天的到底在干些什么。请设计下你想监控的操做有哪些,用什么方法来监控。

我会从一下方面:一、注册表;二、系统服务;三、开机启动项;四、文件建立;五、网络链接状况;六、钩子;七、内核 进行监控,可使用systracer,sysmon,火绒剑等工具监控;设计

若是已经肯定是某个程序或进程有问题,你有什么工具能够进一步获得它的哪些信息。

我可使用wireshark查看其具体信息,好比用的什么协议,回连ip是多少,也可使用火绒剑查看其调用的栈和其相关进程;3d

七、实验总结与体会

这个实验中,咱们要学习如何分析恶意代码,从而知道如何设计恶意代码,在分析恶意代码的时候,有比较简单的工具,但须要大量的分析总结,也有比较成熟的软件,可以较快的查看到相关的信息。常在河边走,哪有不湿鞋,常常弄这个恶意代码,说不定哪天本身就被攻击了(模糊的记得好像有个虚拟机与个人mac采用了无缝链接,有点慌),使用这些工具能够监控本身的电脑,感受放心了很多。日志

相关文章
相关标签/搜索