20155220 实验4 恶意代码分析

实验4 恶意代码分析

系统运行监控

1.Schtasks

  • 先建立一个netstat20155220.txt文件,在文件中输入
time /t >> c:\netstat20155220.txt
netstat -bn >> c:\netstat20155220.txt```



- 然后将此文件名改为netstat20155220.bat


- 再建立一个netstat20155220.txt,用来将记录的联网结果格式化输出到其中


- 将这两个文件剪切到c盘目录下

- 然后,以管理员身份打开命令行,输入```schtasks /create /TN netstat /sc MINUTE /MO 1 /TR "c:\netstat20155220.bat"```
![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417193501915-1877031500.png)

- TN:Task Name,本例中是netstat
- SC: SChedule type,本例中是MINUTE,以分钟来计时
- MO: MOdifier

- TR: Task Run,要运行的指令是 netstat -bn,b表示显示可执行文件名,n表示以数字来显示IP和端口


- 打开netstat20155220.txt,得到如图:
![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417193554855-1501008425.png)


## Sysinternals工具集

### Sysmon

- 首先我们下载sysmon


- 对其进行解压,在C盘创建20155220.txt文件在其中输入


 ```<Sysmon schemaversion="4.00">   
  <!-- 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 5220.txt.txt

  • 配置文件可以随时修改,修改完需要用如下指令更新一下Sysmon.exe -c 5220.txt.txt

  • 然后我们打开控制面板,搜索事件查看,打开事件查看器,sysmon的日志就在,应用程序和服务日志/Microsoft/Windows/Sysmon/Operational下

  • 我们对日志进行查看,以下有一些进程截图

  • 接下来,我们主要对80,443端口进行监视

  • 利用下面的代码对20155220.txt进行更改,然后使用sysmon.exe -c 5220.txt,进行更新。

  <!-- 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>
  <DestinationPort condition="is">5210</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>```

![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417195017087-46497213.png)

- 然后我们来查看事件查看器,如图:
![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417195127123-297993630.png)

## 恶意软件分析

### Systracer

- 首先我们进行下载,安装
- windows什么都不运行
![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417200219262-1653541728.png)
- 尝试回连
![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417200228483-773263570.png)
- kali输入dir

![](https://images2018.cnblogs.com/blog/1072272/201804/1072272-20180417200236107-1777425104.png)

## 问题

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

答:监控网络连接;监控是否创建新的进程;监控注册表项目;监控系统日志;监控是否经常连接未知IP。



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

答:TCPView、Wireshark等网络工具查看是否存在可疑连接;Systracer:程序运行前后是否有注册表、端口、文件的变化。
posted on 2018-04-17 20:14  20155220吴思其  阅读(114)  评论(0编辑  收藏  举报