In this module
IR1.2 KAPE — Collection at Speed
KAPE — Collection at Speed
The first tool you run when you arrive at a compromised system
The alert fired 20 minutes ago. You need evidence from the compromised endpoint before the attacker notices they have been detected and starts destroying artifacts. You do not have 90 minutes for a full disk image. You need the critical forensic artifacts — Prefetch, event logs, registry hives, $MFT — collected in under 5 minutes. That is what KAPE does.
KAPE (Kroll Artifact Parser and Extractor) is a forensic triage collection and processing tool created by Eric Zimmerman — a three-time Forensic 4:cast DFIR Investigator of the Year and SANS instructor who built most of the forensic parsing tools used in the industry today. KAPE was first released in 2019, acquired by Kroll in 2020, and has been continuously updated with quarterly releases since then. It is used by SANS in their FOR500 and FOR508 courses, by government CERT teams worldwide, by the Big 4 consulting firms, and by thousands of independent IR practitioners.
# Step 1: Download KAPE
# Navigate to the Kroll download page:
# https://www.kroll.com/en/services/cyber-risk/
# incident-response-litigation-support/kroll-artifact-parser-extractor-kape
# Submit the download request form (name, email, organization)
# Download link arrives via email within minutes
# Step 2: Extract to the forensic workstation
# Extract the zip to C:\IR\Tools\KAPE\
Expand-Archive -Path "$env:USERPROFILE\Downloads\kape.zip" -DestinationPath "C:\IR\Tools\KAPE" -Force
# Step 3: Verify the installation
Set-Location "C:\IR\Tools\KAPE"
.\kape.exe --help | Select-Object -First 3
# Expected: KAPE version number and command syntax
# Step 4: Verify the directory structure
Get-ChildItem "C:\IR\Tools\KAPE" -Directory | Select-Object Name
# Expected directories: Targets, Modules, Documentation
# The Modules\bin\ directory may be empty — EZTools go here (IR1.3)# After installing EZTools (IR1.3), verify the bin directory
# This check prevents the most common KAPE configuration error
$binPath = "C:\IR\Tools\KAPE\Modules\bin"
$requiredTools = @("PECmd.exe", "EvtxECmd.exe", "MFTECmd.exe",
"AmcacheParser.exe", "AppCompatCacheParser.exe", "RECmd.exe",
"JLECmd.exe", "LECmd.exe", "SBECmd.exe", "RBCmd.exe", "WxTCmd.exe")
foreach ($tool in $requiredTools) {
$exists = Test-Path (Join-Path $binPath $tool)
$status = if ($exists) { "OK" } else { "MISSING — Module phase will fail for this parser" }
$color = if ($exists) { "Green" } else { "Red" }
Write-Host "$tool`: $status" -ForegroundColor $color
}# Update KAPE targets and modules to the latest community versions
Set-Location "C:\IR\Tools\KAPE"
# Recommended method: built-in sync (updates targets, modules, AND EZTools binaries)
.\kape.exe --sync
# Alternative for air-gapped systems: manual update from GitHub
# git clone https://github.com/EricZimmerman/KapeFiles.git
# Copy Targets\ and Modules\ into C:\IR\Tools\KAPE\
# Verify the update
$targetCount = (Get-ChildItem "C:\IR\Tools\KAPE\Targets" -Recurse -Filter "*.tkape").Count
$moduleCount = (Get-ChildItem "C:\IR\Tools\KAPE\Modules" -Recurse -Filter "*.mkape").Count
Write-Host "Targets available: $targetCount" -ForegroundColor Cyan
Write-Host "Modules available: $moduleCount" -ForegroundColor Cyan
# As of early 2026: expect 440+ targets and 350+ modules# First KAPE collection — test on your forensic workstation
# Run PowerShell as Administrator (required for raw disk access)
Set-Location "C:\IR\Tools\KAPE"
# Collect using !SANS_Triage, output to a VHDX container
.\kape.exe --tsource C: --tdest "C:\IR\Evidence\TEST_%m" --target !SANS_Triage --vhdx TEST_%m
# Command breakdown:
# --tsource C: Source drive to collect from
# --tdest ... Destination for collected artifacts
# --target !SANS_Triage Compound target (! prefix)
# --vhdx TEST_%m Create VHDX virtual disk (%m = machine name macro)
#
# Runtime: 2-5 minutes for a typical workstation
# Output: C:\IR\Evidence\TEST_<machinename>\TEST_<machinename>.vhdx
# Size: 200 MB - 2 GB depending on system configuration# Mount the VHDX and explore the collection
$vhdxFile = Get-ChildItem "C:\IR\Evidence\TEST_*\*.vhdx" | Select-Object -First 1
Mount-DiskImage -ImagePath $vhdxFile.FullName
$drive = (Get-DiskImage -ImagePath $vhdxFile.FullName |
Get-Disk | Get-Partition | Get-Volume).DriveLetter
# Count artifacts by investigation category
Write-Host "=== KAPE Collection Inventory ===" -ForegroundColor Cyan
$pf = (Get-ChildItem "${drive}:\C\Windows\Prefetch\*.pf" -EA 0).Count
Write-Host "Prefetch files (execution evidence): $pf" -ForegroundColor White
$evtx = (Get-ChildItem "${drive}:\C\Windows\System32\winevt\Logs\*.evtx" -EA 0).Count
Write-Host "Event log files: $evtx" -ForegroundColor White
$hives = @("SAM","SYSTEM","SOFTWARE","SECURITY","NTUSER.DAT","UsrClass.dat")
$hiveCount = (Get-ChildItem "${drive}:\" -Recurse -Include $hives -EA 0).Count
Write-Host "Registry hives: $hiveCount" -ForegroundColor White
$mft = Test-Path "${drive}:\C\`$MFT"
Write-Host "`$MFT captured: $mft" -ForegroundColor White
$total = (Get-ChildItem "${drive}:\" -Recurse -File -EA 0).Count
$sizeMB = [math]::Round((Get-ChildItem "${drive}:\" -Recurse -File -EA 0 |
Measure-Object Length -Sum).Sum / 1MB, 1)
Write-Host "Total artifacts: $total files ($sizeMB MB)" -ForegroundColor Green
Dismount-DiskImage -ImagePath $vhdxFile.FullName# Production KAPE command — collect AND parse in one pass
# This is the command you will use at the start of most investigations
Set-Location "C:\IR\Tools\KAPE"
.\kape.exe --tsource C: --tdest "C:\IR\Cases\INC-NE-2026-0315-001\Evidence\%m" --target !SANS_Triage --mdest "C:\IR\Cases\INC-NE-2026-0315-001\Output\%m" --module !EZParser --vhdx %m
# Argument reference:
# --tsource C: Source drive to collect from
# --tdest ... Raw artifacts (preserves original paths)
# --target !SANS_Triage Standard IR artifact collection
# --mdest ... Parsed output from EZTools processing
# --module !EZParser Process all artifacts through EZTools suite
# --vhdx %m Also create VHDX for evidence preservation
#
# The !EZParser compound module automatically runs:
# PECmd.exe → Prefetch → EvidenceOfExecution\
# AmcacheParser.exe → Amcache.hve → EvidenceOfExecution\
# AppCompatCacheParser → ShimCache → EvidenceOfExecution\
# EvtxECmd.exe → .evtx files → EventLogs\
# MFTECmd.exe → $MFT/$UsnJrnl → FilesystemTimeline\
# RECmd.exe → Registry hives → Registry\
# JLECmd.exe → Jump Lists → FileAccess\
# LECmd.exe → LNK files → FileAccess\
# SBECmd.exe → ShellBags → FileAccess\
# RBCmd.exe → Recycle Bin → DeletedFiles\
# WxTCmd.exe → Win Timeline → UserActivity\# Method 1: PowerShell Remoting (domain environments)
$target = "DESKTOP-NGE042"
$cred = Get-Credential -Message "Admin credentials for $target"
$session = New-PSSession -ComputerName $target -Credential $cred
# Copy KAPE to the remote system
Copy-Item "C:\IR\Tools\KAPE" -Destination "C:\Temp\KAPE" -ToSession $session -Recurse
# Run KAPE remotely
Invoke-Command -Session $session -ScriptBlock {
C:\Temp\KAPE\kape.exe --tsource C: --tdest C:\Temp\KAPEOutput --target !SANS_Triage --vhdx Collection
}
# Retrieve results
Copy-Item "C:\Temp\KAPEOutput" -Destination "C:\IR\Evidence\$target" -FromSession $session -Recurse
# Clean up (remove forensic footprint from target)
Invoke-Command -Session $session { Remove-Item C:\Temp\KAPE, C:\Temp\KAPEOutput -Recurse -Force }
Remove-PSSession $session# Method 2: PsExec (when PS Remoting is unavailable)
# -s = run as SYSTEM (maximum artifact access, bypasses UAC)
# -accepteula = suppress EULA prompt on first run
psexec \\DESKTOP-NGE042 -s -accepteula cmd /c "\\FileServer\IR$\KAPE\kape.exe --tsource C: --tdest \\FileServer\IR$\Evidence\DESKTOP-NGE042 --target !SANS_Triage --vhdx DESKTOP-NGE042"# Custom target example: CrowdStrike Falcon sensor data
# Save as: C:\IR\Tools\KAPE\Targets\Custom\CrowdStrike.tkape
Description: CrowdStrike Falcon sensor logs and quarantine
Author: Ridgeline IR
Version: 1.0
Id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
RecreateDirectories: true
Targets:
-
Name: CrowdStrike Falcon Logs
Category: SecurityProduct
Path: C:\Windows\System32\drivers\CrowdStrike\
FileMask: "*"
Recursive: true
-
Name: CrowdStrike Quarantine
Category: SecurityProduct
Path: C:\ProgramData\CrowdStrike\
FileMask: "*"
Recursive: trueBuild it: Run your first collection and decode the output
Run the test collection command on your forensic workstation
Run the test collection command on your forensic workstation. Mount the VHDX and run the inventory script. Open the Prefetch folder and count the .pf files — each one represents a program that executed on this system. Find powershell.exe among them. Open the winevt\Logs folder and find Security.evtx — this file contains every logon event, every process creation, and every security policy change on the system. Find the NTUSER.DAT file in a user profile — this single file contains the user's Run key persistence, typed paths, recent documents, and UserAssist execution history. Then run the production command (targets + modules together) and examine the --mdest output. Open the EvidenceOfExecution folder — you will find CSV output from three different parsers, all answering one question. Open one CSV in Timeline Explorer and sort by timestamp. You are now looking at the same output format you will use for every investigation in this course.
Investigate: Why does KAPE need two passes?
Try this: open PowerShell (not as Administrator) and run Copy-Item C:\Windows\System32\config\SAM C:\Temp\SAM. It will fail — the OS holds this file open. Now try Copy-Item C:\Windows\Prefetch\*.pf C:\Temp\. This succeeds because Prefetch files are not locked. KAPE's first pass handles the Prefetch (unlocked). Its second pass handles the SAM (locked) by reading the raw disk sectors. This is why KAPE requires Administrator privileges and why simple file copying does not produce a complete forensic collection. The locked files — registry hives, $MFT, active event logs — are often the most forensically valuable artifacts on the system.
Beyond this investigation
The techniques taught in this subsection apply beyond the specific scenario presented here. The same evidence sources, tools, and analytical methods are used across ransomware, BEC, insider threat, and APT investigations — the context changes but the methodology is consistent.
You arrive at a compromised Windows endpoint. The user is still logged in and working. Do you ask the user to stop working or collect evidence while they continue?
Collect while they continue — but explain what you are doing. Asking the user to stop may cause them to close applications, which terminates processes and destroys volatile evidence. The collection sequence runs in the background: WinPMem for memory, then KAPE for triage artifacts, then volatile state commands. Inform the user: 'I am collecting security data from your machine. Please continue working normally — do not restart or shut down.' The user's continued activity adds noise but preserves the attacker's running processes and network connections.