Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bigsnarfdude/5af050d145550fa92ed9b0d8e8beed09 to your computer and use it in GitHub Desktop.
Save bigsnarfdude/5af050d145550fa92ed9b0d8e8beed09 to your computer and use it in GitHub Desktop.
iocs
Here are some examples of IoCs:
Network IoCs:
Unusual network traffic patterns: Abnormal outbound network traffic, a sudden increase in traffic from a specific IP address, or communication with unknown or malicious domains.
Unusual DNS requests: Requests for known malicious domains or unusual DNS queries.
Mismatched port-application traffic: An application or process communicating over a network port it shouldn't be using.
Host-Based IoCs:
Unauthorized access to system resources: Access to servers, databases, or sensitive data without proper authorization.
Changes to system files or configurations: Unexplained or unauthorized modifications to system configurations or settings.
Unexpected software installations or updates: Unusual or unexpected software being installed or updated on a system.
Suspicious registry changes: Changes to the Windows registry that suggest malicious activity.
@bigsnarfdude
Copy link
Author

MCP Tools for Digital Forensics & IOC Detection

Essential MCP Tools for Incident Response

1. Memory Analysis MCP Tool

{
  "name": "volatility-mcp",
  "description": "Volatility memory analysis integration",
  "functions": [
    {
      "name": "analyze_memory_dump",
      "parameters": {
        "dump_path": "string",
        "analysis_type": "enum[quick_triage, full_analysis, malware_hunt]",
        "output_format": "enum[json, csv, xml]"
      }
    },
    {
      "name": "extract_iocs",
      "parameters": {
        "dump_path": "string",
        "ioc_types": "array[ip, domain, hash, process, registry]"
      }
    },
    {
      "name": "compare_baselines",
      "parameters": {
        "current_dump": "string",
        "baseline_dump": "string"
      }
    }
  ]
}

2. Threat Intelligence MCP Tool

{
  "name": "threat-intel-mcp",
  "description": "Threat intelligence lookup and correlation",
  "functions": [
    {
      "name": "lookup_ioc",
      "parameters": {
        "ioc_value": "string",
        "ioc_type": "enum[ip, domain, hash, url]",
        "sources": "array[virustotal, alienvault, misp]"
      }
    },
    {
      "name": "enrich_iocs",
      "parameters": {
        "ioc_list": "array",
        "include_context": "boolean"
      }
    },
    {
      "name": "check_reputation",
      "parameters": {
        "indicators": "array",
        "confidence_threshold": "number"
      }
    }
  ]
}

3. System Information Collection MCP Tool

{
  "name": "sysinfo-collector-mcp",
  "description": "Live system information collection",
  "functions": [
    {
      "name": "collect_system_info",
      "parameters": {
        "target_system": "string",
        "collection_types": "array[processes, network, files, registry]"
      }
    },
    {
      "name": "capture_memory",
      "parameters": {
        "output_path": "string",
        "compression": "boolean"
      }
    },
    {
      "name": "collect_logs",
      "parameters": {
        "log_sources": "array[windows_events, syslog, application_logs]",
        "time_range": "string"
      }
    }
  ]
}

4. IOC Management MCP Tool

{
  "name": "ioc-manager-mcp",
  "description": "IOC storage, search, and management",
  "functions": [
    {
      "name": "store_ioc",
      "parameters": {
        "ioc_data": "object",
        "tags": "array",
        "confidence": "number"
      }
    },
    {
      "name": "search_iocs",
      "parameters": {
        "query": "string",
        "filters": "object",
        "limit": "number"
      }
    },
    {
      "name": "export_iocs",
      "parameters": {
        "format": "enum[stix, json, csv, yara]",
        "time_range": "string"
      }
    }
  ]
}

5. Evidence Chain MCP Tool

{
  "name": "evidence-chain-mcp",
  "description": "Maintain chain of custody and evidence integrity",
  "functions": [
    {
      "name": "hash_evidence",
      "parameters": {
        "file_path": "string",
        "algorithms": "array[md5, sha1, sha256]"
      }
    },
    {
      "name": "log_access",
      "parameters": {
        "evidence_id": "string",
        "action": "string",
        "operator": "string"
      }
    },
    {
      "name": "verify_integrity",
      "parameters": {
        "evidence_id": "string"
      }
    }
  ]
}

