mem-forensics

mem-forensics

Enables AI agents to analyze memory dumps for forensic investigation, leveraging a fast Rust engine and full Volatility3 plugin coverage via the Model Context Protocol.

Category
访问服务器

README

MCP Memory Forensics

Python 3.10+ License: MIT MCP

A high-performance MCP Server for Memory Forensics that enables AI agents to analyze memory dumps through the Model Context Protocol. Built with two-tier architecture combining Rust speed with Volatility3 coverage.

Credits

This project is based on the excellent work by xtk in mem-forensics-mcp. The Rust engine (memoxide) is a modified version of the original implementation.

Features

  • Two-Tier Architecture: Fast Rust engine (memoxide) + Volatility3 fallback for maximum coverage
  • Intelligent Caching: 200-entry cache with LRU eviction (survives until server restart)
  • Auto-Detection: Automatic OS profile detection and plugin name resolution
  • High Performance: Rust native plugins for common operations (3s vs 60s)
  • Full Coverage: Access to available Volatility3 plugins through the Volatility3 API
  • Smart Routing: Automatically selects fastest available engine
  • No Pre-analysis Required: Plugins auto-analyze image if needed

Performance Benchmarks

Tested on Windows crash dump (2GB, ~109 processes):

Operation Rust (Memoxide) Volatility3 Speedup
Analyze Image 3s 60s 20x faster
Process List (pslist) 1.5s 15s 10x faster
Network Scan (netscan) 2s 20s 10x faster

Requirements

  • Python 3.10+
  • Git CLI - used to clone/update the Volatility3 stable branch
  • Rust toolchain (optional, for building memoxide from source)
  • MCP-compatible client (Claude Desktop, VSCode, Cline, etc.)

Installation

1. Configure Volatility3 Source

Volatility3 is loaded from a managed git checkout, not from the pip volatility3 package.

Create .env in the project root:

cp .env.example .env

Default .env:

VOLATILITY3_REPO_URL=https://github.com/volatilityfoundation/volatility3
VOLATILITY3_BRANCH=stable
VOLATILITY3_REPO_PATH=.cache/volatility3
VOLATILITY3_AUTO_UPDATE=true
VOLATILITY3_UPDATE_INTERVAL_SECONDS=86400

2. Install MCP Server

From Source:

git clone https://github.com/jus1-c/mem-forensics-mcp-server.git
cd mem-forensics-mcp-server
pip install -e .

Configuration

Logs are written to mem-forensics-mcp.log in the project/install root, next to .env.

Claude Desktop

Edit claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "mem-forensics": {
      "command": "python",
      "args": ["-m", "mem_forensics_mcp_server"]
    }
  }
}

VSCode (with Cline extension)

Add to your settings:

