实验四 恶意代码分析
1.系统运行监控
实验步骤如下
1.使用批处理监控程序连接网络的状况
在C盘要目录下建一个文件c:\netstatlog.bat,内容如下:date /t >> c:\netstatlog.txt time /t >> c:\netstatlog.txt netstat -bn >> c:\netstatlog.txt
创建计划任务C:\schtasks /create /TN netstat /sc MINUTE /MO 5 /TR "cmd /c netstat -bn >> c:\netstatlog.bat"
一段时间后,开始分析产生的数据,尴尬的是不太会用excel,于是先用python对数据进行处理再导入到excel中f = open("C:\\netstatlog.txt") s = f.read() lines = s.split("\n") dict = {} for line in lines: if line.find("exe")>0: line = line[2:-1] if dict.get(line) == None: dict[line] = 1 else: dict[line] += 1 d = open("C:\\a.xls","w") for key in dict: result = key result += "\t" result += str(dict[key]) result += "\n" d.write(result)
就成了这样。- 2.使用sysmon工具监控系统运行
1.修改配置文件
```*microsoftwindows chrome.exeiexplorer.exe137127.0.0.1 explorer.exesvchost.exewinlogon.exepowershell.exe保存配置
sysmon.exe -c config_file_name启动服务
sysmon.exe -i config_file_name ```2.查看事件日志
- 3.观测恶意程序 可以看出后门迁移到了explorer进程中
3.Process Explorer