Practical Implementation Examples

Example 1: Automated Memory Analysis

# MCP Tool Implementation
async def analyze_memory_dump(dump_path, analysis_type="quick_triage"):
    """
    Automated memory analysis with IOC extraction
    """
    results = {
        "processes": await run_volatility_plugin("windows.pslist", dump_path),
        "network": await run_volatility_plugin("windows.netscan", dump_path),
        "malware": await run_volatility_plugin("windows.malfind", dump_path)
    }
    
    # Extract IOCs automatically
    iocs = extract_suspicious_indicators(results)
    
    # Enrich with threat intel
    enriched_iocs = await enrich_with_threat_intel(iocs)
    
    return {
        "raw_analysis": results,
        "extracted_iocs": enriched_iocs,
        "summary": generate_analysis_summary(results, enriched_iocs)
    }

Example 2: Claude Code Workflow

# Complex incident response workflow
claude-code --workflow="incident-response" \
  --input="memory_dump.raw" \
  --config="incident_config.json" \
  --output="incident_report.json"

# The workflow would:
# 1. Analyze memory dump using volatility-mcp
# 2. Extract IOCs using ioc-manager-mcp
# 3. Enrich IOCs using threat-intel-mcp
# 4. Generate timeline using evidence-chain-mcp
# 5. Create comprehensive report

Integration Architecture

RAG System Integration

class ForensicsRAG:
    def __init__(self):
        self.mcp_tools = [
            VolatilityMCP(),
            ThreatIntelMCP(),
            IOCManagerMCP(),
            EvidenceChainMCP()
        ]
    
    async def analyze_incident(self, evidence_files):
        # Collect all evidence using MCP tools
        analysis_results = []
        
        for evidence_file in evidence_files:
            result = await self.mcp_tools['volatility'].analyze_memory_dump(
                evidence_file, 
                analysis_type="full_analysis"
            )
            analysis_results.append(result)
        
        # Store in vector database for RAG
        await self.store_analysis_results(analysis_results)
        
        # Generate incident summary
        return await self.generate_incident_report(analysis_results)

Claude Code Integration Points

  1. Automated Triage: Claude Code could automatically run initial analysis on new evidence
  2. Pattern Matching: Use Claude's reasoning to identify complex attack patterns
  3. Report Generation: Create comprehensive incident reports with natural language explanations
  4. Threat Hunting: Generate hypotheses for threat hunting based on initial findings
  5. Playbook Execution: Automatically execute incident response playbooks

POC Implementation Plan

Phase 1: Core MCP Tools

  • Build volatility-mcp tool for memory analysis
  • Create ioc-manager-mcp for IOC storage/search
  • Implement evidence-chain-mcp for integrity tracking

Phase 2: Intelligence Integration

  • Add threat-intel-mcp with multiple sources
  • Implement sysinfo-collector-mcp for live collection
  • Create timeline correlation capabilities

Phase 3: Claude Code Workflows

  • Design incident response workflows
  • Implement automated analysis pipelines
  • Add natural language report generation
  • Create threat hunting automation

Phase 4: Advanced Features

  • Machine learning IOC classification
  • Behavioral analysis capabilities
  • Multi-system correlation
  • Real-time monitoring integration

Benefits of This Approach

For Analysts:

  • Reduced manual analysis time
  • Consistent analysis procedures
  • Automated IOC enrichment
  • Natural language explanations of complex findings

For Organizations:

  • Faster incident response times
  • Better threat intelligence utilization
  • Improved evidence chain of custody
  • Scalable forensic capabilities

For Claude Code:

  • Complex reasoning over forensic data
  • Automated workflow orchestration
  • Natural language interaction with technical tools
  • Continuous learning from new threats

@bigsnarfdude
Copy link
Author

Claude Forensic Workstation Setup Guide

Architecture Overview

