analyzing-prefetch-files-for-execution-history

analyzing-prefetch-files-for-execution-history is a skill for Claude Code from killvxk/cybersecurity-skills-zh. It costs 37 tokens per session (3,416 once invoked), scanned A, original, Apache-2.0.

A guide for reading Windows Prefetch files, which record information about programs that have run on a system. The records can include execution counts, times, and referenced files.

In plain words
What is it for?
Use it to extract Prefetch files from a forensic image, parse them, verify their hashes, and connect program execution with other investigation evidence.
Why use it?
It helps confirm whether a program ran and place that activity in a forensic timeline, including possible malware or unauthorized tools.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cybersecurity-skills-zh plugin — 58 skills shipped together

Good fit Use it to extract Prefetch files from a forensic image, parse them, verify their hashes, and connect program execution with other investigation evidence.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-prefetch-files-for-execution-history
Clone the repo
git clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zh

Made for: Claude Code.

Or install cybersecurity-skills-zh, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-prefetch-files-for-execution-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history/github.svg)](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history)
Your own site
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-prefetch-files-for-execution-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-prefetch-files-for-execution-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,416 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.03416
Opus 5 $0.00018 $0.01708
Sonnet 5 $0.00007 $0.00683
Haiku 4.5 $0.00004 $0.00342

Measured 12d ago against content hash c3e415078546, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

analyzing-prefetch-files-for-execution-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/analyzing-prefetch-files-for-execution-history/SKILL.md · 312 lines

How it starts

The opening of the file, as written. The whole thing — 312 lines — stays where its author put it; the contents beside it link to each section on GitHub.

分析 Prefetch 文件获取执行历史

适用场景

  • 确定 Windows 系统上执行了哪些程序及执行时间
  • 在恶意软件调查中确认可疑二进制文件的执行情况
  • 建立事件期间应用程序使用的时间线
  • 将程序执行与其他取证制品相关联
  • 识别曾运行过的反取证工具或未经授权的软件

前置条件

  • 从取证镜像访问 Windows Prefetch 目录(C:\Windows\Prefetch\)
  • PECmd(Eric Zimmerman)、WinPrefetchView 或 python-prefetch 解析器
  • 了解 Prefetch 文件格式(版本 17、23、26、30)
  • Windows 系统且已启用 Prefetch(客户端操作系统默认启用,服务器默认禁用)
  • 熟悉 Prefetch 命名规范(APPNAME-HASH.pf)

工作流程

步骤 1:从取证镜像提取 Prefetch 文件

# 挂载取证镜像
mount -o ro,loop,offset=$((2048*512)) /cases/case-2024-001/images/evidence.dd /mnt/evidence

