[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADRXXKQGANQPQQTD4432ND":3,"skill-same:01M6ADRXXKQGANQPQQTD4432ND":108},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":66,"repositoryHtmlUrl":67,"repositoryHomepageUrl":68,"ownerHtmlUrl":69,"ownerBlogUrl":70,"ownerDescription":71,"updatedAt":72,"install":73,"resources":86},"01M6ADRXXKQGANQPQQTD4432ND","analyzing-prefetch-files-for-execution-history","Prefetch 执行历史分析","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\u002FDLLs. Use when building a timeline of program execution on a Windows system, confirming whether a suspicious binary ran, or correlating execution evidence with other forensic artifacts during an investigation.","使用 PECmd、WinPrefetchView 或 python-prefetch 等工具解析 Windows Prefetch 文件（版本 17、23、26、30），以确定程序执行历史，包括运行次数、执行时间戳以及引用的文件\u002FDLL。适用于构建 Windows 系统上的程序执行时间线、确认可疑二进制文件是否运行，或在调查中将执行证据与其他取证痕迹关联起来。","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36146,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-prefetch-files-for-execution-history\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTHYSJPJ500X64JJ5CH06D","安全事件响应与威胁狩猎","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"analyzing","analyzing prefetch files for execution history","suspicious","python","cybersecurity","windows","run","artifacts","forensics","T1059.001","prefetch","windows-artifacts","execution-history","timeline-analysis","evidence-collection","2026-11-10 10:12:30",false,"---\nname: analyzing-prefetch-files-for-execution-history\ndescription: 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\u002FDLLs. Use when building a timeline of program execution on a Windows system, confirming whether a suspicious binary ran, or correlating execution evidence with other forensic artifacts during an investigation.\ndomain: cybersecurity\nsubdomain: digital-forensics\ntags:\n- forensics\n- prefetch\n- windows-artifacts\n- execution-history\n- timeline-analysis\n- evidence-collection\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- RS.AN-03\n- DE.AE-02\n- RS.MA-01\nmitre_attack:\n- T1059.001\n- T1003.001\n- T1021.002\n- T1567.002\n---\n\n# Analyzing Prefetch Files for Execution History\n\n## When to Use\n- When determining which programs were executed on a Windows system and when\n- During malware investigations to confirm execution of suspicious binaries\n- For establishing a timeline of application usage during an incident\n- When correlating program execution with other forensic artifacts\n- To identify anti-forensic tools or unauthorized software that was run\n\n## Prerequisites\n- Access to Windows Prefetch directory (C:\\Windows\\Prefetch\\) from forensic image\n- PECmd (Eric Zimmerman), WinPrefetchView, or python-prefetch parser\n- Understanding of Prefetch file format (versions 17, 23, 26, 30)\n- Windows system with Prefetch enabled (default on client OS, disabled on servers)\n- Knowledge of Prefetch naming conventions (APPNAME-HASH.pf)\n\n## Workflow\n\n### Step 1: Extract Prefetch Files from Forensic Image\n\n```bash\n# Mount the forensic image\nmount -o ro,loop,offset=$((2048*512)) \u002Fcases\u002Fcase-2024-001\u002Fimages\u002Fevidence.dd \u002Fmnt\u002Fevidence\n\n# Copy all prefetch files\nmkdir -p \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F\ncp \u002Fmnt\u002Fevidence\u002FWindows\u002FPrefetch\u002F*.pf \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F\n\n# Count and list prefetch files\nls -la \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | wc -l\nls -la \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | head -30\n\n# Hash all prefetch files for integrity\nsha256sum \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F*.pf > \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002Fpf_hashes.txt\n\n# Note: Prefetch filename format is EXECUTABLE_NAME-XXXXXXXX.pf\n# The hash (XXXXXXXX) is based on the executable path\n# Same executable from different paths creates different prefetch files\n```\n\n### Step 2: Parse Prefetch Files with PECmd\n\n```bash\n# Using Eric Zimmerman's PECmd (Windows or via Mono\u002FWine on Linux)\n# Download from https:\u002F\u002Fericzimmerman.github.io\u002F\n\n# Parse a single prefetch file\nPECmd.exe -f \"C:\\cases\\prefetch\\POWERSHELL.EXE-A]B2C3D4.pf\"\n\n# Parse all prefetch files and output to CSV\nPECmd.exe -d \"C:\\cases\\prefetch\\\" --csv \"C:\\cases\\analysis\\\" --csvf prefetch_results.csv\n\n# Parse with JSON output\nPECmd.exe -d \"C:\\cases\\prefetch\\\" --json \"C:\\cases\\analysis\\\" --jsonf prefetch_results.json\n\n# Output includes for each file:\n# - Executable name and path\n# - Run count\n# - Last run time (up to 8 timestamps in Windows 10)\n# - Files and directories referenced during execution\n# - Volume information (serial number, creation date)\n# - Prefetch file creation time\n```\n\n### Step 3: Parse with Python for Linux-Based Analysis\n\n```bash\npip install prefetch\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nfrom datetime import datetime\n\n# Parse prefetch files using python\nimport struct\n\ndef parse_prefetch(filepath):\n    \"\"\"Parse a Windows Prefetch file.\"\"\"\n    with open(filepath, 'rb') as f:\n        data = f.read()\n\n    # Check for MAM compressed format (Windows 10)\n    if data[:4] == b'MAM\\x04':\n        import lznt1  # or use DecompressBuffer\n        # Windows 10 prefetch files are compressed\n        print(f\"  [Compressed Win10 format - use PECmd for full parsing]\")\n        return None\n\n    # Version 17 (XP), 23 (Vista\u002F7), 26 (8.1), 30 (10)\n    version = struct.unpack('\u003CI', data[0:4])[0]\n    signature = data[4:8]\n\n    if signature != b'SCCA':\n        print(f\"  Invalid prefetch signature\")\n        return None\n\n    file_size = struct.unpack('\u003CI', data[8:12])[0]\n    exec_name = data[16:76].decode('utf-16-le').strip('\\x00')\n    run_count = struct.unpack('\u003CI', data[208:212])[0] if version >= 23 else struct.unpack('\u003CI', data[144:148])[0]\n\n    result = {\n        'version': version,\n        'executable': exec_name,\n        'file_size': file_size,\n        'run_count': run_count,\n    }\n\n    # Extract last execution timestamps\n    if version == 23:  # Vista\u002F7 - 1 timestamp\n        ts = struct.unpack('\u003CQ', data[128:136])[0]\n        result['last_run'] = filetime_to_datetime(ts)\n    elif version >= 26:  # Win8+ - up to 8 timestamps\n        timestamps = []\n        for i in range(8):\n            ts = struct.unpack('\u003CQ', data[128+i*8:136+i*8])[0]\n            if ts > 0:\n                timestamps.append(filetime_to_datetime(ts))\n        result['last_run_times'] = timestamps\n\n    return result\n\ndef filetime_to_datetime(ft):\n    \"\"\"Convert Windows FILETIME to datetime string.\"\"\"\n    if ft == 0:\n        return None\n    timestamp = (ft - 116444736000000000) \u002F 10000000\n    try:\n        return datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S UTC')\n    except (OSError, ValueError):\n        return None\n\n# Process all prefetch files\nprefetch_dir = '\u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F'\nresults = []\n\nfor filename in sorted(os.listdir(prefetch_dir)):\n    if filename.lower().endswith('.pf'):\n        filepath = os.path.join(prefetch_dir, filename)\n        print(f\"\\n=== {filename} ===\")\n        result = parse_prefetch(filepath)\n        if result:\n            print(f\"  Executable: {result['executable']}\")\n            print(f\"  Run Count:  {result['run_count']}\")\n            if 'last_run' in result:\n                print(f\"  Last Run:   {result['last_run']}\")\n            elif 'last_run_times' in result:\n                for i, ts in enumerate(result['last_run_times']):\n                    print(f\"  Run Time {i+1}: {ts}\")\n            results.append(result)\n\n# Save results\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fprefetch_analysis.json', 'w') as f:\n    json.dump(results, f, indent=2)\nPYEOF\n```\n\n### Step 4: Identify Suspicious Execution Evidence\n\n```bash\n# Search for known malicious tool names in prefetch\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(MIMIKATZ|PSEXEC|WMIC|COBALT|BEACON|PWDUMP|PROCDUMP|LAZAGNE|RUBEUS|BLOODHOUND|SHARPHOUND|CERTUTIL|BITSADMIN)'\n\n# Search for script interpreters (potential malicious execution)\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(POWERSHELL|CMD\\.EXE|WSCRIPT|CSCRIPT|MSHTA|REGSVR32|RUNDLL32|MSIEXEC)'\n\n# Search for remote access tools\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(TEAMVIEWER|ANYDESK|LOGMEIN|VNC|SPLASHTOP|SCREENCONNECT|AMMYY)'\n\n# Search for data exfiltration tools\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(RAR|7Z|ZIP|RCLONE|MEGA|DROPBOX|ONEDRIVE|GDRIVE|FTP|CURL|WGET)'\n\n# Find recently created prefetch files (newest executables run)\nls -lt \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | head -20\n\n# Cross-reference with Shimcache and Amcache for confirmation\n# Prefetch existence = program was executed at least once\n```\n\n### Step 5: Build Execution Timeline\n\n```bash\n# Create timeline from prefetch data\npython3 \u003C\u003C 'PYEOF'\nimport json\nimport csv\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fprefetch_analysis.json') as f:\n    data = json.load(f)\n\ntimeline = []\nfor entry in data:\n    if 'last_run_times' in entry:\n        for ts in entry['last_run_times']:\n            if ts:\n                timeline.append({\n                    'timestamp': ts,\n                    'executable': entry['executable'],\n                    'run_count': entry['run_count'],\n                    'source': 'Prefetch'\n                })\n    elif 'last_run' in entry and entry['last_run']:\n        timeline.append({\n            'timestamp': entry['last_run'],\n            'executable': entry['executable'],\n            'run_count': entry['run_count'],\n            'source': 'Prefetch'\n        })\n\n# Sort chronologically\ntimeline.sort(key=lambda x: x['timestamp'])\n\n# Write timeline CSV\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fexecution_timeline.csv', 'w', newline='') as f:\n    writer = csv.DictWriter(f, fieldnames=['timestamp', 'executable', 'run_count', 'source'])\n    writer.writeheader()\n    writer.writerows(timeline)\n\n# Print suspicious time window\nfor entry in timeline:\n    if '2024-01-15' in entry['timestamp'] or '2024-01-16' in entry['timestamp']:\n        print(f\"  {entry['timestamp']} | {entry['executable']} (x{entry['run_count']})\")\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Prefetch | Windows performance optimization that pre-loads application data and tracks execution |\n| SCCA signature | Magic bytes identifying a valid Prefetch file |\n| Path hash | CRC-based hash of the executable path forming part of the .pf filename |\n| Run count | Number of times the executable has been launched (may wrap around) |\n| Last run timestamps | Windows 8+ stores up to 8 most recent execution timestamps |\n| Referenced files | List of files and directories accessed during the first 10 seconds of execution |\n| Volume information | Drive serial number and creation date identifying the source volume |\n| MAM compression | Windows 10 Prefetch files use MAM4 compression requiring decompression before parsing |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| PECmd | Eric Zimmerman's Prefetch parser with CSV\u002FJSON output |\n| WinPrefetchView | NirSoft GUI tool for viewing Prefetch files |\n| python-prefetch | Python library for parsing Prefetch files |\n| Prefetch Hash Calculator | Tool to calculate expected hash from executable paths |\n| KAPE | Automated artifact collection including Prefetch |\n| Autopsy | Forensic platform with Prefetch analysis module |\n| Plaso\u002Flog2timeline | Super-timeline tool that includes Prefetch parser |\n| Velociraptor | Endpoint agent with Prefetch collection and analysis artifacts |\n\n## Common Scenarios\n\n**Scenario 1: Confirming Malware Execution**\nSearch Prefetch directory for the malware executable name, confirm execution via Prefetch existence, extract run count and last run time, identify referenced DLLs to understand malware behavior, correlate with registry autorun entries.\n\n**Scenario 2: Attacker Tool Usage Timeline**\nIdentify Prefetch files for PsExec, Mimikatz, BloodHound, and other attacker tools, build chronological timeline of tool execution, determine the sequence of the attack (reconnaissance, credential theft, lateral movement), match timestamps with network connection logs.\n\n**Scenario 3: Data Staging and Exfiltration**\nLook for Prefetch entries of compression tools (7z, WinRAR, zip), identify execution of file transfer utilities (rclone, FTP clients), check for cloud storage client execution, timeline when data staging and transfer occurred.\n\n**Scenario 4: Anti-Forensics Detection**\nCheck for execution of known anti-forensic tools (CCleaner, Eraser, SDelete), identify if Prefetch directory was recently cleared (fewer files than expected for active system), note timestamps of anti-forensic tool execution relative to other evidence.\n\n## Output Format\n\n```\nPrefetch Analysis Summary:\n  System: Windows 10 Pro (Build 19041)\n  Prefetch Files: 234\n  Analysis Period: All available execution history\n\n  Execution Statistics:\n    Total unique executables: 234\n    First execution: 2023-06-15 (system install)\n    Latest execution: 2024-01-18 23:45 UTC\n\n  Suspicious Executions:\n    MIMIKATZ.EXE-5F2A3B1C.pf\n      Run Count: 3 | Last: 2024-01-16 02:30:15 UTC\n    PSEXEC.EXE-AD70946C.pf\n      Run Count: 7 | Last: 2024-01-16 02:45:30 UTC\n    RCLONE.EXE-1F3E5A2B.pf\n      Run Count: 2 | Last: 2024-01-17 03:15:00 UTC\n    POWERSHELL.EXE-022A1004.pf\n      Run Count: 145 | Last: 2024-01-18 14:00:00 UTC\n\n  Attack Timeline (from Prefetch):\n    2024-01-15 14:32 - POWERSHELL.EXE (initial access)\n    2024-01-16 02:30 - MIMIKATZ.EXE (credential theft)\n    2024-01-16 02:45 - PSEXEC.EXE (lateral movement)\n    2024-01-17 03:15 - RCLONE.EXE (data exfiltration)\n\n  Report: \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fexecution_timeline.csv\n```\n","# Analyzing Prefetch Files for Execution History\n\n## When to Use\n- When determining which programs were executed on a Windows system and when\n- During malware investigations to confirm execution of suspicious binaries\n- For establishing a timeline of application usage during an incident\n- When correlating program execution with other forensic artifacts\n- To identify anti-forensic tools or unauthorized software that was run\n\n## Prerequisites\n- Access to Windows Prefetch directory (C:\\Windows\\Prefetch\\) from forensic image\n- PECmd (Eric Zimmerman), WinPrefetchView, or python-prefetch parser\n- Understanding of Prefetch file format (versions 17, 23, 26, 30)\n- Windows system with Prefetch enabled (default on client OS, disabled on servers)\n- Knowledge of Prefetch naming conventions (APPNAME-HASH.pf)\n\n## Workflow\n\n### Step 1: Extract Prefetch Files from Forensic Image\n\n```bash\n# Mount the forensic image\nmount -o ro,loop,offset=$((2048*512)) \u002Fcases\u002Fcase-2024-001\u002Fimages\u002Fevidence.dd \u002Fmnt\u002Fevidence\n\n# Copy all prefetch files\nmkdir -p \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F\ncp \u002Fmnt\u002Fevidence\u002FWindows\u002FPrefetch\u002F*.pf \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F\n\n# Count and list prefetch files\nls -la \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | wc -l\nls -la \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | head -30\n\n# Hash all prefetch files for integrity\nsha256sum \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F*.pf > \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002Fpf_hashes.txt\n\n# Note: Prefetch filename format is EXECUTABLE_NAME-XXXXXXXX.pf\n# The hash (XXXXXXXX) is based on the executable path\n# Same executable from different paths creates different prefetch files\n```\n\n### Step 2: Parse Prefetch Files with PECmd\n\n```bash\n# Using Eric Zimmerman's PECmd (Windows or via Mono\u002FWine on Linux)\n# Download from https:\u002F\u002Fericzimmerman.github.io\u002F\n\n# Parse a single prefetch file\nPECmd.exe -f \"C:\\cases\\prefetch\\POWERSHELL.EXE-A]B2C3D4.pf\"\n\n# Parse all prefetch files and output to CSV\nPECmd.exe -d \"C:\\cases\\prefetch\\\" --csv \"C:\\cases\\analysis\\\" --csvf prefetch_results.csv\n\n# Parse with JSON output\nPECmd.exe -d \"C:\\cases\\prefetch\\\" --json \"C:\\cases\\analysis\\\" --jsonf prefetch_results.json\n\n# Output includes for each file:\n# - Executable name and path\n# - Run count\n# - Last run time (up to 8 timestamps in Windows 10)\n# - Files and directories referenced during execution\n# - Volume information (serial number, creation date)\n# - Prefetch file creation time\n```\n\n### Step 3: Parse with Python for Linux-Based Analysis\n\n```bash\npip install prefetch\n\npython3 \u003C\u003C 'PYEOF'\nimport os\nimport json\nfrom datetime import datetime\n\n# Parse prefetch files using python\nimport struct\n\ndef parse_prefetch(filepath):\n    \"\"\"Parse a Windows Prefetch file.\"\"\"\n    with open(filepath, 'rb') as f:\n        data = f.read()\n\n    # Check for MAM compressed format (Windows 10)\n    if data[:4] == b'MAM\\x04':\n        import lznt1  # or use DecompressBuffer\n        # Windows 10 prefetch files are compressed\n        print(f\"  [Compressed Win10 format - use PECmd for full parsing]\")\n        return None\n\n    # Version 17 (XP), 23 (Vista\u002F7), 26 (8.1), 30 (10)\n    version = struct.unpack('\u003CI', data[0:4])[0]\n    signature = data[4:8]\n\n    if signature != b'SCCA':\n        print(f\"  Invalid prefetch signature\")\n        return None\n\n    file_size = struct.unpack('\u003CI', data[8:12])[0]\n    exec_name = data[16:76].decode('utf-16-le').strip('\\x00')\n    run_count = struct.unpack('\u003CI', data[208:212])[0] if version >= 23 else struct.unpack('\u003CI', data[144:148])[0]\n\n    result = {\n        'version': version,\n        'executable': exec_name,\n        'file_size': file_size,\n        'run_count': run_count,\n    }\n\n    # Extract last execution timestamps\n    if version == 23:  # Vista\u002F7 - 1 timestamp\n        ts = struct.unpack('\u003CQ', data[128:136])[0]\n        result['last_run'] = filetime_to_datetime(ts)\n    elif version >= 26:  # Win8+ - up to 8 timestamps\n        timestamps = []\n        for i in range(8):\n            ts = struct.unpack('\u003CQ', data[128+i*8:136+i*8])[0]\n            if ts > 0:\n                timestamps.append(filetime_to_datetime(ts))\n        result['last_run_times'] = timestamps\n\n    return result\n\ndef filetime_to_datetime(ft):\n    \"\"\"Convert Windows FILETIME to datetime string.\"\"\"\n    if ft == 0:\n        return None\n    timestamp = (ft - 116444736000000000) \u002F 10000000\n    try:\n        return datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S UTC')\n    except (OSError, ValueError):\n        return None\n\n# Process all prefetch files\nprefetch_dir = '\u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F'\nresults = []\n\nfor filename in sorted(os.listdir(prefetch_dir)):\n    if filename.lower().endswith('.pf'):\n        filepath = os.path.join(prefetch_dir, filename)\n        print(f\"\\n=== {filename} ===\")\n        result = parse_prefetch(filepath)\n        if result:\n            print(f\"  Executable: {result['executable']}\")\n            print(f\"  Run Count:  {result['run_count']}\")\n            if 'last_run' in result:\n                print(f\"  Last Run:   {result['last_run']}\")\n            elif 'last_run_times' in result:\n                for i, ts in enumerate(result['last_run_times']):\n                    print(f\"  Run Time {i+1}: {ts}\")\n            results.append(result)\n\n# Save results\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fprefetch_analysis.json', 'w') as f:\n    json.dump(results, f, indent=2)\nPYEOF\n```\n\n### Step 4: Identify Suspicious Execution Evidence\n\n```bash\n# Search for known malicious tool names in prefetch\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(MIMIKATZ|PSEXEC|WMIC|COBALT|BEACON|PWDUMP|PROCDUMP|LAZAGNE|RUBEUS|BLOODHOUND|SHARPHOUND|CERTUTIL|BITSADMIN)'\n\n# Search for script interpreters (potential malicious execution)\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(POWERSHELL|CMD\\.EXE|WSCRIPT|CSCRIPT|MSHTA|REGSVR32|RUNDLL32|MSIEXEC)'\n\n# Search for remote access tools\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(TEAMVIEWER|ANYDESK|LOGMEIN|VNC|SPLASHTOP|SCREENCONNECT|AMMYY)'\n\n# Search for data exfiltration tools\nls \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | grep -iE \\\n   '(RAR|7Z|ZIP|RCLONE|MEGA|DROPBOX|ONEDRIVE|GDRIVE|FTP|CURL|WGET)'\n\n# Find recently created prefetch files (newest executables run)\nls -lt \u002Fcases\u002Fcase-2024-001\u002Fprefetch\u002F | head -20\n\n# Cross-reference with Shimcache and Amcache for confirmation\n# Prefetch existence = program was executed at least once\n```\n\n### Step 5: Build Execution Timeline\n\n```bash\n# Create timeline from prefetch data\npython3 \u003C\u003C 'PYEOF'\nimport json\nimport csv\n\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fprefetch_analysis.json') as f:\n    data = json.load(f)\n\ntimeline = []\nfor entry in data:\n    if 'last_run_times' in entry:\n        for ts in entry['last_run_times']:\n            if ts:\n                timeline.append({\n                    'timestamp': ts,\n                    'executable': entry['executable'],\n                    'run_count': entry['run_count'],\n                    'source': 'Prefetch'\n                })\n    elif 'last_run' in entry and entry['last_run']:\n        timeline.append({\n            'timestamp': entry['last_run'],\n            'executable': entry['executable'],\n            'run_count': entry['run_count'],\n            'source': 'Prefetch'\n        })\n\n# Sort chronologically\ntimeline.sort(key=lambda x: x['timestamp'])\n\n# Write timeline CSV\nwith open('\u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fexecution_timeline.csv', 'w', newline='') as f:\n    writer = csv.DictWriter(f, fieldnames=['timestamp', 'executable', 'run_count', 'source'])\n    writer.writeheader()\n    writer.writerows(timeline)\n\n# Print suspicious time window\nfor entry in timeline:\n    if '2024-01-15' in entry['timestamp'] or '2024-01-16' in entry['timestamp']:\n        print(f\"  {entry['timestamp']} | {entry['executable']} (x{entry['run_count']})\")\nPYEOF\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| Prefetch | Windows performance optimization that pre-loads application data and tracks execution |\n| SCCA signature | Magic bytes identifying a valid Prefetch file |\n| Path hash | CRC-based hash of the executable path forming part of the .pf filename |\n| Run count | Number of times the executable has been launched (may wrap around) |\n| Last run timestamps | Windows 8+ stores up to 8 most recent execution timestamps |\n| Referenced files | List of files and directories accessed during the first 10 seconds of execution |\n| Volume information | Drive serial number and creation date identifying the source volume |\n| MAM compression | Windows 10 Prefetch files use MAM4 compression requiring decompression before parsing |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| PECmd | Eric Zimmerman's Prefetch parser with CSV\u002FJSON output |\n| WinPrefetchView | NirSoft GUI tool for viewing Prefetch files |\n| python-prefetch | Python library for parsing Prefetch files |\n| Prefetch Hash Calculator | Tool to calculate expected hash from executable paths |\n| KAPE | Automated artifact collection including Prefetch |\n| Autopsy | Forensic platform with Prefetch analysis module |\n| Plaso\u002Flog2timeline | Super-timeline tool that includes Prefetch parser |\n| Velociraptor | Endpoint agent with Prefetch collection and analysis artifacts |\n\n## Common Scenarios\n\n**Scenario 1: Confirming Malware Execution**\nSearch Prefetch directory for the malware executable name, confirm execution via Prefetch existence, extract run count and last run time, identify referenced DLLs to understand malware behavior, correlate with registry autorun entries.\n\n**Scenario 2: Attacker Tool Usage Timeline**\nIdentify Prefetch files for PsExec, Mimikatz, BloodHound, and other attacker tools, build chronological timeline of tool execution, determine the sequence of the attack (reconnaissance, credential theft, lateral movement), match timestamps with network connection logs.\n\n**Scenario 3: Data Staging and Exfiltration**\nLook for Prefetch entries of compression tools (7z, WinRAR, zip), identify execution of file transfer utilities (rclone, FTP clients), check for cloud storage client execution, timeline when data staging and transfer occurred.\n\n**Scenario 4: Anti-Forensics Detection**\nCheck for execution of known anti-forensic tools (CCleaner, Eraser, SDelete), identify if Prefetch directory was recently cleared (fewer files than expected for active system), note timestamps of anti-forensic tool execution relative to other evidence.\n\n## Output Format\n\n```\nPrefetch Analysis Summary:\n  System: Windows 10 Pro (Build 19041)\n  Prefetch Files: 234\n  Analysis Period: All available execution history\n\n  Execution Statistics:\n    Total unique executables: 234\n    First execution: 2023-06-15 (system install)\n    Latest execution: 2024-01-18 23:45 UTC\n\n  Suspicious Executions:\n    MIMIKATZ.EXE-5F2A3B1C.pf\n      Run Count: 3 | Last: 2024-01-16 02:30:15 UTC\n    PSEXEC.EXE-AD70946C.pf\n      Run Count: 7 | Last: 2024-01-16 02:45:30 UTC\n    RCLONE.EXE-1F3E5A2B.pf\n      Run Count: 2 | Last: 2024-01-17 03:15:00 UTC\n    POWERSHELL.EXE-022A1004.pf\n      Run Count: 145 | Last: 2024-01-18 14:00:00 UTC\n\n  Attack Timeline (from Prefetch):\n    2024-01-15 14:32 - POWERSHELL.EXE (initial access)\n    2024-01-16 02:30 - MIMIKATZ.EXE (credential theft)\n    2024-01-16 02:45 - PSEXEC.EXE (lateral movement)\n    2024-01-17 03:15 - RCLONE.EXE (data exfiltration)\n\n  Report: \u002Fcases\u002Fcase-2024-001\u002Fanalysis\u002Fexecution_timeline.csv\n```\n",{"name":5,"tags":51,"author":52,"domain":35,"license":16,"version":53,"nist_csf":54,"subdomain":58,"description":7,"mitre_attack":59},[39,41,42,43,44,45],"mahipal","1.0",[55,56,57],"RS.AN-03","DE.AE-02","RS.MA-01","digital-forensics",[40,60,61,62],"T1003.001","T1021.002","T1567.002","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fanalyzing-prefetch-files-for-execution-history",4425,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":9,"skillName":5,"commands":74,"prompt":84,"zipAvailable":85},[75,78,81],{"tool":76,"command":77},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-prefetch-files-for-execution-history",{"tool":79,"command":80},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-prefetch-files-for-execution-history",{"tool":82,"command":83},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill analyzing-prefetch-files-for-execution-history","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-prefetch-files-for-execution-history\u002FSKILL.md",true,[87,92,98,102],{"path":88,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-prefetch-files-for-execution-history\u002FLICENSE",{"path":93,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"package.json","REFERENCE","参考文档",857,"https:\u002F\u002Fgithub.com\u002Fnodetool-ai\u002Fnodetool\u002Fblob\u002Fmain\u002Fpackages\u002Fsandbox-packs\u002Fsandbox-ocr\u002Fpackage.json",{"path":99,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fapi-reference.md",3146,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-prefetch-files-for-execution-history\u002Freferences\u002Fapi-reference.md",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"scripts\u002Fagent.py","SCRIPT","脚本",8231,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fanalyzing-prefetch-files-for-execution-history\u002Fscripts\u002Fagent.py",[109,140,169,201,229,261],{"skillNo":110,"name":111,"nameZh":112,"description":113,"descriptionZh":114,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":115,"categories":116,"keywords":121,"publishedAt":46},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","SLSA 构建来源验证","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","使用 Sigstore 的 cosign（verify、verify-attestation、verify-blob-attestation）和 slsa-verifier（verify-artifact）验证工件签名和 SLSA 来源（provenance），强制校验 keyless OIDC 构建者身份和源仓库是否符合 SLSA Build 级别。适用于 CI\u002FCD 中部署工件前、消费第三方证明时、建立 SLSA Build L3 管道，或在事件响应或准入控制期间确认来源的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[117,118],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":119,"categoryName":120,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C32Q37WAMK06SGMFC02VFP","软件供应链安全",[122,123,124,125,126,35,127,128,129,130,38,131,132,133,134,135,136,137,138,139],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","security","incident response","identity","pr","code","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":141,"name":142,"nameZh":143,"description":144,"descriptionZh":145,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":146,"categories":147,"keywords":152,"publishedAt":46},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","TPM 测量启动验证","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","使用 tpm2-tools 验证 TPM 2.0 测量启动（measured boot）的完整性和远程证明：读取 PCR（tpm2_pcrread）、重放启动事件日志、生成并检查签名报价（tpm2_quote\u002Ftpm2_checkquote），以及将机密封印（seal）到 PCR 策略。适用于确认系统已启动可信固件\u002F内核以实现零信任（Zero Trust）设备状态、通过 PCR 漂移检测启动链篡改，或构建黄金值基线用于机群（fleet）证明。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[148,149],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":150,"categoryName":151,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C89JJEXGGRGHS6XVXDA46K","终端安全加固",[153,136,154,155,126,156,35,129,157,158,159,160,161,162,163,164,165,166,167,168],"boot","TPM","validating tpm measured boot attestation","policy","verification","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":170,"name":171,"nameZh":172,"description":173,"descriptionZh":174,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":175,"categories":176,"keywords":183,"publishedAt":46},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","备份完整性验证","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","通过加密哈希验证、自动化恢复测试、损坏检测和可恢复性检查来验证备份完整性，确认备份对于灾难恢复和勒索软件响应是可靠的。适用于在依赖备份进行恢复之前、构建备份后验证管道、审计备份基础设施以满足合规要求，或检查不可变\u002Fair-gapped（气隙）备份是否存在静默损坏或篡改的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[177,180],{"categoryNo":178,"categoryName":179,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD4WETX0HM3SM9QKQ15B","SRE 工程师",{"categoryNo":181,"categoryName":182,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSSTY86MWS6W5GDQWB1ADQ","备份与灾难恢复",[163,184,185,186,187,35,188,189,157,190,191,192,193,194,195,196,197,198,199,200],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","validation","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":202,"name":203,"nameZh":204,"description":205,"descriptionZh":206,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":207,"categories":208,"keywords":213,"publishedAt":46},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","KAPE Windows 取证收集","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","运行 KAPE（Kroll Artifact Parser and Extractor），通过 Targets 收集目标取证工件（注册表配置单元、$MFT、事件日志、prefetch、浏览器数据），并使用封装 Eric Zimmerman 的 EZ Tools（PECmd、MFTECmd、RECmd）的 Modules 进行解析。适用于事件遏制\u002F分诊早期阶段——此时完整磁盘镜像不切实际，但需要快速获得可采信、可解析的 Windows 工件集，包括大规模远程收集。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[209,210],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":211,"categoryName":212,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C9JZH3GWXPJ6CQG5P7J48Y","数字取证与电子证据分析",[36,214,215,35,216,217,218,219,220,221,222,223,41,224,58,225,160,226,227,228],"kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","eric-zimmerman","SET","collection","pecmd","artifact-collection",{"skillNo":230,"name":231,"nameZh":232,"description":233,"descriptionZh":234,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":235,"categories":236,"keywords":241,"publishedAt":46},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","SSVC 漏洞优先级分诊","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","使用 CISA 的 Stakeholder-Specific Vulnerability Categorization（SSVC，利益相关方特定漏洞分类）决策树对漏洞进行分诊和优先级排序，权衡利用状态（通过 CISA KEV 目录和 FIRST EPSS API）、技术影响、自动化程度和任务普遍性，输出 Track\u002FTrack*\u002FAttend\u002FAct 决策。适用于对漏洞扫描结果（OpenVAS、Nessus、Qualys）进行优先级排序以制定修复计划，而不局限于原始 CVSS 分数的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[237,240],{"categoryNo":238,"categoryName":239,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQV98CYQ7TEW2D1MRQ00TE","安全公告与漏洞管理",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[242,243,244,35,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260],"vulnerabilities","framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":262,"name":263,"nameZh":264,"description":265,"descriptionZh":266,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":267,"categories":268,"keywords":271,"publishedAt":46},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","安全事件初步分诊","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","使用 NIST SP 800-61r3 和 SANS PICERL 框架对安全事件进行初步分诊，分类事件类型、按业务影响分配优先级，并路由到相应的响应团队。适用于 SIEM\u002FEDR 告警需要人工分类、并发告警必须确定优先级，或用户报告或威胁情报 IOC 匹配需要初步事件分类的场景。","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[269,270],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[126,272,35,273,274,275,276,277,278,279,280,196,281,197,282,283,284,285,286,287],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]