┌─────────────────────────────────────────────────────────────┐
│                 Forensic Workstation                        │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ Claude Code │◄─┤ MCP Server  │◄─┤ Forensic Tools      │  │
│  │ CLI Client  │  │ Hub         │  │ • Volatility 3      │  │
│  └─────────────┘  └─────────────┘  │ • YARA              │  │
│         │                          │ • Strings           │  │
│         ▼                          │ • Binwalk           │  │
│  ┌─────────────────────────────────┤ • Custom Scripts    │  │
│  │         Evidence Storage        │ └─────────────────────┘  │
│  │ • Memory Dumps                  │                          │
│  │ • Disk Images                   │ ┌─────────────────────┐  │
│  │ • Network Captures              │ │ Analysis Database   │  │
│  │ • Log Files                     │ │ • IOCs              │  │
│  │ • Metadata                      │ │ • Timeline          │  │
│  └─────────────────────────────────┤ │ • Chain of Custody │  │
│                                    │ │ • Reports           │  │
│                                    │ └─────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Hardware Requirements

Minimum Specs

  • CPU: 8+ cores (memory analysis is CPU intensive)
  • RAM: 32GB+ (need 2x largest memory dump size)
  • Storage: 2TB+ SSD (fast I/O for large dumps)
  • Network: Gigabit+ (for evidence transfer)

Recommended Professional Setup

  • CPU: Intel i9/AMD Ryzen 9 (16+ cores)
  • RAM: 128GB+ DDR4/DDR5
  • Storage:
    • 1TB NVMe SSD (OS and tools)
    • 8TB+ Enterprise SSD (evidence storage)
    • External backup storage
  • GPU: Optional for ML-based analysis

Software Stack Installation

1. Base Operating System

# Ubuntu 22.04 LTS or Windows 11 Pro
# For Ubuntu:
sudo apt update && sudo apt upgrade -y

# Install essential tools
sudo apt install -y python3.11 python3-pip git curl wget \
    build-essential cmake ninja-build pkg-config \
    sqlite3 postgresql-client docker.io docker-compose

2. Python Environment Setup

# Create isolated forensics environment
python3.11 -m venv ~/.forensics-env
source ~/.forensics-env/bin/activate

# Install core dependencies
pip install --upgrade pip setuptools wheel
pip install mcp httpx volatility3 yara-python
pip install pandas numpy matplotlib seaborn
pip install requests beautifulsoup4 lxml

3. Volatility 3 Installation

# Clone and install Volatility 3
git clone https://github.com/volatilityfoundation/volatility3.git
cd volatility3
pip install -e .

# Download symbol tables
mkdir -p ~/.volatility3/symbols
# Download from: https://downloads.volatilityfoundation.org/

4. Claude Code Installation

# Install Claude Code (when available)
curl -fsSL https://anthropic.com/claude-code/install.sh | sh
# Or follow official installation instructions

5. MCP Servers Setup

# Clone the Volatility MCP Server
git clone https://github.com/bornpresident/Volatility-MCP-Server.git
cd Volatility-MCP-Server

# Configure paths
cp config.example.json config.json
# Edit config.json with your paths

Directory Structure

/opt/forensics/
├── evidence/              # Evidence storage
│   ├── case-001/
│   │   ├── memory/        # Memory dumps
│   │   ├── disk/          # Disk images
│   │   ├── network/       # PCAP files
│   │   └── metadata.json  # Case information
│   └── case-002/
├── tools/                 # Forensic tools
│   ├── volatility3/
│   ├── yara-rules/
│   └── custom-scripts/
├── output/                # Analysis results
│   ├── reports/
│   ├── iocs/
│   └── timelines/
├── databases/             # Analysis databases
│   ├── iocs.db
│   ├── cases.db
│   └── threat-intel.db
└── configs/               # Configuration files
    ├── mcp-servers.json
    ├── claude-config.json
    └── workflows/

MCP Server Configuration

Central MCP Hub Configuration

{
  "mcpServers": {
    "volatility": {
      "command": "python",
      "args": ["/opt/forensics/mcp-servers/volatility-server.py"],
      "env": {
        "VOLATILITY_PATH": "/opt/forensics/tools/volatility3",
        "EVIDENCE_PATH": "/opt/forensics/evidence"
      }
    },
    "threat-intel": {
      "command": "python",
      "args": ["/opt/forensics/mcp-servers/threat-intel-server.py"],
      "env": {
        "VT_API_KEY": "${VIRUSTOTAL_API_KEY}",
        "OTX_API_KEY": "${ALIENVAULT_API_KEY}"
      }
    },
    "ioc-manager": {
      "command": "python", 
      "args": ["/opt/forensics/mcp-servers/ioc-server.py"],
      "env": {
        "DB_PATH": "/opt/forensics/databases/iocs.db"
      }
    },
    "evidence-chain": {
      "command": "python",
      "args": ["/opt/forensics/mcp-servers/evidence-server.py"],
      "env": {
        "CHAIN_DB": "/opt/forensics/databases/cases.db"
      }
    }
  }
}

