zoukankan      html  css  js  c++  java
  • 20155218 《网络对抗技术》 MAL_恶意代码分析

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

    实验内容:

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

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

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

    • 3、在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

    • 4、遇到的问题:
      (1)
      程序无法执行,原因就在于我的运行条件中的设置,需要使用电源才能执行,而我正好没接电源。

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

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

    • 1、 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>
    
    • 2、配置好文件之后,要先使用Sysmon.exe -i C:Sysmoncfg.txt指令对sysmon进行安装:

      出现小错误,但是但是按照提示做就可以了;
    • 3、在事件查看器里查看相应的日志:
    • 4、对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

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

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

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

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

    4、使用火绒剑

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

    -查看其回连ip地址;

    -查看其调用栈,并且可以进行反汇编

    -查看进程,可以发现20155218.exe为未知文件;

    5、使用VirusTotal分析恶意软件

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

    6、实验问题回答

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

    我会从一下方面:1、注册表;2、系统服务;3、开机启动项;4、文件创建;5、网络连接情况;6、钩子;7、内核 进行监控,可以使用systracer,sysmon,火绒剑等工具监控;

    如果已经确定是某个程序或进程有问题,你有什么工具可以进一步得到它的哪些信息。

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

    7、实验总结与体会

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

  • 相关阅读:
    wabpack 多页面 react配置 (对比单页面)
    vue-router+nginx非根路径的配置方法
    Vue-Devtools快速安装配置教程
    C++字符串
    NSIS插件制作
    HOOK学习
    排序:数组置顶元素(将数组某个元素排到第一位)
    raect hook中使用防抖(debounce)和节流(throttle)
    浏览器的缓存机制
    JavaScript踩坑解构赋值
  • 原文地址:https://www.cnblogs.com/xzh1996/p/8822622.html
Copyright © 2011-2022 走看看