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

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

使用schtasks指令监控系统运行

先在C盘目录下建立一个netstatlog.bat文件,用来将记录的联网结果格式化输出到netstatlog.txt文件中,netstatlog.bat内容为:

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

打开Windows下命令提示符,输入指令

schtasks /create /TN   netstat /sc MINUTE /MO 2 /TR "c:
etstatlog.bat"

指令创建一个每隔两分钟记录计算机联网情况的任务

查看netstatlog.txt文件,对可疑进程进行分析:

分析结果:出现多次访问进程kbasesrv.exe, kbasesrv.exe是金山推广流氓软件,会弹出广告,修改主页。大量占用CPU。很难彻底删除,建议卸载所有金山软件

使用sysmon工具监控系统运行

下载sysmon v7.0

在Sysmon.exe同目录下建立文件:test.txt,并输入以下XML:

<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 test.txt ,进行安装:

给出提示,无法进行安装。

改为正确的版本号:

再次以管理员身份运行:

输入指令: Sysmon.exe -c test.txt ,进行配置:

之后使用win+R,输入 eventvwr 打开事件查看器。

进入 应用程序和服务日志 > Microsoft > Windows > Sysmon > Operational。

事件日志

双击某一个日志可查看其具体信息,如启动事件查看器

进程改变文件创建时间:

事件3

也能通过查找功能查找到电脑管家的日志记录:

网络连接工作:可以很清楚地看到运行程序的源端口、目的端口、源IP地址、目的IP地址以及使用的协议类型。

以管理员权限键入 Sysmon.exe -u 停止日志的记录,并删除之前的记录。

TCPView

TCPView是用来监测TCP连接的工具,在开启后门的情况下,打开工具就可以看到通过TCP和UDP协议运行的进程的源地址、目的地址以及相应端口和连接状态。

双击某进程可查看到进程的具体路径,也可终止进程。

尝试window后门回连,可以很清楚的看到这个进程。

procmon工具

使用procmon工具也能清晰地查看进程运行状态、路径。

双击一个进程也可直接查看其细节:

Wireshark分析

利用生成的后门回连成功:

可以观察到kali虚拟机多次对被植入后门主机发送建立连接请求,被植入后门主机对部分请求进行回应。

使用systracer工具分析恶意软件

下载systrace,安装时各选项默认

建立三个快照

5239—backdoor.exe的动态:

原文地址:https://www.cnblogs.com/lyx1996/p/8868194.html