{
  "mcpServers": {
    "mem-forensics": {
      "command": "python",
      "args": ["-m", "mem_forensics_mcp_server"],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Available Tools

1. memory_analyze_image

Initialize memory image analysis and detect OS profile.

Parameters:

  • image_path: Absolute path to memory dump (required)
  • dtb: Override DTB address (optional, hex string)
  • kernel_base: Override kernel base address (optional, hex string)

Example:

{
  "image_path": "/evidence/memory.raw",
  "dtb": "0x1ad000"
}

2. memory_run_plugin

Run a forensics plugin. Auto-routes to Rust (fast) or Vol3 (fallback).

Parameters:

  • image_path: Absolute path to memory dump (required)
  • plugin: Plugin name - can be short ("pslist") or full ("windows.pslist.PsList")
  • args: List of plugin arguments (optional, e.g., ["--pid", "1234"])
  • filter: Server-side filter string (optional)

Important Notes:

  • Use args parameter for all plugin arguments
  • Output is always JSON-rendered through the Volatility3 API
  • -r json is accepted but ignored for backward compatibility
  • Short plugin names are auto-resolved to full format

Examples:

// List all processes
{
  "image_path": "/evidence/memory.raw",
  "plugin": "pslist"
}

// Dlllist for specific PID
{
  "image_path": "/evidence/memory.raw",
  "plugin": "dlllist",
  "args": ["--pid", "3692"]
}

// Filescan with filter
{
  "image_path": "/evidence/memory.raw",
  "plugin": "filescan",
  "filter": "svchost"
}

// Using full plugin name
{
  "image_path": "/evidence/memory.raw",
  "plugin": "windows.netscan.NetScan"
}

3. memory_list_plugins

List all available plugins from both engines.

Parameters:

  • image_path: Memory dump path (for context)

Returns:

  • 9 Rust plugins (fast)
  • Vol3 plugins discovered from the managed stable checkout (Windows/Linux/Mac/Other)

4. memory_list_sessions

List all active analysis sessions.

Parameters: None

5. memory_get_status

Get server status and engine availability.

Parameters: None

6. memory_list_dumpable_files

List files found in memory using filescan plugin.

Parameters:

  • image_path: Absolute path to memory dump (required)
  • args: Optional args like ["--pid", "1234"]

7. memory_get_tool_help

Get detailed help and examples for any tool.

Parameters:

  • tool_name: Name of tool (e.g., "memory_run_plugin")

Usage Examples

Basic Analysis (Auto-detect)

Please analyze this memory dump and list all processes.
File: /evidence/windows.dmp

The server will:

  1. Auto-analyze the image
  2. Cache the results
  3. Return process list

Process Investigation with PID Filter

Get command line for process ID 1234 from this memory dump.
File: /evidence/malware.dmp
{
  "image_path": "/evidence/malware.dmp",
  "plugin": "cmdline",
  "args": ["--pid", "1234"]
}

Network Analysis

Find all network connections in this memory dump.
File: /evidence/c2.dmp

Code Injection Detection

Scan for injected code (malfind) in this memory dump.
File: /evidence/suspicious.dmp

List Files in Memory

List all files found in memory.
File: /evidence/windows.dmp

Caching System

The server includes an intelligent caching system:

  • Cache Size: 200 entries (configurable)
  • Cache Key: (image_path, plugin, args)
  • Persistence: Cache survives until server restart
  • Auto-Clear: Cache cleared when analyzing new image
  • LRU Eviction: Oldest entries removed when cache is full

Benefits:

  • Second query for same plugin returns instantly
  • No TTL - cache valid until server restart
  • Separate cache per memory dump file

Security Features

  • Path Validation: Only absolute paths allowed
  • Engine Isolation: Rust plugins run in separate subprocess
  • Timeout Protection: 60s timeout for Rust engine calls
  • Size Limits: Configurable response size limits
  • No Secrets: No logging of sensitive memory contents

.env Variables

Variable Description Default
VOLATILITY3_REPO_URL Volatility3 git repository URL https://github.com/volatilityfoundation/volatility3
VOLATILITY3_BRANCH Volatility3 branch to use stable
VOLATILITY3_REPO_PATH Local checkout path, relative to project root if not absolute .cache/volatility3
VOLATILITY3_AUTO_UPDATE Auto-update checkout on startup when due true
VOLATILITY3_UPDATE_INTERVAL_SECONDS Auto-update interval 86400

Architecture

┌─────────────────┐     ┌──────────────────┐     ┌─────────────┐
│   MCP Client    │────▶│  MCP Server      │────▶│  Memoxide   │
│ (Claude/VSCode) │     │  (Python/FastMCP)│     │   (Rust)    │
└─────────────────┘     └──────────────────┘     └─────────────┘
                               │                           │
                               │                    ┌──────┴──────┐
                               │                    │ Memory Dump │
                               │                    └─────────────┘
                               ▼
                        ┌─────────────┐     ┌─────────────┐
                        │    Cache    │────▶│  Volatility3│
                        │ (200 entries)│     │ API Fallback│
                        └─────────────┘     └─────────────┘

Project Structure

mem-forensics-mcp-server/
├── mem_forensics_mcp_server/
│   ├── __init__.py
│   ├── __main__.py              # Entry point
│   ├── server.py                # MCP server with tools
│   ├── config.py                # Configuration
│   ├── core/
│   │   ├── session.py           # Session management
│   │   ├── cache.py             # Plugin result caching
│   │   ├── settings.py          # .env settings loader
│   │   ├── vol3_repo.py         # Managed Volatility3 git checkout
│   │   ├── vol3_api.py          # Vol3 API backend
│   │   └── vol3_cli.py          # Compatibility shim
│   ├── engine/
│   │   ├── memoxide_client.py   # Rust engine client
│   │   └── memoxide/            # Prebuilt binaries
│   │       ├── x86_64/
│   │       └── aarch64/
│   └── utils/
│       └── helpers.py
├── pyproject.toml
├── .env.example
├── README.md
└── .gitignore

Development

Setup Development Environment

pip install -e ".[dev]"

Building Rust Engine

cd mem_forensics_mcp_server/engine/memoxide-src
cargo build --release

Troubleshooting

Memoxide not available

Memoxide requires platform-specific binaries. Prebuilt binaries included for:

  • Windows x86_64
  • Linux x86_64
  • macOS x86_64 & aarch64

To build for other platforms:

cd mem_forensics_mcp_server/engine/memoxide-src
cargo build --release --target <target-triple>

Vol3 plugin requirements not met

Some memory dump formats may not be compatible with certain plugins. Error message will indicate:

  • Translation layer issues (unsupported format)
  • Symbol table issues (missing ISF files)

Timeout errors on large dumps

Rust engine has 60s timeout. For very large dumps, Vol3 fallback will be used automatically.

Plugin argument errors

This means the arguments passed do not match the plugin's Volatility3 requirements. Use memory_get_tool_help for MCP examples or call memory_list_plugins to verify the resolved plugin name.

Recent Updates

v0.1.19

  • Added Volatility3 API backend from managed git stable checkout
  • Added .env-only Volatility3 configuration and auto-update settings
  • ✨ Added intelligent caching system (200 entries)
  • ✨ Auto-plugin name resolution (pslist → windows.pslist.PsList)
  • ✨ Auto-analyze on first plugin call
  • ✨ Simplified args parameter (replaces pid/params)
  • 🔧 Removed memory_dump_process tool
  • 🔧 Improved error handling and logging

License

MIT License - see LICENSE file for details.

Acknowledgments

Support

For issues and feature requests, please use the GitHub issue tracker.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选