memory-forensics by wshobson/agents
npx skills add https://github.com/wshobson/agents --skill memory-forensics用于事件响应和恶意软件分析的全面技术,涵盖从内存转储中获取、分析和提取证据。
# WinPmem (推荐)
winpmem_mini_x64.exe memory.raw
# DumpIt
DumpIt.exe
# Belkasoft RAM Capturer
# 基于图形界面,输出 raw 格式
# Magnet RAM Capture
# 基于图形界面,输出 raw 格式
# LiME (Linux 内存提取器)
sudo insmod lime.ko "path=/tmp/memory.lime format=lime"
# /dev/mem (有限制,需要权限)
sudo dd if=/dev/mem of=memory.raw bs=1M
# /proc/kcore (ELF 格式)
sudo cp /proc/kcore memory.elf
# osxpmem
sudo ./osxpmem -o memory.raw
# MacQuisition (商业软件)
# VMware: .vmem 文件即为原始内存
cp vm.vmem memory.raw
# VirtualBox: 使用调试控制台
vboxmanage debugvm "VMName" dumpvmcore --filename memory.elf
# QEMU
virsh dump <domain> memory.raw --memory-only
# Hyper-V
# 检查点包含内存状态
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 安装 Volatility 3
pip install volatility3
# 安装符号表 (Windows)
# 从 https://downloads.volatilityfoundation.org/volatility3/symbols/ 下载
# 基本用法
vol -f memory.raw <plugin>
# 指定符号路径
vol -f memory.raw -s /path/to/symbols windows.pslist
# 列出进程
vol -f memory.raw windows.pslist
# 进程树 (父子关系)
vol -f memory.raw windows.pstree
# 隐藏进程检测
vol -f memory.raw windows.psscan
# 进程内存转储
vol -f memory.raw windows.memmap --pid <PID> --dump
# 进程环境变量
vol -f memory.raw windows.envars --pid <PID>
# 命令行参数
vol -f memory.raw windows.cmdline
# 网络连接
vol -f memory.raw windows.netscan
# 网络连接状态
vol -f memory.raw windows.netstat
# 每个进程加载的 DLL
vol -f memory.raw windows.dlllist --pid <PID>
# 查找隐藏/注入的 DLL
vol -f memory.raw windows.ldrmodules
# 内核模块
vol -f memory.raw windows.modules
# 模块转储
vol -f memory.raw windows.moddump --pid <PID>
# 检测代码注入
vol -f memory.raw windows.malfind
# VAD (虚拟地址描述符) 分析
vol -f memory.raw windows.vadinfo --pid <PID>
# 转储可疑内存区域
vol -f memory.raw windows.vadyarascan --yara-rules rules.yar
# 列出注册表配置单元
vol -f memory.raw windows.registry.hivelist
# 打印注册表键值
vol -f memory.raw windows.registry.printkey --key "Software\Microsoft\Windows\CurrentVersion\Run"
# 转储注册表配置单元
vol -f memory.raw windows.registry.hivescan --dump
# 扫描文件对象
vol -f memory.raw windows.filescan
# 从内存中转储文件
vol -f memory.raw windows.dumpfiles --pid <PID>
# MFT 分析
vol -f memory.raw windows.mftscan
# 进程列表
vol -f memory.raw linux.pslist
# 进程树
vol -f memory.raw linux.pstree
# Bash 历史记录
vol -f memory.raw linux.bash
# 网络连接
vol -f memory.raw linux.sockstat
# 已加载的内核模块
vol -f memory.raw linux.lsmod
# 挂载点
vol -f memory.raw linux.mount
# 环境变量
vol -f memory.raw linux.envars
# 进程列表
vol -f memory.raw mac.pslist
# 进程树
vol -f memory.raw mac.pstree
# 网络连接
vol -f memory.raw mac.netstat
# 内核扩展
vol -f memory.raw mac.lsmod
# 1. 初始进程概览
vol -f memory.raw windows.pstree > processes.txt
vol -f memory.raw windows.pslist > pslist.txt
# 2. 网络连接
vol -f memory.raw windows.netscan > network.txt
# 3. 检测注入
vol -f memory.raw windows.malfind > malfind.txt
# 4. 分析可疑进程
vol -f memory.raw windows.dlllist --pid <PID>
vol -f memory.raw windows.handles --pid <PID>
# 5. 转储可疑可执行文件
vol -f memory.raw windows.pslist --pid <PID> --dump
# 6. 从转储文件中提取字符串
strings -a pid.<PID>.exe > strings.txt
# 7. YARA 扫描
vol -f memory.raw windows.yarascan --yara-rules malware.yar
# 1. 事件时间线
vol -f memory.raw windows.timeliner > timeline.csv
# 2. 用户活动
vol -f memory.raw windows.cmdline
vol -f memory.raw windows.consoles
# 3. 持久化机制
vol -f memory.raw windows.registry.printkey \
--key "Software\Microsoft\Windows\CurrentVersion\Run"
# 4. 服务
vol -f memory.raw windows.svcscan
# 5. 计划任务
vol -f memory.raw windows.scheduled_tasks
# 6. 最近文件
vol -f memory.raw windows.filescan | grep -i "recent"
// EPROCESS (执行进程)
typedef struct _EPROCESS {
KPROCESS Pcb; // 内核进程块
EX_PUSH_LOCK ProcessLock;
LARGE_INTEGER CreateTime;
LARGE_INTEGER ExitTime;
// ...
LIST_ENTRY ActiveProcessLinks; // 双向链表
ULONG_PTR UniqueProcessId; // PID
// ...
PEB* Peb; // 进程环境块
// ...
} EPROCESS;
// PEB (进程环境块)
typedef struct _PEB {
BOOLEAN InheritedAddressSpace;
BOOLEAN ReadImageFileExecOptions;
BOOLEAN BeingDebugged; // 反调试检查
// ...
PVOID ImageBaseAddress; // 可执行文件基地址
PPEB_LDR_DATA Ldr; // 加载器数据 (DLL 列表)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
// ...
} PEB;
typedef struct _MMVAD {
MMVAD_SHORT Core;
union {
ULONG LongFlags;
MMVAD_FLAGS VadFlags;
} u;
// ...
PVOID FirstPrototypePte;
PVOID LastContiguousPte;
// ...
PFILE_OBJECT FileObject;
} MMVAD;
// 内存保护标志
#define PAGE_EXECUTE 0x10
#define PAGE_EXECUTE_READ 0x20
#define PAGE_EXECUTE_READWRITE 0x40
#define PAGE_EXECUTE_WRITECOPY 0x80
# Malfind 指标
# - PAGE_EXECUTE_READWRITE 保护 (可疑)
# - 非镜像 VAD 区域中的 MZ 头
# - 分配起始处的 Shellcode 模式
# 常见注入技术
# 1. 经典 DLL 注入
# - VirtualAllocEx + WriteProcessMemory + CreateRemoteThread
# 2. 进程镂空
# - CreateProcess (SUSPENDED) + NtUnmapViewOfSection + WriteProcessMemory
# 3. APC 注入
# - QueueUserAPC 针对可警告线程
# 4. 线程执行劫持
# - SuspendThread + SetThreadContext + ResumeThread
# 比较进程列表
vol -f memory.raw windows.pslist > pslist.txt
vol -f memory.raw windows.psscan > psscan.txt
diff pslist.txt psscan.txt # 隐藏进程
# 检查 DKOM (直接内核对象操作)
vol -f memory.raw windows.callbacks
# 检测挂钩函数
vol -f memory.raw windows.ssdt # 系统服务描述符表
# 驱动程序分析
vol -f memory.raw windows.driverscan
vol -f memory.raw windows.driverirp
# 转储哈希值 (需要先获取 hivelist)
vol -f memory.raw windows.hashdump
# LSA 密钥
vol -f memory.raw windows.lsadump
# 缓存的域凭据
vol -f memory.raw windows.cachedump
# Mimikatz 风格提取
# 需要特定插件/工具
rule Suspicious_Injection
{
meta:
description = "检测常见注入 shellcode"
strings:
// 常见 shellcode 模式
$mz = { 4D 5A }
$shellcode1 = { 55 8B EC 83 EC } // 函数序言
$api_hash = { 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? E8 } // 推送哈希,调用
condition:
$mz at 0 or any of ($shellcode*)
}
rule Cobalt_Strike_Beacon
{
meta:
description = "检测内存中的 Cobalt Strike beacon"
strings:
$config = { 00 01 00 01 00 02 }
$sleep = "sleeptime"
$beacon = "%s (admin)" wide
condition:
2 of them
}
# 扫描所有进程内存
vol -f memory.raw windows.yarascan --yara-rules rules.yar
# 扫描特定进程
vol -f memory.raw windows.yarascan --yara-rules rules.yar --pid 1234
# 扫描内核内存
vol -f memory.raw windows.yarascan --yara-rules rules.yar --kernel
# 基本字符串提取
strings -a memory.raw > all_strings.txt
# Unicode 字符串
strings -el memory.raw >> all_strings.txt
# 从进程转储中定向提取
vol -f memory.raw windows.memmap --pid 1234 --dump
strings -a pid.1234.dmp > process_strings.txt
# 模式匹配
grep -E "(https?://|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})" all_strings.txt
# FLOSS 提取混淆字符串
floss malware.exe > floss_output.txt
# 从内存转储中提取
floss pid.1234.dmp
每周安装
3.5K
代码仓库
GitHub 星标
32.2K
首次出现
Jan 20, 2026
安全审计
安装于
claude-code2.7K
gemini-cli2.7K
opencode2.7K
cursor2.6K
codex2.6K
github-copilot2.3K
Comprehensive techniques for acquiring, analyzing, and extracting artifacts from memory dumps for incident response and malware analysis.
# WinPmem (Recommended)
winpmem_mini_x64.exe memory.raw
# DumpIt
DumpIt.exe
# Belkasoft RAM Capturer
# GUI-based, outputs raw format
# Magnet RAM Capture
# GUI-based, outputs raw format
# LiME (Linux Memory Extractor)
sudo insmod lime.ko "path=/tmp/memory.lime format=lime"
# /dev/mem (limited, requires permissions)
sudo dd if=/dev/mem of=memory.raw bs=1M
# /proc/kcore (ELF format)
sudo cp /proc/kcore memory.elf
# osxpmem
sudo ./osxpmem -o memory.raw
# MacQuisition (commercial)
# VMware: .vmem file is raw memory
cp vm.vmem memory.raw
# VirtualBox: Use debug console
vboxmanage debugvm "VMName" dumpvmcore --filename memory.elf
# QEMU
virsh dump <domain> memory.raw --memory-only
# Hyper-V
# Checkpoint contains memory state
# Install Volatility 3
pip install volatility3
# Install symbol tables (Windows)
# Download from https://downloads.volatilityfoundation.org/volatility3/symbols/
# Basic usage
vol -f memory.raw <plugin>
# With symbol path
vol -f memory.raw -s /path/to/symbols windows.pslist
# List processes
vol -f memory.raw windows.pslist
# Process tree (parent-child relationships)
vol -f memory.raw windows.pstree
# Hidden process detection
vol -f memory.raw windows.psscan
# Process memory dumps
vol -f memory.raw windows.memmap --pid <PID> --dump
# Process environment variables
vol -f memory.raw windows.envars --pid <PID>
# Command line arguments
vol -f memory.raw windows.cmdline
# Network connections
vol -f memory.raw windows.netscan
# Network connection state
vol -f memory.raw windows.netstat
# Loaded DLLs per process
vol -f memory.raw windows.dlllist --pid <PID>
# Find hidden/injected DLLs
vol -f memory.raw windows.ldrmodules
# Kernel modules
vol -f memory.raw windows.modules
# Module dumps
vol -f memory.raw windows.moddump --pid <PID>
# Detect code injection
vol -f memory.raw windows.malfind
# VAD (Virtual Address Descriptor) analysis
vol -f memory.raw windows.vadinfo --pid <PID>
# Dump suspicious memory regions
vol -f memory.raw windows.vadyarascan --yara-rules rules.yar
# List registry hives
vol -f memory.raw windows.registry.hivelist
# Print registry key
vol -f memory.raw windows.registry.printkey --key "Software\Microsoft\Windows\CurrentVersion\Run"
# Dump registry hive
vol -f memory.raw windows.registry.hivescan --dump
# Scan for file objects
vol -f memory.raw windows.filescan
# Dump files from memory
vol -f memory.raw windows.dumpfiles --pid <PID>
# MFT analysis
vol -f memory.raw windows.mftscan
# Process listing
vol -f memory.raw linux.pslist
# Process tree
vol -f memory.raw linux.pstree
# Bash history
vol -f memory.raw linux.bash
# Network connections
vol -f memory.raw linux.sockstat
# Loaded kernel modules
vol -f memory.raw linux.lsmod
# Mount points
vol -f memory.raw linux.mount
# Environment variables
vol -f memory.raw linux.envars
# Process listing
vol -f memory.raw mac.pslist
# Process tree
vol -f memory.raw mac.pstree
# Network connections
vol -f memory.raw mac.netstat
# Kernel extensions
vol -f memory.raw mac.lsmod
# 1. Initial process survey
vol -f memory.raw windows.pstree > processes.txt
vol -f memory.raw windows.pslist > pslist.txt
# 2. Network connections
vol -f memory.raw windows.netscan > network.txt
# 3. Detect injection
vol -f memory.raw windows.malfind > malfind.txt
# 4. Analyze suspicious processes
vol -f memory.raw windows.dlllist --pid <PID>
vol -f memory.raw windows.handles --pid <PID>
# 5. Dump suspicious executables
vol -f memory.raw windows.pslist --pid <PID> --dump
# 6. Extract strings from dumps
strings -a pid.<PID>.exe > strings.txt
# 7. YARA scanning
vol -f memory.raw windows.yarascan --yara-rules malware.yar
# 1. Timeline of events
vol -f memory.raw windows.timeliner > timeline.csv
# 2. User activity
vol -f memory.raw windows.cmdline
vol -f memory.raw windows.consoles
# 3. Persistence mechanisms
vol -f memory.raw windows.registry.printkey \
--key "Software\Microsoft\Windows\CurrentVersion\Run"
# 4. Services
vol -f memory.raw windows.svcscan
# 5. Scheduled tasks
vol -f memory.raw windows.scheduled_tasks
# 6. Recent files
vol -f memory.raw windows.filescan | grep -i "recent"
// EPROCESS (Executive Process)
typedef struct _EPROCESS {
KPROCESS Pcb; // Kernel process block
EX_PUSH_LOCK ProcessLock;
LARGE_INTEGER CreateTime;
LARGE_INTEGER ExitTime;
// ...
LIST_ENTRY ActiveProcessLinks; // Doubly-linked list
ULONG_PTR UniqueProcessId; // PID
// ...
PEB* Peb; // Process Environment Block
// ...
} EPROCESS;
// PEB (Process Environment Block)
typedef struct _PEB {
BOOLEAN InheritedAddressSpace;
BOOLEAN ReadImageFileExecOptions;
BOOLEAN BeingDebugged; // Anti-debug check
// ...
PVOID ImageBaseAddress; // Base address of executable
PPEB_LDR_DATA Ldr; // Loader data (DLL list)
PRTL_USER_PROCESS_PARAMETERS ProcessParameters;
// ...
} PEB;
typedef struct _MMVAD {
MMVAD_SHORT Core;
union {
ULONG LongFlags;
MMVAD_FLAGS VadFlags;
} u;
// ...
PVOID FirstPrototypePte;
PVOID LastContiguousPte;
// ...
PFILE_OBJECT FileObject;
} MMVAD;
// Memory protection flags
#define PAGE_EXECUTE 0x10
#define PAGE_EXECUTE_READ 0x20
#define PAGE_EXECUTE_READWRITE 0x40
#define PAGE_EXECUTE_WRITECOPY 0x80
# Malfind indicators
# - PAGE_EXECUTE_READWRITE protection (suspicious)
# - MZ header in non-image VAD region
# - Shellcode patterns at allocation start
# Common injection techniques
# 1. Classic DLL Injection
# - VirtualAllocEx + WriteProcessMemory + CreateRemoteThread
# 2. Process Hollowing
# - CreateProcess (SUSPENDED) + NtUnmapViewOfSection + WriteProcessMemory
# 3. APC Injection
# - QueueUserAPC targeting alertable threads
# 4. Thread Execution Hijacking
# - SuspendThread + SetThreadContext + ResumeThread
# Compare process lists
vol -f memory.raw windows.pslist > pslist.txt
vol -f memory.raw windows.psscan > psscan.txt
diff pslist.txt psscan.txt # Hidden processes
# Check for DKOM (Direct Kernel Object Manipulation)
vol -f memory.raw windows.callbacks
# Detect hooked functions
vol -f memory.raw windows.ssdt # System Service Descriptor Table
# Driver analysis
vol -f memory.raw windows.driverscan
vol -f memory.raw windows.driverirp
# Dump hashes (requires hivelist first)
vol -f memory.raw windows.hashdump
# LSA secrets
vol -f memory.raw windows.lsadump
# Cached domain credentials
vol -f memory.raw windows.cachedump
# Mimikatz-style extraction
# Requires specific plugins/tools
rule Suspicious_Injection
{
meta:
description = "Detects common injection shellcode"
strings:
// Common shellcode patterns
$mz = { 4D 5A }
$shellcode1 = { 55 8B EC 83 EC } // Function prologue
$api_hash = { 68 ?? ?? ?? ?? 68 ?? ?? ?? ?? E8 } // Push hash, call
condition:
$mz at 0 or any of ($shellcode*)
}
rule Cobalt_Strike_Beacon
{
meta:
description = "Detects Cobalt Strike beacon in memory"
strings:
$config = { 00 01 00 01 00 02 }
$sleep = "sleeptime"
$beacon = "%s (admin)" wide
condition:
2 of them
}
# Scan all process memory
vol -f memory.raw windows.yarascan --yara-rules rules.yar
# Scan specific process
vol -f memory.raw windows.yarascan --yara-rules rules.yar --pid 1234
# Scan kernel memory
vol -f memory.raw windows.yarascan --yara-rules rules.yar --kernel
# Basic string extraction
strings -a memory.raw > all_strings.txt
# Unicode strings
strings -el memory.raw >> all_strings.txt
# Targeted extraction from process dump
vol -f memory.raw windows.memmap --pid 1234 --dump
strings -a pid.1234.dmp > process_strings.txt
# Pattern matching
grep -E "(https?://|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})" all_strings.txt
# FLOSS extracts obfuscated strings
floss malware.exe > floss_output.txt
# From memory dump
floss pid.1234.dmp
Weekly Installs
3.5K
Repository
GitHub Stars
32.2K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code2.7K
gemini-cli2.7K
opencode2.7K
cursor2.6K
codex2.6K
github-copilot2.3K
网站审计工具 - 使用 squirrelscan CLI 全面检测 SEO、性能、安全及技术问题
39,100 周安装
AI智能体长期记忆系统 - 精英级架构,融合6种方法,永不丢失上下文
1,200 周安装
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装
Word文档处理器:DOCX创建、编辑、分析与修订痕迹处理全指南 | 自动化办公解决方案
1,200 周安装
React Router 框架模式指南:全栈开发、文件路由、数据加载与渲染策略
1,200 周安装
Nano Banana AI 图像生成工具:使用 Gemini 3 Pro 生成与编辑高分辨率图像
1,200 周安装
SVG Logo Designer - AI 驱动的专业矢量标识设计工具,生成可缩放品牌标识
1,200 周安装