本次实验相较于之前的实验繁琐程度较小,难度也不算很高,主要内容就是了解可以通过哪些方式在一个不确定是否被植入恶意代码的主机上进行监控以及学会使用各种工具对恶意代码进行分析(比如查看数据流向的地址、哪些文件被修改等等)。不过本次实验也有很多收获,比如学会了多种多种对恶意代码行为进行监控以及分析的工具的使用方法。
可以通过使用windows自带的schtasks指令设置计划任务;使用Sysmon,编写配置文件,记录有关的系统日志;使用systracer对不同时刻的系统快照进行分析等方式对系统的网络连接、进程、系统日志、注册表项等进行监控。
可以使用wireshark进行抓包分析从而获取恶意程序与主机的通信
schtasks /create /TN netstat5331 /sc MINUTE /MO 1 /TR "cmd /c netstat -bn > c:\netstatlog.txt"
,表名创建一个名称为netstat5331、每隔一分钟运行一次、输出重定向到netstatlog.txt
的计划任务date /t >> c:\netstatlog.txt
time /t >> c:\netstatlog.txt
netstat -bn >> c:\netstatlog.txt
sysmon -accepteula -i -n
以自动安装sysmon,下图为安装成功例子-c
更新或显示配置;-h
指定hash记录的算法;-i
安装,可用xml文件来更新配置文件;-l
记录加载模块,可指定进程;-m
安装事件清单;-n
记录网络链接;-r
检测证书是否撤销;-u
卸载服务和驱动<Sysmon schemaversion="9.01">
<!-- 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>
<Image condition="end with">firefox.exe</Image>
</ProcessCreate>
<ProcessCreate onmatch="include">
<ParentImage condition="end with">cmd.exe</ParentImage>
</ProcessCreate>
<FileCreateTime onmatch="exclude" >
<Image condition="end with">chrome.exe</Image>
<Image condition="end with">firefox.exe</Image>
</FileCreateTime>
<NetworkConnect onmatch="exclude">
<Image condition="end with">chrome.exe</Image>
<Image condition="end with">firefox.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">firefox.exe</TargetImage>
<TargetImage condition="end with">winlogon.exe</TargetImage>
<SourceImage condition="end with">powershell.exe</SourceImage>
</CreateRemoteThread>
</EventFiltering>
</Sysmon>
2018-2019-2 20165331《网络对抗技术》Exp4 恶意代码分析
原文:https://www.cnblogs.com/violence/p/10666609.html