# 复制所有 Prefetch 文件
mkdir -p /cases/case-2024-001/prefetch/
cp /mnt/evidence/Windows/Prefetch/*.pf /cases/case-2024-001/prefetch/

# 统计并列出 Prefetch 文件
ls -la /cases/case-2024-001/prefetch/ | wc -l
ls -la /cases/case-2024-001/prefetch/ | head -30

# 对所有 Prefetch 文件进行哈希以验证完整性
sha256sum /cases/case-2024-001/prefetch/*.pf > /cases/case-2024-001/prefetch/pf_hashes.txt

# 注意:Prefetch 文件名格式为 EXECUTABLE_NAME-XXXXXXXX.pf
# 哈希值(XXXXXXXX)基于可执行文件路径
# 来自不同路径的相同可执行文件会创建不同的 Prefetch 文件

步骤 2:使用 PECmd 解析 Prefetch 文件

# 使用 Eric Zimmerman 的 PECmd(Windows 或通过 Linux 上的 Mono/Wine)
# 从 https://ericzimmerman.github.io/ 下载

# 解析单个 Prefetch 文件
PECmd.exe -f "C:\cases\prefetch\POWERSHELL.EXE-A]B2C3D4.pf"

# 解析所有 Prefetch 文件并输出到 CSV
PECmd.exe -d "C:\cases\prefetch\" --csv "C:\cases\analysis\" --csvf prefetch_results.csv

# 以 JSON 格式输出
PECmd.exe -d "C:\cases\prefetch\" --json "C:\cases\analysis\" --jsonf prefetch_results.json

# 每个文件的输出包含:
# - 可执行文件名和路径
# - 运行次数
# - 最后运行时间(Windows 10 中最多 8 个时间戳)
# - 执行期间引用的文件和目录
# - 卷信息(序列号、创建日期)
# - Prefetch 文件创建时间

步骤 3:使用 Python 进行基于 Linux 的分析

pip install prefetch

python3 << 'PYEOF'
import os
import json
from datetime import datetime

# 使用 python 解析 Prefetch 文件
import struct

def parse_prefetch(filepath):
    """解析 Windows Prefetch 文件。"""
    with open(filepath, 'rb') as f:
        data = f.read()

    # 检查 MAM 压缩格式(Windows 10)
    if data[:4] == b'MAM\x04':
        import lznt1  # 或使用 DecompressBuffer
        # Windows 10 Prefetch 文件已压缩
        print(f"  [压缩的 Win10 格式 - 使用 PECmd 进行完整解析]")
        return None

    # 版本 17(XP)、23(Vista/7)、26(8.1)、30(10)
    version = struct.unpack('<I', data[0:4])[0]
    signature = data[4:8]

    if signature != b'SCCA':
        print(f"  无效的 Prefetch 签名")
        return None

    file_size = struct.unpack('<I', data[8:12])[0]
    exec_name = data[16:76].decode('utf-16-le').strip('\x00')
    run_count = struct.unpack('<I', data[208:212])[0] if version >= 23 else struct.unpack('<I', data[144:148])[0]

    result = {
        'version': version,
        'executable': exec_name,
        'file_size': file_size,
        'run_count': run_count,
    }

    # 提取最后执行时间戳
    if version == 23:  # Vista/7 - 1 个时间戳
        ts = struct.unpack('<Q', data[128:136])[0]
        result['last_run'] = filetime_to_datetime(ts)
    elif version >= 26:  # Win8+ - 最多 8 个时间戳
        timestamps = []
        for i in range(8):
            ts = struct.unpack('<Q', data[128+i*8:136+i*8])[0]
            if ts > 0:
                timestamps.append(filetime_to_datetime(ts))
        result['last_run_times'] = timestamps

    return result

def filetime_to_datetime(ft):
    """将 Windows FILETIME 转换为 datetime 字符串。"""
    if ft == 0:
        return None
    timestamp = (ft - 116444736000000000) / 10000000
    try:
        return datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S UTC')
    except (OSError, ValueError):
        return None

# 处理所有 Prefetch 文件
prefetch_dir = '/cases/case-2024-001/prefetch/'
results = []

for filename in sorted(os.listdir(prefetch_dir)):
    if filename.lower().endswith('.pf'):
        filepath = os.path.join(prefetch_dir, filename)
        print(f"\n=== {filename} ===")
        result = parse_prefetch(filepath)
        if result:
            print(f"  可执行文件: {result['executable']}")
            print(f"  运行次数:  {result['run_count']}")
            if 'last_run' in result:
                print(f"  最后运行:   {result['last_run']}")
            elif 'last_run_times' in result:
                for i, ts in enumerate(result['last_run_times']):
                    print(f"  运行时间 {i+1}: {ts}")
            results.append(result)

# 保存结果
with open('/cases/case-2024-001/analysis/prefetch_analysis.json', 'w') as f:
    json.dump(results, f, indent=2)
PYEOF

Read the full file on GitHub · 312 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 312 lines · 37 tokens per session scan A c3e415078546

Subscribe to this mod's changes

analyzing-prefetch-files-for-execution-history is a skill published in the GitHub repository killvxk/cybersecurity-skills-zh (44 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 37 tokens to every session and 3,416 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced files for forensic investigation.

xalgorix/xalgorix · 34 tokens

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced files for forensic investigation.

26zl/cybersec-toolkit · 34 tokens

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced files for forensic investigation.

pinkpixel-dev/skills-collection-1 · 34 tokens

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced files for forensic investigation.

marysatasselshaped667/skills-collection-1 · 34 tokens

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files (versions 17, 23, 26, 30) with tools like PECmd, WinPrefetchView, or python-prefetch to determine program execution history, including run counts, execution timestamps, and referenced files/DLLs. Use when building a timeline of program execution on a Windows system, confirming whether a…

Youngmaidainon/Agent-Level-Up · 98 tokens

analyzing-prefetch-files-for-execution-history

Parse Windows Prefetch files to determine program execution history including run counts, timestamps, and referenced files for forensic investigation.

autohandai/community-skills · 34 tokens