Security Considerations

Air-Gapped Setup (High Security)

# For sensitive cases - no internet access
# Use local threat intel databases
# Manual IOC updates via removable media
# Local documentation and tools only

Network-Connected Setup (Standard)

# Controlled internet access
# Automatic threat intel updates
# Cloud backup capabilities
# Remote collaboration features

Access Controls

# User authentication
sudo adduser forensics-analyst
sudo usermod -aG forensics,docker forensics-analyst

# File permissions
sudo chown -R forensics-analyst:forensics /opt/forensics
sudo chmod -R 750 /opt/forensics/evidence
sudo chmod -R 755 /opt/forensics/tools

Workflow Examples

Case Initialization

# Claude Code workflow
claude-code init-case \
  --case-id "CASE-2025-001" \
  --evidence-files "/import/memory.dmp,/import/disk.e01" \
  --analyst "john.doe" \
  --priority "high"

Automated Analysis

# Natural language analysis
claude-code analyze \
  --case "CASE-2025-001" \
  --query "Perform initial triage on all evidence and identify potential IOCs"

# Specific analysis
claude-code analyze \
  --memory-dump "memory.dmp" \
  --query "Look for signs of APT activity and lateral movement"

Report Generation

# Comprehensive incident report
claude-code report \
  --case "CASE-2025-001" \
  --template "incident-response" \
  --output "/opt/forensics/output/reports/"

Maintenance and Updates

Regular Maintenance

#!/bin/bash
# weekly-maintenance.sh

# Update tools
cd /opt/forensics/tools/volatility3 && git pull
pip install --upgrade volatility3 yara-python

# Update threat intel
python /opt/forensics/scripts/update-threat-intel.py

# Database maintenance
sqlite3 /opt/forensics/databases/iocs.db "VACUUM;"

# Clean temp files
find /tmp -name "vol_*" -mtime +7 -delete

Backup Strategy

# Evidence backup (daily)
rsync -av /opt/forensics/evidence/ /backup/forensics/evidence/

# Database backup (daily)
sqlite3 /opt/forensics/databases/iocs.db ".backup /backup/forensics/db/iocs-$(date +%Y%m%d).db"

# Configuration backup (weekly)
tar -czf /backup/forensics/configs-$(date +%Y%m%d).tar.gz /opt/forensics/configs/

Getting Started Checklist

Initial Setup

  • Install base operating system and updates
  • Configure hardware (adequate RAM, fast storage)
  • Install Python environment and dependencies
  • Install and configure Volatility 3
  • Install Claude Code
  • Clone and configure MCP servers
  • Set up directory structure and permissions
  • Configure threat intelligence API keys
  • Test basic functionality

First Case

  • Initialize case directory structure
  • Import evidence files
  • Run initial Claude Code analysis
  • Verify IOC extraction
  • Test threat intelligence lookup
  • Generate sample report
  • Document lessons learned

Production Readiness

  • Implement backup procedures
  • Configure monitoring and logging
  • Document standard operating procedures
  • Train analysts on Claude Code workflows
  • Establish case review processes
  • Plan maintenance schedules

Cost Considerations

Hardware (One-time)

  • Workstation: $3,000 - $8,000
  • Storage: $500 - $2,000
  • Backup solution: $300 - $1,000

Software (Annual)

  • Claude Code: TBD (when released)
  • Commercial forensic tools: $0 - $5,000
  • Threat intelligence feeds: $1,000 - $10,000
  • Cloud services (if used): $500 - $2,000

Training and Support

  • Analyst training: $2,000 - $5,000
  • Ongoing support: $1,000 - $3,000

This setup creates a powerful, Claude Code-enabled forensic workstation that can dramatically improve incident response capabilities while maintaining proper evidence handling procedures.

@bigsnarfdude
Copy link
Author

Summary: Claude Code for Digital Forensics & IOC Detection

Key Discussion Points

1. Memory Forensics Foundation

  • Volatility 3 as the core memory analysis framework
  • Memory acquisition methods: WinPmem, DumpIt, FTK Imager
  • Analysis techniques: Process analysis, network connections, malware detection, registry examination
  • IOC extraction from memory artifacts for threat hunting

