Aiwg memory-forensics
Volatility 3 memory forensics workflows covering acquisition with LiME and WinPmem, and structured analysis using Volatility 3 plugin reference
git clone https://github.com/jmagly/aiwg
T=$(mktemp -d) && git clone --depth=1 https://github.com/jmagly/aiwg "$T" && mkdir -p ~/.claude/skills && cp -r "$T/agentic/code/frameworks/forensics-complete/skills/memory-forensics" ~/.claude/skills/jmagly-aiwg-memory-forensics-0a2d56 && rm -rf "$T"
agentic/code/frameworks/forensics-complete/skills/memory-forensics/SKILL.mdmemory-forensics
Guides memory acquisition and analysis for both Linux and Windows targets. Acquisition uses LiME (Linux) or WinPmem (Windows). Analysis uses Volatility 3 with a structured plugin sequence covering process analysis, network connections, injected code detection, and rootkit indicators.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "vol3" / "volatility" → Volatility 3 memory analysis
- "LSASS" → credential extraction analysis
- "memory dump" → volatile memory analysis
Purpose
Memory forensics recovers volatile evidence unavailable on disk: running processes with no on-disk binary, injected shellcode, encryption keys, credential material, and network connections active at time of capture. This skill provides a repeatable acquisition and analysis workflow that produces structured findings from a raw memory image.
Behavior
When triggered, this skill:
-
Determine acquisition path:
- If target OS is Linux: use LiME kernel module
- If target OS is Windows: use WinPmem
- If a memory image path is provided directly: skip acquisition and proceed to analysis
- Verify available disk space at output path before starting acquisition
-
Linux memory acquisition with LiME:
- Identify kernel version:
uname -r - Check for pre-built LiME module matching kernel, or note that one must be compiled:
# Compile LiME against the target kernel headers make -C /lib/modules/$(uname -r)/build M=$(pwd) modules - Load module and write to file (local) or network (to avoid writing to target disk):
# Write to file insmod lime.ko "path=/mnt/evidence/memory.lime format=lime" # Stream over network to examiner host insmod lime.ko "path=tcp:4444 format=lime" # On examiner: nc -l 4444 > memory.lime - Record SHA-256 hash of acquired image immediately after capture
- Unload module:
rmmod lime
- Identify kernel version:
-
Windows memory acquisition with WinPmem:
- Transfer
to target (verify hash before use)winpmem_multi_x64.exe - Acquire to file:
winpmem_multi_x64.exe memory.raw - For large systems, use the
option to produce chunked output--split - Record SHA-256 hash of each output file
- Optionally stream directly to examiner host using WinPmem's network mode
- Transfer
-
Volatility 3 environment setup:
- Verify Volatility 3 is installed:
vol --version - Set image path variable for subsequent commands
- For Linux targets, provide the Volatility 3 ISF (Intermediate Symbol Format) symbol table; generate if not available using
dwarf2json - For Windows targets, Volatility 3 auto-selects symbols from its built-in PDB download capability
- Verify Volatility 3 is installed:
-
Process analysis plugins:
/vol -f <image> windows.pslist
— full process listing with parent relationshipslinux.pslist
/vol -f <image> windows.pstree
— tree view for spotting orphaned processeslinux.pstree
— scan raw memory for EPROCESS structures (finds hidden processes not in list)vol -f <image> windows.psscan- Compare pslist vs psscan output to identify DKOM-hidden processes
-
Code injection and malicious process detection:
— find process memory regions with PAGE_EXECUTE_READWRITE and no backing filevol -f <image> windows.malfind
— DLL list per process; compare against baselinevol -f <image> windows.dlllist --pid <pid>
— open handles including files, registry keys, mutexesvol -f <image> windows.handles --pid <pid>
— memory map for Linux processes; flag rwx anonymous mappingsvol -f <image> linux.proc_maps
-
Network connection analysis:
— active and recently closed TCP/UDP connections with owning processvol -f <image> windows.netstat
— Linux socket statevol -f <image> linux.sockstat- Extract unique remote IPs and ports for IOC enrichment
-
Persistence and rootkit indicators:
— Windows service list including those not in SCMvol -f <image> windows.svcscan
— driver IRP hook detectionvol -f <image> windows.driverirp
— SSDT hook detectionvol -f <image> windows.ssdt
— Linux syscall table hook detectionvol -f <image> linux.check_syscall
— kernel module list integrityvol -f <image> linux.check_modules
-
Credential and artifact extraction:
— extract NTLM hashes from SAM/SYSTEMvol -f <image> windows.hashdump
— LSA secretsvol -f <image> windows.lsadump
— command-line arguments for all processesvol -f <image> windows.cmdline
— file handles in memory (recovers paths of deleted files)vol -f <image> windows.filescan
-
Write findings document:
- Save to
.aiwg/forensics/findings/<hostname>-memory.md - Include: image hash, acquisition metadata, suspicious processes, injection findings, network IOCs, rootkit indicators
- Save to
Usage Examples
Example 1 — Analyze existing image
memory dump analysis /evidence/memory.lime
Example 2 — Full acquisition and analysis
acquire memory from user@compromised-host.example.com
Example 3 — Windows target
memory forensics windows /mnt/evidence/win-memory.raw
Output Locations
- Findings:
.aiwg/forensics/findings/<hostname>-memory.md - Memory image:
(or.aiwg/forensics/evidence/<hostname>-memory.lime
).raw - Image hash:
.aiwg/forensics/evidence/<hostname>-memory.sha256 - Volatility output:
.aiwg/forensics/evidence/<hostname>-volatility/
Configuration
memory_forensics: volatility_path: vol lime_format: lime winpmem_path: winpmem_multi_x64.exe hash_algorithm: sha256 linux_symbol_path: /opt/volatility3/symbols/linux/ malfind_dump_vads: true plugins: windows: - windows.pslist - windows.psscan - windows.pstree - windows.malfind - windows.netstat - windows.svcscan - windows.cmdline - windows.dlllist linux: - linux.pslist - linux.pstree - linux.proc_maps - linux.sockstat - linux.check_syscall - linux.check_modules
References
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/rules/volatility-order.md — Memory is the most volatile artifact; acquire before any disk or log collection
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/rules/evidence-integrity.md — Hash memory image immediately after acquisition; record hash in custody log
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/research-before-decision.md — Verify disk space, kernel version, and tool availability before starting acquisition
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/rules/red-flag-escalation.md — Escalate when malfind, DKOM-hidden processes, or SSDT hooks are found in memory
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/skills/ioc-extraction/SKILL.md — Extract network IOCs from Volatility netstat/sockstat output for cross-referencing