mcpField
P
performing-endpoint-forensics-investigation

performing-endpoint-forensics-investigation

github.com/mukul975安全35.2k72 次安装8 周前更新
代码仓库

关于 performing-endpoint-forensics-investigation

用于端点入侵取证的安全技能,面向事件响应和取证分析人员。它按易失性顺序指导证据保全,并涵盖内存、磁盘及 Windows 痕迹分析和时间线重建。

主要功能

  1. 01按易失性顺序收集证据
  2. 02获取内存并制作磁盘映像
  3. 03使用 Volatility 3 分析内存
  4. 04分析 Windows 执行痕迹
  5. 05重建事件时间线
  6. 06记录取证发现与证据链

适用场景

  1. 01调查疑似端点入侵
  2. 02为事件响应或法律程序保全证据
  3. 03从端点痕迹重建攻击者活动时间线

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mukul975/anthropic-cybersecurity-skills --skill performing-endpoint-forensics-investigation

安装后在 Claude Code 中输入/performing-endpoint-forensics-investigation确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

LICENSE
assets/
template.md
references/
api-reference.md
standards.md
workflows.md
scripts/
agent.py
process.py

详细介绍

执行终端取证调查

适用场景

在以下情况下使用此技能:

  • 调查已确认或疑似的终端失陷事件,并需要进行取证分析
  • 为事件响应或法律诉讼收集易失性和非易失性证据
  • 分析内存转储中的恶意软件、注入代码或凭据窃取痕迹
  • 根据终端痕迹(prefetch、shimcache、amcache)重建攻击者时间线

请勿将此技能用于实时威胁狩猎(请使用 EDR/SIEM)或网络取证。

先决条件

  • 配备分析工具(Volatility 3、KAPE、Autopsy、Eric Zimmerman 工具)的取证工作站
  • 用于磁盘映像的写保护器(硬件或软件)
  • 具备监管链文档的安全证据存储
  • 内存采集工具(WinPMEM、FTK Imager、Magnet RAM Capture)
  • 对目标终端的管理员访问权限(或物理访问权限)

工作流

步骤 1:证据保全(易失性顺序)

按照从最易失到最不易失的顺序收集证据:

1. System memory (RAM) - Most volatile
2. Network connections and routing tables
3. Running processes and open files
4. Disk contents (file system)
5. Removable media
6. Logs and backup data - Least volatile

内存采集:

# WinPMEM (Windows)
winpmem_mini_x64.exe memdump.raw

# FTK Imager - Create memory capture via GUI
# File → Capture Memory → Destination path → Capture Memory

# Linux (LiME kernel module)
sudo insmod lime.ko "path=/evidence/memory.lime format=lime"

易失性数据收集:

# Capture running processes
Get-Process | Export-Csv "evidence\processes.csv" -NoTypeInformation
tasklist /v > "evidence\tasklist.txt"

# Capture network connections
netstat -anob > "evidence\netstat.txt"
Get-NetTCPConnection | Export-Csv "evidence\tcp_connections.csv"

# Capture logged-on users
query user > "evidence\logged_users.txt"

# Capture scheduled tasks
schtasks /query /fo CSV /v > "evidence\scheduled_tasks.csv"

# Capture services
Get-Service | Export-Csv "evidence\services.csv"

# Capture DNS cache
ipconfig /displaydns > "evidence\dns_cache.txt"
步骤 2:磁盘映像
# FTK Imager - Create forensic disk image
# File → Create Disk Image → Physical Drive → E01 format
# Always verify image hash (MD5/SHA1) matches source

# dd (Linux)
sudo dc3dd if=/dev/sda of=/evidence/disk.dd hash=sha256 log=/evidence/imaging.log

# Verify image integrity
sha256sum /evidence/disk.dd
# Compare with hash generated during imaging
步骤 3:使用 Volatility 3 分析内存
# Identify OS profile
vol -f memdump.raw windows.info

# List running processes
vol -f memdump.raw windows.pslist
vol -f memdump.raw windows.pstree

# Find hidden processes
vol -f memdump.raw windows.psscan

# Analyze network connections
vol -f memdump.raw windows.netscan

# Detect process injection
vol -f memdump.raw windows.malfind

# Extract command line arguments
vol -f memdump.raw windows.cmdline

# Analyze DLLs loaded by processes
vol -f memdump.raw windows.dlllist --pid 1234

# Extract files from memory
vol -f memdump.raw windows.filescan | grep -i "suspicious"
vol -f memdump.raw windows.dumpfiles --pid 1234

# Detect credential theft
vol -f memdump.raw windows.hashdump
vol -f memdump.raw windows.lsadump

# Registry analysis from memory
vol -f memdump.raw windows.registry.printkey --key "Software\Microsoft\Windows\CurrentVersion\Run"
步骤 4:分析 Windows 痕迹
Key forensic artifacts and their tools:

Prefetch Files (C:\Windows\Prefetch\):
  Tool: PECmd.exe (Eric Zimmerman)
  Shows: Program execution history with timestamps and run counts
  Command: PECmd.exe -d "C:\Windows\Prefetch" --csv output\

ShimCache (AppCompatCache):
  Tool: AppCompatCacheParser.exe
  Shows: Programs that existed on system (even if deleted)
  Command: AppCompatCacheParser.exe -f SYSTEM --csv output\

AmCache (C:\Windows\appcompat\Programs\Amcache.hve):
  Tool: AmcacheParser.exe
  Shows: Program execution with SHA1 hashes and install timestamps
  Command: AmcacheParser.exe -f Amcache.hve --csv output\

NTFS artifacts ($MFT, $UsnJrnl, $LogFile):
  Tool: MFTECmd.exe
  Shows: Complete file system timeline including deleted files
  Command: MFTECmd.exe -f "$MFT" --csv output\

Event Logs:
  Tool: EvtxECmd.exe
  Shows: Security, System, PowerShell, Sysmon events
  Command: EvtxECmd.exe -d "C:\Windows\System32\winevt\Logs" --csv output\

Registry Hives (SAM, SYSTEM, SOFTWARE, NTUSER.DAT):
  Tool: RECmd.exe with batch files
  Shows: User accounts, services, installed software, USB history
  Command: RECmd.exe -d "C:\Windows\System32\config" --bn BatchExamples\RECmd_Batch_MC.reb --csv output\
步骤 5:重建时间线
# Use KAPE for automated artifact collection
kape.exe --tsource C: --tdest C:\evidence\kape_output \
  --target KapeTriage --module !EZParser

# Create super timeline with plaso/log2timeline
log2timeline.py timeline.plaso disk_image.E01
psort.py -o l2tcsv timeline.plaso -w timeline.csv

# Filter timeline around incident timeframe
psort.py -o l2tcsv timeline.plaso "date > '2026-02-20' AND date < '2026-02-22'" -w filtered_timeline.csv
步骤 6:记录调查结果

取证报告结构:

1. Executive Summary
2. Scope and Methodology
3. Evidence Inventory (with chain of custody)
4. Timeline of Events
5. Findings and Analysis
   - Initial access vector
   - Persistence mechanisms
   - Lateral movement
   - Data access/exfiltration
6. Indicators of Compromise (IOCs)
7. Recommendations
8. Appendices (tool output, hashes, raw evidence)

核心概念

术语定义
易失性顺序证据收集优先级,从最易失(RAM)到最不易失(备份)
监管链从收集到呈交期间对证据处理情况的记录
写保护器用于防止源证据被修改的硬件或软件设备
超级时间线所有痕迹时间戳的汇总时间视图,用于重建事件
Prefetch记录程序执行历史的 Windows 痕迹
ShimCache跟踪程序在终端上是否存在的应用程序兼容性痕迹

工具和系统

  • Volatility 3:用于分析 RAM 转储的内存取证框架
  • KAPE(Kroll Artifact Parser and Extractor):自动化分诊收集与解析工具
  • Eric Zimmerman Tools:Windows 痕迹解析工具套件(PECmd、MFTECmd、RECmd 等)
  • Autopsy/Sleuth Kit:用于文件系统分析的磁盘取证平台
  • FTK Imager:取证映像和内存采集工具
  • Plaso/log2timeline:用于创建超级时间线的框架

常见陷阱

  • 修改实时系统上的证据:分析前务必先创建映像。在实时系统上运行工具会改变时间戳和内存状态。
  • 忘记监管链:缺少监管链文档的证据在法律诉讼中不可采纳。
  • 只分析磁盘而忽略内存:仅驻留于内存的恶意软件(无文件攻击)不会留下磁盘痕迹。务必先采集内存。
  • 未对证据进行哈希处理:所有证据都必须在收集时进行加密哈希,以证明其完整性。
  • 视野狭窄:只关注一种痕迹,而忽视时间线所呈现的更完整情况。务必构建全面的时间线。

评论

支持 Markdown