2. Claude Code Integration Strategy

  • Natural language interface to complex forensic tools
  • Automated workflow orchestration instead of manual command sequences
  • Complex pattern recognition across multiple data sources
  • Intelligent correlation of findings with threat intelligence

3. MCP (Model Context Protocol) Tools Architecture

We identified 5 essential MCP tools:

  • volatility-mcp: Memory analysis automation
  • threat-intel-mcp: IOC enrichment and reputation checking
  • ioc-manager-mcp: IOC storage, search, and management
  • sysinfo-collector-mcp: Live system data collection
  • evidence-chain-mcp: Chain of custody and integrity tracking

4. Existing Implementation

  • Found Volatility-MCP-Server project that already bridges Volatility 3 with Claude
  • Provides natural language interface to memory forensics
  • Addresses forensic case backlogs through automation

5. Forensic Workstation Requirements

  • Hardware: 32GB+ RAM, fast SSDs, multi-core CPU
  • Software stack: Python environment, Volatility 3, Claude Code, MCP servers
  • Architecture: Centralized workstation with all tools and evidence access
  • Security: Air-gapped options, proper access controls, backup procedures

Potential Gaps & Missing Elements

Technical Gaps:

  1. Timeline Correlation: How to correlate events across multiple evidence sources (memory, disk, network, logs)
  2. Automated Reporting: Structured incident reports with evidence linking
  3. Case Management: Multi-case tracking, analyst assignment, progress monitoring
  4. Quality Assurance: Validation of automated findings, false positive handling

Integration Gaps:

  1. SIEM Integration: Connecting findings back to security monitoring platforms
  2. Threat Intelligence Platforms: MISP, OpenCTI, commercial TI platform integration
  3. Ticketing Systems: ServiceNow, Jira integration for case tracking
  4. Evidence Management: Integration with existing digital evidence management systems

Operational Gaps:

  1. Scalability: How to handle multiple concurrent investigations
  2. Collaboration: Multi-analyst workflows, knowledge sharing
  3. Training: Analyst onboarding for Claude Code workflows
  4. Compliance: Meeting legal/regulatory requirements for digital evidence

Advanced Capabilities:

  1. Machine Learning: Behavioral analysis, anomaly detection, threat classification
  2. Real-time Monitoring: Live memory analysis during active incidents
  3. Cross-Platform: Linux, macOS memory analysis capabilities
  4. Mobile Forensics: Android/iOS memory analysis integration

Next Steps Recommendations

Phase 1: Foundation (Immediate)

  • Set up forensic workstation with basic specs
  • Install and configure Volatility-MCP-Server
  • Test Claude Code integration with sample memory dumps
  • Document basic workflows and procedures

Phase 2: Enhancement (Short-term)

  • Develop threat-intel-mcp and ioc-manager-mcp tools
  • Add automated IOC extraction and enrichment
  • Implement basic reporting capabilities
  • Create evidence integrity tracking

Phase 3: Integration (Medium-term)

  • Connect to organizational threat intelligence feeds
  • Integrate with existing security tools and workflows
  • Develop advanced correlation capabilities
  • Add multi-case management features

Phase 4: Advanced (Long-term)

  • Machine learning-based threat detection
  • Real-time incident response capabilities
  • Multi-platform forensic support
  • Enterprise-scale deployment

Key Benefits Summary

For Analysts:

  • Reduced learning curve for complex forensic tools
  • Faster investigation times through automation
  • Natural language interaction with technical systems
  • Automated correlation and pattern recognition

For Organizations:

  • Improved incident response times
  • Better utilization of junior staff
  • Consistent analysis procedures
  • Enhanced threat intelligence utilization

For the Forensics Field:

  • Democratization of advanced forensic capabilities
  • Address expert shortage through AI assistance
  • Improved case throughput and backlog reduction
  • Better knowledge retention and sharing

Critical Success Factors

  1. Tool Quality: Reliable MCP implementations that don't introduce errors
  2. Security: Proper evidence handling and chain of custody maintenance
  3. Training: Analysts understanding both capabilities and limitations
  4. Integration: Seamless workflow with existing tools and processes
  5. Validation: Methods to verify automated findings and catch false positives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment