memory-forensics
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesememory-forensics
内存取证
Purpose
用途
This skill enables analysis of volatile memory dumps using tools like Volatility to identify malware, rootkits, and security breaches, supporting digital forensics investigations.
此技能可借助Volatility等工具分析易失性内存转储文件,识别恶意软件、Rootkit和安全漏洞,为数字取证调查提供支持。
When to Use
适用场景
Use this skill during incident response for suspected breaches, when analyzing RAM dumps from compromised systems, or for proactive security assessments on endpoints with potential malware infections.
当响应疑似安全漏洞的事件、分析受感染系统的RAM转储文件,或对可能存在恶意软件感染的端点进行主动安全评估时,可使用此技能。
Key Capabilities
核心功能
- Parse memory dumps to extract processes, network connections, and injected code using Volatility's plugins.
- Detect hidden processes and rootkits via checks for process hollowing or DKOM (Direct Kernel Object Manipulation).
- Analyze hibernation files or pagefiles for artifacts like command history or encryption keys.
- Support for multiple dump formats, including raw, VMware, and crash dumps, with automated profile detection.
- 借助Volatility的插件解析内存转储文件,提取进程、网络连接和注入的代码。
- 通过检查进程空心化或DKOM(直接内核对象操作)来检测隐藏进程和Rootkit。
- 分析休眠文件或页面文件,查找命令历史记录或加密密钥等痕迹。
- 支持多种转储格式(包括原始格式、VMware格式和崩溃转储),并可自动检测系统配置文件。
Usage Patterns
使用模式
Invoke this skill via CLI commands in a Python script or directly in a terminal. Always specify the memory dump file and required plugins. For automation, wrap commands in a function that handles file paths and outputs. Use environment variables for API keys if extending to cloud-based forensics tools.
Example pattern in Python:
python
import subprocess
dump_file = 'memory.dmp'
subprocess.run(['volatility', '-f', dump_file, 'pslist'])可通过Python脚本中的CLI命令或直接在终端中调用此技能。请始终指定内存转储文件和所需插件。如需自动化,可将命令封装在处理文件路径和输出结果的函数中。如果扩展至云取证工具,可使用环境变量存储API密钥。
示例Python代码:
python
import subprocess
dump_file = 'memory.dmp'
subprocess.run(['volatility', '-f', dump_file, 'pslist'])Common Commands/API
常用命令/API
Use Volatility framework commands for core functionality. Set the VOLATILITY_PROFILE env var for profile mismatches, e.g., .
$VOLATILITY_PROFILE=Win7SP1x64- Command: — Identifies the OS profile from the dump.
volatility -f memory.dmp imageinfo- Flags: for file path,
-fto override auto-detection.--profile=Win10x64
- Flags:
- Command: — Scans for injected code or malware hooks.
volatility -f memory.dmp malfind- Example: Pipe output:
volatility -f memory.dmp malfind > malware_output.txt
- Example: Pipe output:
- API Endpoint: If using Volatility3 via Python API, import as , then call
from volatility3.framework import interfacesfor configurations.interfaces.configuration.ConfObject()- Snippet:
python
from volatility3 import framework config = framework.require_plugin('windows').build_configuration() config['primary'] = 'memory.dmp'
- Snippet:
- Config Format: JSON-based, e.g., for custom runs.
{"plugin": "pslist", "dumpfile": "memory.dmp"}
核心功能使用Volatility框架命令实现。若出现配置文件不匹配的情况,可设置VOLATILITY_PROFILE环境变量,例如 。
$VOLATILITY_PROFILE=Win7SP1x64- 命令:— 从转储文件中识别操作系统配置文件。
volatility -f memory.dmp imageinfo- 参数:指定文件路径,
-f覆盖自动检测结果。--profile=Win10x64
- 参数:
- 命令:— 扫描注入的代码或恶意软件钩子。
volatility -f memory.dmp malfind- 示例:将输出导出至文件:
volatility -f memory.dmp malfind > malware_output.txt
- 示例:将输出导出至文件:
- API端点:若通过Python API使用Volatility3,需导入 ,然后调用
from volatility3.framework import interfaces进行配置。interfaces.configuration.ConfObject()- 代码片段:
python
from volatility3 import framework config = framework.require_plugin('windows').build_configuration() config['primary'] = 'memory.dmp'
- 代码片段:
- 配置格式:基于JSON,例如 可用于自定义运行。
{"plugin": "pslist", "dumpfile": "memory.dmp"}
Integration Notes
集成说明
Integrate by installing Volatility via pip (), then call from scripts. For authentication in cloud forensics (e.g., AWS Memory DB analysis), use env vars like and . Ensure the skill runs in a isolated environment to avoid contamination; pass dump files via secure paths. For multi-tool integration, chain with tools like strings or YARA by piping outputs, e.g., .
pip install volatility$AWS_ACCESS_KEY_ID$AWS_SECRET_ACCESS_KEYvolatility -f memory.dmp strings | grep suspicious通过pip安装Volatility()后,即可在脚本中调用此技能。若进行云取证认证(例如AWS Memory DB分析),可使用 和 等环境变量。请确保技能在隔离环境中运行,避免样本污染;通过安全路径传递转储文件。如需多工具集成,可将输出通过管道传递给strings或YARA等工具,例如 。
pip install volatility$AWS_ACCESS_KEY_ID$AWS_SECRET_ACCESS_KEYvolatility -f memory.dmp strings | grep suspiciousError Handling
错误处理
Handle common errors by checking Volatility's exit codes; e.g., if profile not found, use first. For file not found errors, validate paths before running. In scripts, wrap commands in try-except blocks:
imageinfopython
try:
result = subprocess.run(['volatility', '-f', 'memory.dmp', 'pslist'], capture_output=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e.returncode} - {e.stderr.decode()}")Log detailed errors for debugging, and use env var to enable verbose output.
$VOLATILITY_DEBUG=1通过检查Volatility的退出码处理常见错误;例如,若未找到配置文件,应先运行。若出现文件未找到错误,需在运行前验证路径。在脚本中,可将命令包裹在try-except块中:
imageinfopython
try:
result = subprocess.run(['volatility', '-f', 'memory.dmp', 'pslist'], capture_output=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e.returncode} - {e.stderr.decode()}")记录详细错误以便调试,可使用 环境变量启用详细输出。
$VOLATILITY_DEBUG=1Concrete Usage Examples
实际使用示例
- Detect Malware in a Windows Dump: Load a memory dump from a suspected infected machine and scan for anomalies.
- Command:
volatility -f infected.dmp --profile=Win10x64 malfind - Steps: First run to confirm profile, then analyze output for PID and virtual address of suspicious processes.
volatility -f infected.dmp imageinfo
- Command:
- Investigate Rootkit Presence: Analyze a Linux memory dump for hidden kernel modules.
- Command:
volatility -f linux.dmp linux_pslist - Steps: Cross-reference with to spot discrepancies, then use
linux_moduleson flagged addresses for further inspection.strings
- Command:
- 在Windows转储文件中检测恶意软件: 加载疑似感染机器的内存转储文件并扫描异常。
- 命令:
volatility -f infected.dmp --profile=Win10x64 malfind - 步骤:首先运行确认系统配置文件,然后分析输出结果,查找可疑进程的PID和虚拟地址。
volatility -f infected.dmp imageinfo
- 命令:
- 调查Rootkit存在情况: 分析Linux内存转储文件中的隐藏内核模块。
- 命令:
volatility -f linux.dmp linux_pslist - 步骤:将结果与的输出交叉对比以发现差异,然后对标记地址使用
linux_modules工具进行进一步检查。strings
- 命令:
Graph Relationships
关联关系
- Related to: blue-team cluster skills like "incident-response" (depends on outputs) and "threat-intelligence" (provides input data).
- Connected via: tags such as "forensics" and "security", linking to skills like "network-forensics" for comprehensive breach analysis.
- 相关技能:属于蓝队集群技能,例如“事件响应”(依赖此技能的输出)和“威胁情报”(为此技能提供输入数据)。
- 关联标签:通过“取证”和“安全”等标签,与“网络取证”等技能相连,以实现全面的漏洞分析。