# Analyzing Windows Prefetch With Python

> 使用 windowsprefetch Python 库解析 Windows Prefetch 文件，重建应用程序执行历史，检测重命名或伪装的二进制文件，并识别可疑的程序执行模式。

- Skill: `killvxk/analyzing-windows-prefetch-with-python` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add killvxk/analyzing-windows-prefetch-with-python`
- Raw SKILL.md: https://api.skillmd.com/api/skills/killvxk/analyzing-windows-prefetch-with-python/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: Apache-2.0
- Author: killvxk (https://skillmd.com/u/killvxk)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/killvxk/analyzing-windows-prefetch-with-python

---

# 使用 Python 分析 Windows Prefetch

## 概述

Windows Prefetch 文件（.pf）记录应用程序执行数据，包括可执行文件名称、运行次数、时间戳、已加载 DLL 及已访问目录。本技能涵盖使用 windowsprefetch Python 库解析 Prefetch 文件以重建执行时间线，通过比较可执行文件名称与加载的资源来检测重命名或伪装的二进制文件，以及识别可能表示恶意软件执行或横向移动的可疑程序。

## 前置条件

- Python 3.9+ 及 `windowsprefetch` 库（pip install windowsprefetch）
- 来自 `C:\Windows\Prefetch\` 的 Windows Prefetch 文件（支持版本 17-30）
- 了解 Windows Prefetch 文件命名规范（EXECUTABLE-HASH.pf）

## 步骤

### 步骤 1：收集 Prefetch 文件
从目标系统的 `C:\Windows\Prefetch\` 目录收集 .pf 文件。

### 步骤 2：解析执行历史
提取可执行文件名、运行次数、最后执行时间戳及卷信息。

### 步骤 3：检测可疑执行
标记已知攻击工具（mimikatz、psexec 等）、重命名的二进制文件和异常执行模式。

### 步骤 4：构建执行时间线
从所有 Prefetch 文件重建按时间顺序排列的执行时间线。

## 预期输出

包含执行历史、可疑可执行文件、重命名二进制文件指标及时间线重建的 JSON 报告。

