• 20155304《网络对抗》Exp4 恶意代码分析


    20155304《网络对抗》Exp4 恶意代码分析

    实践内容

    1.系统运行监控

    1.1使用schtasks指令监控系统运行

    我们在C盘根目录下建立一个netstatlog.bat的文本文件,然后其中输入以下的内容:

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

    打开命令行,用schtasks /create /TN netstat /sc MINUTE /MO 2 /TR "c: etstatlog.bat"指令创建一个任务,记录每隔两分钟计算机的联网情况。

    image

    image

    1.2使用sysmon工具监控系统运行

    在c盘创建一个Sysmoncfg.txt文件,然后再文件中输入老师上课给出的代码

    <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进行安装

    安装之后,在事件查看器中看相关的日志

    image

    事件1

    image

    事件2

    image

    事件3

    image

    2.恶意代码分析

    2.1使用VirusTotal分析恶意软件

    用之前生成的恶意程序,放入https://www.virustotal.com/ 中进行分析

    image

    2.2使用systracer工具分析恶意软件

    首先下载,之后捕获快照。

    点击take snapshot来快照,建立4个快照,分别为:

    snapshot#1 后门程序启动前,系统正常状态

    snapshot#2 启动后门回连Linux

    snapshot#3 Linux控制windows查询目录

    snapshot#4 Linux控制windows在桌面创建一个路径

    先对比下1,2两种情况:可以看到打开后门后修改了以上两项注册表的内容,在应用(Application)——打开端口(Opened Ports)中能看到后门程序回连的IP和端口号。

    image

    image

    image

    对比3,4情况:

    image

    image

    image

    2.3使用Process Monitor分析恶意软件

    下载软件

    安装成功,查看监视情况

    image

    查看进程树

    image

    3。实验后回答问题

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

    方法有很多:

    使用schtasks指令设置一个计划任务,每隔一段时间记录联网情况,端口情况,注册表情况。

    使用sysmon,配置好想记录事件的文件,然后查看相应的事件。

    一些杀毒软件也能分析恶意软件的行为

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

    使用systracer,在打开进程前后分别takeshot,对比前后两张快照课得到进程有哪些行为。

    4.实验总结与体会

    这次实践难度不是很大,但过程比较繁琐,步骤琐碎。在此次试验中我们学会使用了多款软件来检查计算机的异常行为和恶意行为,这是一个有趣的过程,做出成果来的每一步都让自己很有成就感。但在实验中,自己仍存在许多操作上的不熟练与不足,还需多加学习练习。

  • 相关阅读:
    [ML] the notes
    [Java] 在 jar 文件中读取 resources 目录下的文件
    [LeetCode] 53. Maximum Subarray 解题思路
    [git] git 分支管理和工作流程
    debug实战:Unmanaged High Memory非托管高内存
    batch insert 1 million datas into mysql
    nuget的小Tips
    debug实战:进程Hang+High CPU
    debug实战:COM组件GetToSTA导致高内存+GC被阻塞
    svn cleanup failed问题解决
  • 原文地址:https://www.cnblogs.com/tyn5304/p/8874706.html
Copyright © 2020-2023  润新知