取证分析之发现Windows恶意程序执行痕迹
字数 1504 2025-08-19 12:41:44

Windows恶意程序执行痕迹取证分析指南

一、注册表痕迹分析

1. ShimCache/AppCompatCache

功能:从Windows XP开始存在,用于识别应用程序兼容性问题,跟踪文件路径、大小和时间信息。

注册表位置

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache

关键信息

  • Windows 7/8/10最多包含1024条记录
  • 记录文件路径、大小和LastModifiedTime
  • Windows 7/8/10中不存在"上次更新时间"

分析工具

  1. AppCompatCacheParser
    AppCompatCacheParser.exe --csv d:\temp -t
    
  2. ShimCacheParser
    reg export "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache" shimcache.reg
    ShimCacheParser.py -o out.csv -r D:\Tool\TEST\shimcache.reg -t
    

2. UserAssist

功能:记录GUI应用执行信息,包括名称、路径、执行次数和上次执行时间。

注册表位置

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count

分析工具

  • UserAssist_V2_6_0

3. MUICache

功能:记录执行程序的名称和路径(无执行时间信息)。

注册表位置

  • XP/2000/2003:
    HKCU/Software/Microsoft/Windows/ShellNoRoam/MUICache
    
  • Vista/7/2008:
    HKCU/Software/Classes/Local Settings/Software/Microsoft/Windows/Shell/MuiCache
    

分析工具

  • muicache_view

二、文件系统痕迹分析

1. Prefetch(预读取)

功能:加速应用程序启动过程,记录可执行文件相关信息。

文件路径

C:\Windows\Prefetch

注册表控制

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters
  • EnablePrefetcher值:
    • 0 = 已禁用
    • 1 = 启用应用程序预读取
    • 2 = 启用引导预读取
    • 3 = 启用应用程序和引导预读取(默认)

记录信息

  • 可执行文件名称
  • 文件时间戳
  • 运行次数
  • 上次执行时间
  • Hash值
  • Win7记录128个,Win8-10记录1024个

分析工具

  • PECmd
    PECmd.exe -d "C:\Windows\Prefetch" --csv "d:\temp" --json d:\temp\json
    

2. Amcache

功能:记录应用程序执行路径、上次执行时间和SHA1值。

文件路径

C:\Windows\AppCompat\Programs\Amcache.hve

分析工具

  • AmcacheParse
    AmcacheParser.exe -f C:\Windows\AppCompat\Programs\Amcache.hve --csv d:\temp
    

3. Jump Lists

功能:任务栏显示经常使用或最近使用的项目。

文件路径

C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations

分析工具

  • JumpListExplorer

三、日志分析

1. 安全事件日志(Security Log)

关键事件ID

  • 592:创建一个新进程(Windows Server 2003)
  • 4688:创建一个新进程(Windows 7/Windows Server 2008 R2/2012及之后)

注意事项

  • 仅在启用"审核进程创建"时记录4688
  • 记录进程创建时的命令行信息

2. 系统事件日志(System Log)

关键事件ID

  • 7035:服务控制管理器记录服务启动/停止
  • 7036:记录服务运行/停止状态

3. 计划任务日志(TaskScheduler)

可能包含可执行文件执行的痕迹。

四、Windows 10特有功能

1. RecentApps

注册表位置

HKCU\Software\Microsoft\Windows\Current Version\Search\RecentApps

2. BAM/Background Activity Monitor

引入版本:Windows 10 1709 (Fall Creators update)

注册表位置

HKLM\SYSTEM\CurrentControlSet\Services\bam\UserSettings\{SID}

3. ActivitiesCache.db

引入版本:Windows 10 1803 (April 2018)

文件路径

C:\Users\<profile>\AppData\Local\ConnectedDevicesPlatform\L.<profile>\ActivitiesCache.db

五、参考资源

  1. Available Artifacts - Evidence of Program Execution on Windows Systems
  2. Forensic Artifacts: Evidences of Program Execution on Windows Systems
  3. Execute This! Analyzing Malicious Office Documents
  4. Amcache and Shimcache in Forensic Analysis
Windows恶意程序执行痕迹取证分析指南 一、注册表痕迹分析 1. ShimCache/AppCompatCache 功能 :从Windows XP开始存在,用于识别应用程序兼容性问题,跟踪文件路径、大小和时间信息。 注册表位置 : 关键信息 : Windows 7/8/10最多包含1024条记录 记录文件路径、大小和LastModifiedTime Windows 7/8/10中不存在"上次更新时间" 分析工具 : AppCompatCacheParser ShimCacheParser 2. UserAssist 功能 :记录GUI应用执行信息,包括名称、路径、执行次数和上次执行时间。 注册表位置 : 分析工具 : UserAssist_ V2_ 6_ 0 3. MUICache 功能 :记录执行程序的名称和路径(无执行时间信息)。 注册表位置 : XP/2000/2003: Vista/7/2008: 分析工具 : muicache_ view 二、文件系统痕迹分析 1. Prefetch(预读取) 功能 :加速应用程序启动过程,记录可执行文件相关信息。 文件路径 : 注册表控制 : EnablePrefetcher值: 0 = 已禁用 1 = 启用应用程序预读取 2 = 启用引导预读取 3 = 启用应用程序和引导预读取(默认) 记录信息 : 可执行文件名称 文件时间戳 运行次数 上次执行时间 Hash值 Win7记录128个,Win8-10记录1024个 分析工具 : PECmd 2. Amcache 功能 :记录应用程序执行路径、上次执行时间和SHA1值。 文件路径 : 分析工具 : AmcacheParse 3. Jump Lists 功能 :任务栏显示经常使用或最近使用的项目。 文件路径 : 分析工具 : JumpListExplorer 三、日志分析 1. 安全事件日志(Security Log) 关键事件ID : 592:创建一个新进程(Windows Server 2003) 4688:创建一个新进程(Windows 7/Windows Server 2008 R2/2012及之后) 注意事项 : 仅在启用"审核进程创建"时记录4688 记录进程创建时的命令行信息 2. 系统事件日志(System Log) 关键事件ID : 7035:服务控制管理器记录服务启动/停止 7036:记录服务运行/停止状态 3. 计划任务日志(TaskScheduler) 可能包含可执行文件执行的痕迹。 四、Windows 10特有功能 1. RecentApps 注册表位置 : 2. BAM/Background Activity Monitor 引入版本 :Windows 10 1709 (Fall Creators update) 注册表位置 : 3. ActivitiesCache.db 引入版本 :Windows 10 1803 (April 2018) 文件路径 : 五、参考资源 Available Artifacts - Evidence of Program Execution on Windows Systems Forensic Artifacts: Evidences of Program Execution on Windows Systems Execute This! Analyzing Malicious Office Documents Amcache and Shimcache in Forensic Analysis