tasox/triage-llm-lab

GitHub: tasox/triage-llm-lab

一个基于 Claude Code 和多虚拟机隔离沙箱的 AI 编排式恶意软件分析实验室,通过 MCP 协议整合 REMnux、SIFT、Ghidra 和 VirusTotal 实现自动化静态与取证分析。

Stars: 0 | Forks: 0

# AI 驱动的恶意软件分析实验室 — 安装指南 一个包含四台虚拟机的隔离沙箱,将 Claude Code 与 REMnux 分析工具、SIFT 取证工作站、GhidraMCP 无头反编译和 VirusTotal 情报相结合 —— 所有这些都通过干净的 Ubuntu 宿主机上的 MCP 服务器进行编排。 | | | |---|---| | **Hypervisor** | VMware Workstation / Fusion | | **VMs** | Ubuntu + REMnux + SIFT + Windows(未来支持) | | **LLM** | Claude Code | ## 目录 1. [实验室架构](#01-lab-architecture) 2. [前置条件](#02-prerequisites) 3. [VM1 — Ubuntu 24.04 (LLM 宿主机)](#03-vm1--ubuntu-2404-llm-host) 4. [VM2 — REMnux (分析机)](#04-vm2--remnux-analysis-machine) 5. [VM3 — SIFT Workstation (取证)](#05-vm3--sift-workstation-forensics) 6. [网络配置](#06-network-configuration) 7. [SSH 密钥设置](#07-ssh-key-setup) 8. [remnux-ssh MCP Server](#08-remnux-ssh-mcp-server) 9. [VirusTotal MCP Server](#09-virustotal-mcp-server) 10. [Ghidra MCP (Docker 无头模式)](#10-ghidra-mcp-docker-headless) 11. [sift-ssh MCP Server](#11-sift-ssh-mcp-server) 12. [REMnux 分析工具](#12-remnux-analysis-tools) 13. [SIFT 取证工具](#13-sift-forensic-tools) 14. [MCP 工具组](#14-mcp-tool-groups) 15. [分析工作流](#15-analysis-workflows) 16. [故障排除](#16-troubleshooting) 17. [安全说明](#17-security-notes) ## 01. 实验室架构 四台具有严格网络隔离的虚拟机。只有 VM1 具有互联网访问权限。样本绝不会接触到 LLM 宿主机。 ``` 🌐 Internet / Anthropic API │ ┌──────────────────┐ SSH / Host-only ┌──────────────────────┐ │ VM1 │ 192.168.56.0/24 │ VM2 │ │ Ubuntu 24.04 │ ───────────────────► │ REMnux │ │ Claude Code + │ │ Static Analysis + │ │ MCP Servers │ │ Ghidra │ │ NAT + Host-only │ │ Host-only · .56.20 │ │ .56.10 │ └──────────────────────┘ │ │ ┌──────────────────────┐ │ │ ───────────────────► │ VM3 │ │ │ │ SIFT Workstation │ │ │ │ Disk / Memory / Timeline│ │ │ │ Host-only · .56.30 │ │ │ └──────────────────────┘ │ │ ┌──────────────────────┐ │ │ ───────────────────► │ VM4 │ │ │ │ Windows 10 │ │ │ │ Dynamic Analysis + │ │ │ │ x64dbg │ └──────────────────┘ │ Host-only · .56.40 │ │ (future) │ └──────────────────────┘ ``` | VM | 操作系统 | 角色 | IP | 互联网 | |----|----|------|----|----------| | `VM1` | Ubuntu 24.04 LTS | Claude Code + MCP 编排宿主机 | `192.168.56.10` | ✅ 是 | | `VM2` | REMnux (基于 Ubuntu) | 静态分析、Ghidra、去混淆、恶意软件分类 | `192.168.56.20` | ❌ 否 | | `VM3` | SIFT Workstation (Ubuntu 22.04) | 磁盘取证、内存分析、时间线、注册表 | `192.168.56.30` | ❌ 否 | | `VM4` | Windows 10 | 动态分析、x64dbg 调试、FLARE-VM | `192.168.56.40` | 🔶 未来支持 | ## 02. 前置条件 在配置网络之前下载所有内容。所有虚拟机都需要互联网来安装软件包 —— 在切换到 Host-Only 模式之前完成所有安装。 ### 宿主机要求 | 资源 | 最低配置 | 推荐配置 | |----------|---------|-------------| | 内存 | 16 GB | 32 GB | | 存储 | 150 GB 可用空间 | 300 GB SSD | | CPU | 4 核 | 8 核,支持 VT-x | | Hypervisor | VMware Workstation Pro / Fusion | VMware Workstation Pro / Fusion | ### 所需下载 - [ ] **Ubuntu 24.04 LTS ISO** — [ubuntu.com/download](https://ubuntu.com/download/desktop) — 用于 VM1 - [ ] **REMnux OVA** — [remnux.org](https://remnux.org) — 预构建的分析虚拟机 - [ ] **SIFT Workstation OVA** — [sans.org/tools/sift-workstation](https://www.sans.org/tools/sift-workstation) — 需要免费的 SANS 账户。默认登录:`sansforensics` / `forensics` - [ ] **VMware Workstation / Fusion** — [vmware.com](https://www.vmware.com) - [ ] **Anthropic 账户**,需订阅 Claude Pro、Max、Team 或 Enterprise - [ ] **VirusTotal API key** — 推荐使用 Premium 以进行文件下载 — [virustotal.com](https://www.virustotal.com) ### VM 分配 | VM | 内存 | vCPU | 磁盘 | 状态 | |----|-----|------|------|--------| | VM1 — Ubuntu 24.04 | 4 GB | 2 | 40 GB | ✅ 启用 | | VM2 — REMnux | 4 GB | 2 | 60 GB | ✅ 启用 | | VM3 — SIFT Workstation | 4 GB | 2 | 80 GB | ✅ 启用 | | VM4 — Windows 10 | 4 GB | 2 | 80 GB | 🔶 未来支持 | ## 03. VM1 — Ubuntu 24.04 (LLM 宿主机) 安装 Ubuntu 24.04,然后安装 Claude Code 和所有 MCP 服务器依赖项。在本节中,请保持 VM1 处于 NAT 模式。 ### 步骤 1 — 系统更新 ``` sudo apt update && sudo apt upgrade -y sudo apt install -y curl git build-essential python3 python3-pip zip unzip ``` ### 步骤 2 — 安装 Claude Code ``` # 通过原生安装程序安装 Claude Code curl -fsSL https://claude.ai/install.sh | bash # 验证 claude --version claude doctor ``` ### 步骤 3 — 认证 Claude Code ``` # 启动 Claude — 按照设备代码提示操作 claude # 1. 选择“使用 Claude.ai 登录” # 2. 在浏览器中打开显示的 URL # 3. 输入设备代码并登录 ``` ### 步骤 4 — 安装 Node.js 20 ``` curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs node --version # v20.x.x npm --version ``` ### 步骤 5 — 安全存储 API Keys ``` mkdir -p ~/.config/malware-lab cat > ~/.config/malware-lab/secrets.env << 'EOF' VIRUSTOTAL_API_KEY=paste_your_vt_key_here EOF chmod 600 ~/.config/malware-lab/secrets.env echo 'source ~/.config/malware-lab/secrets.env' >> ~/.bashrc source ~/.bashrc ``` ### 步骤 6 — 创建工作目录和 CLAUDE.md ``` mkdir -p ~/malware-analysis ~/downloads cat > ~/malware-analysis/CLAUDE.md << 'EOF' # Malware Analysis Lab ## 启动 At the start of every session, list all available tools grouped by category: 1. remnux-ssh MCP tools grouped by [CATEGORY] tag 2. sift-ssh MCP tools grouped by [CATEGORY] tag 3. virustotal MCP tools with a short description of each Then wait for the next instruction. ## VMs - VM1 Ubuntu: 192.168.56.10 — this machine (Claude Code + MCP host) - VM2 REMnux: 192.168.56.20 — static analysis, Ghidra - VM3 SIFT: 192.168.56.30 — disk/memory/timeline forensics ## SSH Keys 与命令 - ~/.ssh/remnux_key → VM2: ssh -i ~/.ssh/remnux_key remnux@192.168.56.20 - ~/.ssh/sift_key → VM3: ssh -i ~/.ssh/sift_key sansforensics@192.168.56.30 ## MCP Servers - remnux-ssh → static analysis tools on REMnux - sift-ssh → forensic tools on SIFT - virustotal → hash lookups, detections, sample downloads (password: infected) - ghidra-mcp → NOT used directly; use remnux-ssh ghidra_* tools instead ## 样本传输 scp -i ~/.ssh/remnux_key remnux@192.168.56.20:/home/remnux/intake/ scp -i ~/.ssh/sift_key sansforensics@192.168.56.30:/cases/ ## 目录 — REMnux (VM2) - Intake: /home/remnux/intake/ - Samples: /home/remnux/samples/ - Ghidra container maps /home/remnux/samples/ → /data/ ## 目录 — SIFT (VM3) - Evidence: /cases/ Memory: /cases/*.dmp Disk: /cases/*.dd ## Malware Analysis Workflow (REMnux) 1. Download via virustotal MCP → ~/downloads/sample.zip 2. Transfer: scp -i ~/.ssh/remnux_key ~/downloads/sample.zip remnux@192.168.56.20:/home/remnux/intake/ 3. Unzip: remnux-ssh intake_sample (default password: infected) 4. Triage: triage_* tool based on file type 5. Deep analysis: ghidra_load_sample → ghidra_* tools 6. Intelligence: virustotal get_file_report ## Forensic Workflow (SIFT) 1. Transfer evidence: scp -i ~/.ssh/sift_key sansforensics@192.168.56.30:/cases/ 2. Hash: sift-ssh hash_file 3. Memory: sift-ssh triage_memory 4. Disk: sift-ssh triage_disk 5. Timeline: timeline_create → timeline_filter → timeline_search 6. Registry: registry_analyze ## Ghidra Headless Server (通过 remnux-ssh) - Auth: Authorization: Bearer ghidra-lab-token - Load PE/ELF: ghidra_load_sample with path only (auto-detects) - Load shellcode/raw: ghidra_load_sample with path + language - x86 64-bit: x86:LE:64:default - x86 32-bit: x86:LE:32:default - ARM 32-bit: ARM:LE:32:v8 - ARM 64-bit: AARCH64:LE:64:v8A - After raw blobs: call ghidra_run_analysis with entry_offset=0x0 - Workflow: ghidra_load_sample → ghidra_run_analysis → ghidra_list_functions → ghidra_decompile - Path mapping: /home/remnux/samples/ → /data/ (handled automatically by ghidra-post.sh) ## 规则 - Never store or execute samples on VM1 - Samples only live in /home/remnux/samples/ on REMnux - Evidence only in /cases/ on SIFT - Always revert REMnux snapshot after analysis EOF ``` ### 步骤 7 — 创建 `lab` 快捷方式 添加一个 shell 函数,用于在启动时列出所有工具并启动 Claude。 ``` cat >> ~/.bashrc << 'EOF' lab() { cd ~/malware-analysis echo "Loading malware analysis lab..." claude "Show all available tools for this malware analysis lab grouped by category: 1. List all tools from remnux-ssh MCP grouped by their [CATEGORY] tag 2. List all tools from sift-ssh MCP grouped by their [CATEGORY] tag 3. List all tools from virustotal MCP with a short description of each After showing the full list, wait for my next instruction." } EOF source ~/.bashrc ``` ## 04. VM2 — REMnux (分析机) 导入 REMnux OVA,在 NAT 处于活动状态时安装所有工具,然后切换到 Host-Only 模式。在更改网络适配器之前完成所有步骤。 ### 步骤 1 — 导入 REMnux OVA 在 VMware 中:**File → Open** → 选择 REMnux `.ova` → Import。分配 4 GB 内存,2 个 vCPU。 ### 步骤 2 — 安装 SSH Server ``` sudo apt update sudo apt install -y openssh-server sudo systemctl enable ssh && sudo systemctl start ssh sudo ss -tlnp | grep 22 # verify listening ``` ### 步骤 3 — 安装额外的分析工具 ``` # Python 工具 pip3 install vipermonkey uncompyle6 dnfile pefile blint --break-system-packages # JavaScript 反混淆 npm install -g synchrony js-beautify # Go runtime(用于 Go 二进制分析) sudo apt install -y golang-go # 验证关键工具 which olevba oleid mraptor diec floss capa which readelf objdump nm binwalk exiftool which js-beautify synchrony cfr procyon javap /usr/local/jadx/bin/jadx --version go version blint --version 2>/dev/null || echo "blint installed as Python package" ``` ### 步骤 4 — 安装 Docker(用于 Ghidra MCP) ``` docker --version # Docker is typically pre-installed on REMnux # 如果未安装: sudo apt install -y docker.io sudo systemctl enable docker sudo usermod -aG docker $USER && newgrp docker ``` ### 步骤 5 — 创建样本目录 ``` mkdir -p /home/remnux/samples /home/remnux/intake /home/remnux/ghidra-scripts ``` ## 05. VM3 — SIFT Workstation (取证) 导入 SIFT OVA,在 NAT 处于活动状态时安装额外工具,配置静态 IP,然后切换到 Host-Only 模式。默认凭据:`sansforensics` / `forensics`。 ### 步骤 1 — 启用从宿主机的复制/粘贴 在 VMware 中:**VM → Settings → Options → Guest Isolation** → 启用*“Allow copy and paste”*。然后: ``` sudo apt install -y open-vm-tools open-vm-tools-desktop sudo systemctl restart open-vm-tools sudo reboot ``` ### 步骤 2 — 安装 SSH Server ``` sudo apt update sudo apt install -y openssh-server sudo systemctl enable ssh && sudo systemctl start ssh sudo ss -tlnp | grep 22 ``` ### 步骤 3 — 安装额外的取证工具 ``` sudo apt update sudo apt install -y sleuthkit yara python3-yara \ dcfldd hashdeep ssdeep exiftool \ libewf2t64 afflib-tools git python3-pip # Python 取证库 pip3 install python-registry construct dissect.cstruct \ --break-system-packages 2>&1 | tail -3 # 验证关键工具 vol -h 2>/dev/null | head -2 # Volatility3 which fls icat fsstat mmls # Sleuth Kit which log2timeline.py psteal.py # Plaso which rip.pl bulk_extractor foremost dcfldd ssdeep yara ``` ### 步骤 4 — 创建 Cases 目录 ``` sudo mkdir -p /cases /cases/carved /cases/dumps /cases/recovered sudo chown -R sansforensics:sansforensics /cases ``` ### 步骤 5 — 设置静态 IP ``` # 首先检查接口名称 ip a | grep -E "^[0-9]+:" | grep -v lo # 编写 netplan 配置(使用 tee — SIFT 上未安装 nano) sudo tee /etc/netplan/01-network-manager-all.yaml << 'EOF' network: version: 2 ethernets: ens33: dhcp4: no addresses: [192.168.56.30/24] EOF sudo netplan apply ip a | grep 192.168.56.30 # verify ``` ## 06. 网络配置 在 VM1 和 VM2 上配置 VMware 适配器和静态 IP。在所有工具安装完成后执行此操作。 ### VMware 适配器配置 | VM | 适配器 1 | 适配器 2 | |----|-----------|-----------| | VM1 — Ubuntu | NAT — 互联网访问 | Host-Only VMnet1 — 实验室网络 | | VM2 — REMnux | Host-Only VMnet1 — 仅限实验室网络 | — | | VM3 — SIFT | Host-Only VMnet1 — 仅限实验室网络 | — | ### VM1 (Ubuntu) 上的静态 IP ``` # 查找接口名称(寻找第二个适配器,而不是 NAT 适配器) ip a sudo nano /etc/netplan/01-network-manager-all.yaml ``` `/etc/netplan/01-network-manager-all.yaml` (VM1): ``` network: version: 2 ethernets: ens33: # NAT adapter — keep as DHCP dhcp4: true ens36: # Host-only adapter — static IP dhcp4: no addresses: [192.168.56.10/24] ``` ``` sudo netplan apply ``` ### VM2 (REMnux) 上的静态 IP `/etc/netplan/01-network-manager-all.yaml` (VM2): ``` network: version: 2 ethernets: ens33: dhcp4: no addresses: [192.168.56.20/24] ``` ``` sudo netplan apply ping -c 3 192.168.56.10 # test VM1 reachability ``` ## 07. SSH 密钥设置 在 VM1 上为 REMnux 和 SIFT 生成 SSH 密钥。这是 MCP 服务器进行通信所必需的。 **1. 在 VM1 上生成密钥** ``` ssh-keygen -t ed25519 -f ~/.ssh/remnux_key -N "" -C "vm1-to-remnux" ssh-keygen -t ed25519 -f ~/.ssh/sift_key -N "" -C "vm1-to-sift" ``` **2. 将密钥复制到虚拟机** ``` ssh-copy-id -i ~/.ssh/remnux_key.pub remnux@192.168.56.20 ssh-copy-id -i ~/.ssh/sift_key.pub sansforensics@192.168.56.30 ``` **3. 创建 SSH 配置**(VM1 上的 `~/.ssh/config`) ``` Host remnux HostName 192.168.56.20 User remnux IdentityFile ~/.ssh/remnux_key StrictHostKeyChecking no Host sift HostName 192.168.56.30 User sansforensics IdentityFile ~/.ssh/sift_key StrictHostKeyChecking no ``` **4. 测试连通性** ``` ssh remnux "uname -a && echo REMnux OK" ssh sift "uname -a && vol -h 2>/dev/null | head -2 && echo SIFT OK" ``` ## 08. remnux-ssh MCP Server 构建并注册自定义的 MCP 服务器,允许 Claude 通过 SSH 在 REMnux 上运行命令。 ### 构建 MCP Server ``` mkdir -p ~/mcp/remnux-mcp/src && cd ~/mcp/remnux-mcp npm init -y npm install @modelcontextprotocol/sdk ssh2 zod npm install -D typescript @types/node @types/ssh2 npm pkg set type="module" cat > tsconfig.json << 'EOF' { "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "outDir": "build", "rootDir": "src", "strict": false, "esModuleInterop": true, "skipLibCheck": true }, "include": ["src"] } EOF # 放置 src/index.ts 然后构建 npx tsc && ls build/ ``` ### 在 REMnux 上创建 Ghidra 辅助脚本 这些脚本解决了与 Ghidra Docker 容器通信时的 SSH 引号转义问题。POST 脚本会自动将 REMnux 路径转换为容器路径,并为 shellcode/raw 二进制文件支持可选的 language 参数。 ``` ssh remnux 'python3 -c " import os os.makedirs(\"/home/remnux/ghidra-scripts\", exist_ok=True) get_script = \"\"\"#!/bin/sh echo \"curl -s -H \x27Authorization: Bearer ghidra-lab-token\x27 http://localhost:8089\$1\" > /tmp/gh_cmd.sh docker cp /tmp/gh_cmd.sh ghidra-mcp:/tmp/gh_cmd.sh docker exec ghidra-mcp sh /tmp/gh_cmd.sh \"\"\" post_script = \"\"\"#!/bin/sh # 自动将 REMnux 路径转换为 Docker 容器路径 FILE_PATH=\$(echo \"\$1\" | sed \x27s|/home/remnux/samples/|/data/|\x27) LANGUAGE=\$2 if [ -n \"\$LANGUAGE\" ]; then BODY=\"{\\\"file\\\":\\\"\$FILE_PATH\\\",\\\"language\\\":\\\"\$LANGUAGE\\\"}\" else BODY=\"{\\\"file\\\":\\\"\$FILE_PATH\\\"}\" fi echo \"\$BODY\" > /tmp/gh_body.json echo \"curl -s -X POST -H \x27Authorization: Bearer ghidra-lab-token\x27 -H \x27Content-Type: application/json\x27 -d @/tmp/gh_body.json http://localhost:8089/load_program\" > /tmp/gh_post_cmd.sh docker cp /tmp/gh_body.json ghidra-mcp:/tmp/gh_body.json docker cp /tmp/gh_post_cmd.sh ghidra-mcp:/tmp/gh_post_cmd.sh docker exec ghidra-mcp sh /tmp/gh_post_cmd.sh \"\"\" with open(\"/home/remnux/ghidra-scripts/ghidra-get.sh\", \"w\") as f: f.write(get_script) with open(\"/home/remnux/ghidra-scripts/ghidra-post.sh\", \"w\") as f: f.write(post_script) os.chmod(\"/home/remnux/ghidra-scripts/ghidra-get.sh\", 0o755) os.chmod(\"/home/remnux/ghidra-scripts/ghidra-post.sh\", 0o755) print(\"Scripts written\") "' ``` ### 注册到 Claude Code ``` claude mcp add remnux-ssh \ --scope user \ -- node /home/$USER/mcp/remnux-mcp/build/index.js \ --host 192.168.56.20 \ --username remnux \ --private-key /home/$USER/.ssh/remnux_key claude mcp list | grep remnux-ssh ``` ## 09. VirusTotal MCP Server 设置 VirusTotal MCP 以进行哈希查询、文件报告和样本下载。 ``` git clone https://github.com/BurtTheCoder/mcp-virustotal ~/mcp/mcp-virustotal cd ~/mcp/mcp-virustotal && npm install && npm run build source ~/.config/malware-lab/secrets.env claude mcp add virustotal \ --scope user \ -e VIRUSTOTAL_API_KEY=$VIRUSTOTAL_API_KEY \ -- node /home/$USER/mcp/mcp-virustotal/build/index.js ``` ### VirusTotal MCP — 可用工具 | 工具 | 输入 | 描述 | 级别 | |------|-------|-------------|------| | `get_file_report` | MD5/SHA1/SHA256 | 完整的检测报告 — AV 判定、沙箱得分、元数据 | Free | | `get_file_behavior` | SHA256 | 动态分析 — 网络连接、注册表更改、释放的文件 | Free | | `get_file_relationship` | SHA256 + type | 相关文件、联系的 IP/域名、执行父进程 | Free | | `get_url_report` | URL | URL 信誉、类别、检测 | Free | | `get_ip_report` | IP address | IP 信誉、ASN、国家、关联的恶意软件 | Free | | `get_domain_report` | Domain | 域名信誉、WHOIS、DNS 历史 | Free | | `search` | VTI query | 使用 VTI 修饰符进行高级搜索,例如 `type:peexe tag:signed` | Free | | `download_file` | SHA256 + path | 下载样本为受密码保护的 zip (password: `infected`) | Premium | ## 10. Ghidra MCP (Docker 无头模式) 在 REMnux 上以无头 Docker 容器运行 GhidraMCP。在 VM1(有互联网访问)上构建镜像并传输到 REMnux。 ### 步骤 1 — 在 VM1 上构建 Docker 镜像 ``` sudo apt install -y docker.io sudo systemctl start docker sudo usermod -aG docker $USER && newgrp docker git clone https://github.com/bethington/ghidra-mcp ~/mcp/ghidra-mcp cd ~/mcp/ghidra-mcp docker build -t ghidra-mcp-headless:latest -f docker/Dockerfile . docker save ghidra-mcp-headless:latest -o /tmp/ghidra-mcp-headless.tar ls -lh /tmp/ghidra-mcp-headless.tar ``` ### 步骤 2 — 传输并加载到 REMnux ``` scp -i ~/.ssh/remnux_key /tmp/ghidra-mcp-headless.tar remnux@192.168.56.20:/home/remnux/ ``` ``` docker load -i /home/remnux/ghidra-mcp-headless.tar python3 -c " import os script = '''#!/bin/bash docker run -d --name ghidra-mcp --memory 2g \ -p 127.0.0.1:8089:8089 \ -v /home/remnux/samples:/data \ -v ghidra-projects:/projects \ -e GHIDRA_MCP_PORT=8089 \ -e GHIDRA_MCP_BIND_ADDRESS=0.0.0.0 \ -e GHIDRA_MCP_AUTH_TOKEN=ghidra-lab-token \ -e JAVA_OPTS=-Xmx2g \ ghidra-mcp-headless:latest ''' with open('/home/remnux/run-ghidra-mcp.sh', 'w') as f: f.write(script) os.chmod('/home/remnux/run-ghidra-mcp.sh', 0o755) " /home/remnux/run-ghidra-mcp.sh sleep 20 docker exec ghidra-mcp curl -s http://localhost:8089/get_version ``` ## 11. sift-ssh MCP Server 构建并注册 sift-ssh MCP 服务器 —— 与 remnux-ssh 模式相同。 ``` mkdir -p ~/mcp/sift-mcp/src && cd ~/mcp/sift-mcp npm init -y npm install @modelcontextprotocol/sdk ssh2 zod npm install -D typescript @types/node @types/ssh2 npm pkg set type="module" # 从 remnux-mcp 复制 tsconfig.json 并更新 src/index.ts npx tsc claude mcp add sift-ssh \ --scope user \ -- node /home/$USER/mcp/sift-mcp/build/index.js \ --host 192.168.56.30 \ --username sansforensics \ --private-key /home/$USER/.ssh/sift_key # 测试 claude mcp list | grep sift ``` ## 12. REMnux 分析工具 REMnux 上可用的完整工具清单,按类别整理。所有标记为 `install` 的工具都需要手动安装(VM2 设置的步骤 3)。 ### 静态分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `file` | 通过 magic bytes 识别文件类型 | built-in | | `strings` | 提取可打印字符串 | built-in | | `xxd` | 文件的十六进制转储 | built-in | | `diec` / `die` | 检测 packers、编译器、protectors | pre-installed | | `FLOSS` | 提取混淆 + 堆栈字符串 | pre-installed | | `CAPA` | MITRE ATT&CK 能力检测 | pre-installed | | `pescanner` | PE 头和节分析 | pre-installed | | `exiftool` | 文件元数据提取 | pre-installed | | `binwalk` | 嵌入文件提取 | pre-installed | | `upx` | UPX packer 检测/解包 | pre-installed | ### Office 文档分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `olevba` | VBA 宏提取和分析 | pre-installed | | `oleid` | OLE 文件指标检测 | pre-installed | | `oledump` | OLE 流转储 | pre-installed | | `mraptor` | 恶意宏检测 | pre-installed | | `ViperMonkey` | VBA 宏模拟 | install | ### 脚本去混淆 | 工 | 描述 | 来源 | |------|-------------|--------| | `synchrony` | JavaScript 去混淆 (obfuscator.io) | install | | `js-beautify` | JavaScript 格式化和美化 | install | ### ELF / Linux 分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `readelf` | ELF 头和节分析 | built-in | | `objdump` | 反汇编和符号检查 | built-in | | `nm` | 符号表列表 | built-in | | `ldd` | 共享库依赖 | built-in | | `strace` / `ltrace` | 系统和库调用追踪 | pre-installed | ### Python 恶意软件 | 工具 | 描述 | 来源 | |------|-------------|--------| | `pyinstxtractor-ng` | 解包 PyInstaller bundles | pre-installed | | `uncompyle6` | 反编译 Python .pyc bytecode | install | ### Windows 安装程序 (MSI / MSIX) | 工具 | 描述 | 来源 | |------|-------------|--------| | `msiextract` | 提取 MSI 文件内容 | pre-installed | | `msidump` | 转储 MSI 数据库表 | pre-installed | | `7z` / `unzip` | 提取 MSIX/AppX packages | pre-installed | | `cabextract` | 提取 Cabinet 文件 | pre-installed | ### .NET Assembly 分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `ilspycmd` | 将 .NET assemblies 反编译为 C# 源代码 | pre-installed | | `monodis` | 反汇编 .NET IL bytecode,提取用户字符串 | pre-installed | | `pedump` | PE/CLI 头和元数据表分析 | pre-installed | | `dnfile` | 用于解析 .NET 元数据的 Python 库 | install | | `pefile` | Python PE 结构解析库 | install | | `dotnet 8.0 runtime` | ilspycmd 所需 | pre-installed | ### Java / JAR 分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `cfr` | 将 JAR/class 反编译为 Java 源代码 — 很好地处理现代 Java | pre-installed | | `procyon` | 备选的 Java 反编译器 — 更擅长处理混淆代码 | pre-installed | | `javap` | 将 .class bytecode 反汇编为 JVM 指令 | built-in | | `jadx` | 反编译 JAR 和 Android APK — 最适合混淆的 JAR | pre-installed | | `java` / `jar` | 用于 manifest 检查和类列表的 JDK 工具 | built-in | ### Go 二进制文件分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `go version -m` | 从 Go 二进制文件提取构建信息、模块依赖项 | install | | `blint` | Go 二进制能力检测 — MITRE ATT&CK 映射 | install | | `nm` / `objdump` | 符号提取 — Go 符号很少被剥离 | built-in | | `strings` | Go 二进制文件未混淆地嵌入模块路径 — 非常有效 | built-in | ## 13. SIFT 取证工具 SIFT Workstation 上可用的完整工具清单。大多数是预装的;少数需要手动安装(VM3 设置的步骤 3)。 ### 内存取证 | 工具 | 描述 | 来源 | |------|-------------|--------| | `Volatility3 (vol)` | Windows/Linux/macOS 内存分析 — pslist, netscan, malfind, cmdline, dlllist | pre-installed | ### 磁盘取证 | 工具 | 描述 | 来源 | |------|-------------|--------| | `fls` / `icat` | 列出和提取磁盘镜像中的文件 | pre-installed | | `fsstat` / `mmls` | 文件系统和分区信息 | pre-installed | | `tsk_recover` | 从磁盘镜像恢复文件 | pre-installed | | `Autopsy` | 用于磁盘镜像的 GUI 取证浏览器 | pre-installed | ### 时间线分析 | 工具 | 描述 | 来源 | |------|-------------|--------| | `log2timeline.py` | 从磁盘镜像和 artifacts 创建 super-timelines | pre-installed | | `psteal.py` / `psort.py` | 过滤、排序和导出 plaso 时间线事件 | pre-installed | ### Artifact 提取 | 工具 | 描述 | 来源 | |------|-------------|--------| | `bulk_extractor` | 从镜像中提取电子邮件、URL、信用卡、域名 | pre-installed | | `foremost` | 从磁盘镜像中恢复 (Carve) 已删除的文件 | pre-installed | | `dcfldd` | 带有哈希验证的取证磁盘复制 | install | | `ssdeep` | 用于文件相似度的模糊哈希 | install | ### 注册表取证 | 工具 | 描述 | 来源 | |------|-------------|--------| | `RegRipper (rip.pl)` | 从注册表 hives 中提取 autoruns、用户活动、程序执行情况 | pre-installed | ## 14. MCP 工具组 工具通过它们描述中的标签被组织成不同的组。Claude 使用这些标签自动选择合适的工具。 ### remnux-ssh MCP 工具组 | 组 | 标签 | 核心工具 | 使用场景 | |-------|-----|-----------|----------| | 接收与实用工具 | `[UTILITY]` | `run_command`, `upload_sample`, `intake_sample`, `list_samples` | 传输和管理样本 | | 快速分类 | `[TRIAGE]` | `triage_quick`, `triage_pe`, `triage_iocs`, `triage_office`, `triage_script`, `triage_elf`, `triage_python`, `triage_java`, `triage_go`, `triage_dotnet`, `triage_full` | 对任何新样本的初步查看 | | 深度静态分析 | `[STATIC]` | `analyze_file`, `floss_strings`, `capa_analyze`, `diec_analyze`, `binwalk_extract`, `extract_config` | 分类后的详细分析 | | Office 文档 | `[OFFICE]` | `oleid_analyze`, `olevba_analyze`, `oledump_analyze`, `mraptor_analyze`, `vmonkey_analyze` | doc/docx/xls/xlsx/ppt | | 脚本去混淆 | `[DEOBFUSCATE]` | `deobfuscate_js`, `js_beautify`, `js_extract_strings`, `deobfuscate_powershell` | JS/PS1/VBS/BAT 脚本 | | MSI / MSIX | `[MSI]` | `msi_analyze`, `msi_extract_files`, `msix_analyze` | Windows 安装程序包 | | ELF / Linux | `[ELF]` | `elf_analyze`, `elf_imports`, `elf_sections`, `elf_iocs` | Linux ELF 二进制文件 | | Python 恶意软件 | `[PYTHON]` | `pyinstaller_extract`, `python_decompile`, `python_analyze` | PyInstaller bundles, .pyc 文件 | | .NET Assembly | `[DOTNET]` | `dotnet_decompile`, `dotnet_il_disasm`, `dotnet_pe_headers`, `dotnet_metadata`, `dotnet_strings`, `dotnet_resources` | C#, VB.NET, F# assemblies | | Java / JAR | `[JAVA]` | `java_decompile`, `java_disassemble`, `java_jar_inspect`, `java_extract_jar`, `jadx_decompile`, `java_strings_iocs` | JAR 文件、.class、Android APK | | Go 二进制文件 | `[GO]` | `go_info`, `go_symbols`, `go_strings`, `go_capabilities`, `go_modules` | 编译好的 Go 二进制文件 | | Ghidra | `[GHIDRA]` | `ghidra_load_sample`, `ghidra_run_analysis`, `ghidra_list_functions`, `ghidra_decompile`, `ghidra_list_imports`, `ghidra_list_strings`, `ghidra_detect_malware`, `ghidra_extract_iocs` | 深度逆向工程 — 加载 shellcode/raw 二进制文件后调用 `ghidra_run_analysis` | ### sift-ssh MCP 工具组 | 组 | 标签 | 核心工具 | 使用场景 | |-------|-----|-----------|----------| | 实用工具 | `[UTILITY]` | `run_command`, `list_cases`, `hash_file` | 案件管理、证据哈希 | | 内存取证 | `[MEMORY]` | `memory_info`, `memory_pslist`, `memory_netscan`, `memory_malfind`, `memory_cmdline`, `memory_dlllist`, `memory_handles`, `memory_registry`, `memory_dump_process`, `triage_memory` | 内存转储 (.dmp, .raw) | | 磁盘取证 | `[DISK]` | `disk_info`, `disk_list_files`, `disk_recover_files`, `disk_extract_file`, `triage_disk` | 磁盘镜像 (.dd, .E01) | | 时间线分析 | `[TIMELINE]` | `timeline_create`, `timeline_filter`, `timeline_search` | 创建 Super-timeline | | Artifact 提取 | `[ARTIFACT]` | `extract_artifacts`, `carve_files`, `forensic_copy` | 批量提取、文件恢复 (Carving) | | 注册表取证 | `[REGISTRY]` | `registry_analyze`, `registry_autoruns`, `registry_useractivity` | Windows 注册表 hive 分析 | | 分类 | `[TRIAGE]` | `triage_case`, `triage_memory`, `triage_disk` | 对任何证据文件的初步查看 | ## 15. 分析工作流 用于 Claude Code 的标准提示词。使用 `lab` 命令在 `~/malware-analysis` 中运行。 ### 工作流 1 — 完整的 PE 样本分析 ``` Full malware analysis workflow for SHA256 : 1. Use virustotal download_file to save to ~/downloads/sample.zip 2. scp to /home/remnux/intake/sample.zip on REMnux 3. remnux-ssh intake_sample (password: infected) 4. remnux-ssh triage_full on the extracted sample 5. virustotal get_file_report for the hash 6. remnux-ssh ghidra_load_sample (path only — auto-detects PE/ELF) 7. remnux-ssh ghidra_list_functions then ghidra_list_imports 8. remnux-ssh ghidra_decompile on any suspicious functions found 9. Write triage report: file type, hashes, capabilities, IOCs, VT detections ``` ### 工作流 1b — Shellcode / Raw 二进制分析 ``` Analyze the raw shellcode/headerless binary at /home/remnux/samples/shellcode.bin: 1. remnux-ssh triage_quick for file type and hashes 2. remnux-ssh ghidra_load_sample with: - path: /home/remnux/samples/shellcode.bin - language: x86:LE:64:default (or x86:LE:32:default for 32-bit) 3. remnux-ssh ghidra_run_analysis with entry_offset=0x0 4. remnux-ssh ghidra_list_functions to see discovered functions 5. remnux-ssh ghidra_decompile on each function found 6. Summarize: shellcode purpose, API calls, IOCs, likely malware family Available language IDs: - x86 64-bit: x86:LE:64:default - x86 32-bit: x86:LE:32:default - ARM 32-bit: ARM:LE:32:v8 - ARM 64-bit: AARCH64:LE:64:v8A ``` ### 工作流 2 — 反编译特定函数 ``` After loading a sample into Ghidra, decompile specific functions: # 按函数名: Use remnux-ssh ghidra_decompile on function named FUN_140001000 # 按地址: Use remnux-ssh ghidra_decompile on function at address 0x140001000 # 批量反编译可疑函数: Use remnux-ssh to: 1. Call ghidra_list_functions 2. Identify functions with suspicious names (inject, decrypt, download, exec, socket, connect) 3. Decompile each suspicious function using ghidra_decompile 4. Summarize the capabilities found ``` ### 工作流 2 — Office 文档分析 ``` Analyze the Office document at /home/remnux/samples/invoice.docx: 1. remnux-ssh triage_office (runs all oletools) 2. remnux-ssh vmonkey_analyze to emulate any macros 3. Extract all IOCs (URLs, IPs, domains) 4. Summarize: macro presence, auto-exec triggers, IOCs, verdict ``` ### 工作流 3 — JavaScript 去混淆 ``` Deobfuscate /home/remnux/samples/malicious.js: 1. remnux-ssh triage_script 2. remnux-ssh deobfuscate_js with method=both 3. Extract all network IOCs from the deobfuscated output 4. Identify malware family if possible ``` ### 工作流 4 — PyInstaller 样本 ``` Analyze the Python binary at /home/remnux/samples/stealer.exe: 1. remnux-ssh triage_python 2. If PyInstaller detected, remnux-ssh pyinstaller_extract 3. remnux-ssh python_decompile on any .pyc files found 4. Extract C2 configuration from decompiled source 5. Cross-reference IOCs with virustotal ``` ### 工作流 5 — .NET Assembly 分析 ``` Analyze the .NET sample at /home/remnux/samples/agent.exe: 1. remnux-ssh triage_dotnet 2. remnux-ssh dotnet_decompile for full C# source 3. remnux-ssh dotnet_strings for obfuscated strings 4. remnux-ssh dotnet_resources for embedded payloads 5. virustotal get_file_report 6. Summarize: obfuscator, capabilities, IOCs, verdict ``` ### 工作流 6 — Java / JAR 分析 ``` Analyze the JAR at /home/remnux/samples/payload.jar: 1. remnux-ssh triage_java 2. remnux-ssh java_jar_inspect for class and resource listing 3. remnux-ssh java_decompile with tool=both (CFR + Procyon) 4. If obfuscated, remnux-ssh jadx_decompile 5. remnux-ssh java_strings_iocs for C2 indicators 6. virustotal get_file_report 7. Summarize: functionality, obfuscation, IOCs, malware family ``` ### 工作流 7 — Go 二进制文件分析 ``` Analyze the Go binary at /home/remnux/samples/implant: 1. remnux-ssh triage_go 2. remnux-ssh go_info for build version and metadata 3. remnux-ssh go_modules for third-party libraries 4. remnux-ssh go_symbols for exported functions 5. remnux-ssh go_capabilities for MITRE ATT&CK mapping 6. remnux-ssh go_strings for network IOCs 7. Cross-reference IOCs with virustotal 8. Summarize: C2 framework, capabilities, persistence, IOCs ``` ### 工作流 8 — 内存取证 ``` Analyze the memory dump at /cases/memory.dmp on SIFT: 1. sift-ssh triage_memory 2. Identify suspicious processes from pslist 3. sift-ssh memory_malfind for injected code 4. For suspicious PIDs: memory_cmdline and memory_dlllist 5. sift-ssh memory_netscan for C2 connections 6. Cross-reference IPs/domains with virustotal 7. sift-ssh memory_dump_process to extract suspicious process 8. Transfer to REMnux for static analysis 9. Summarize: compromised processes, IOCs, attacker activity ``` ### 工作流 9 — 磁盘镜像取证 ``` Investigate the disk image at /cases/disk.dd on SIFT: 1. sift-ssh hash_file to verify evidence integrity 2. sift-ssh triage_disk for partition and filesystem info 3. sift-ssh disk_list_files to browse the filesystem 4. sift-ssh timeline_create to build a super-timeline 5. sift-ssh timeline_search around the incident timeframe 6. sift-ssh carve_files to recover deleted executables 7. sift-ssh extract_artifacts for bulk IOC extraction 8. Transfer carved executables to REMnux for static analysis 9. Summarize: timeline of events, suspicious files, IOCs ``` ## 16. 故障排除 | 问题 | 原因 | 修复方法 | |-------|-------|-----| | SSH 连接被拒绝 | SSH 服务未运行或 IP 错误 | 运行 `sudo systemctl start ssh`。使用 `ip a` 验证 IP。 | | MCP 显示 “Failed to connect” | Node.js 路径错误或构建未编译 | 运行 `npx tsc`。使用 `claude mcp remove` 然后 `add` 重新注册。 | | Ghidra 返回 “Unauthorized” | Auth token 通过 SSH 层时被剥离 | 使用 ghidra-scripts wrapper 方法 — 永远不要直接通过 `docker exec` 参数传递 token。 | | Ghidra 容器崩溃 | 在没有 auth token 的情况下绑定 0.0.0.0 | 使用 `GHIDRA_MCP_BIND_ADDRESS=0.0.0.0` 时,务必设置 `GHIDRA_MCP_AUTH_TOKEN`。 | | `ghidra_list_functions` 返回空 | 样本已加载但未分析 | 加载后调用 `ghidra_run_analysis` 并设置 `entry_offset=0x0`。这对于 raw shellcode 和无头二进制文件是必需的。 | | `ghidra_load_sample` 在 shellcode 上失败 | 自动检测在无头二进制文件上失败 | 传递 `language` 参数:64 位使用 `x86:LE:64:default`,32 位使用 `x86:LE:32:default`。 | | `ghidra_load_sample` 返回 “File not found” | 路径错误 — 容器使用的是 /data/ 而不是 /home/remnux/samples/ | 更新后的 `ghidra-post.sh` 会自动转换路径。如果直接使用 `run_command`,请使用 `/data/filename` 而不是 `/home/remnux/samples/filename`。 | | Claude 会话中看不到 MCP | 以 project 范围注册 | 使用 `--scope user`重新注册。检查 `~/.claude.json` 是否有重复项。 | | npm install 在 REMnux/SIFT 上挂起 | 无互联网(Host-Only 网络) | 暂时重新启用 NAT 进行安装。安装后切换回 Host-Only。 | | sift-ssh 无法连接 | 用户名或密钥路径错误 | SIFT 用户为 `sansforensics`。测试:`ssh -i ~/.ssh/sift_key sansforensics@192.168.56.30`。 | | Volatility3 无输出 | OS profile 或镜像路径错误 | 先尝试 `vol -f image.dmp windows.info`。使用完整的绝对路径。 | | netplan apply 在 SIFT 上失败 | 未安装 nano | 改为使用 `sudo tee /etc/netplan/...`。使用 `ip a` 检查接口名称。 | | cfr/procyon 输出为空 | 不是有效的 JAR 或已加密的 JAR | 使用 `file sample.jar` 进行验证。尝试使用 `jadx` 作为备选。 | | `go version -m` 没有返回任何内容 | 已剥离的二进制文件或非 Go 程序 | 使用 `strings binary \| grep 'go[0-9]'`。Go 二进制文件即使被剥离,其字符串中仍然包含模块路径。 | | 找不到 jadx | 不在 REMnux 的 PATH 中 | 使用完整路径:`/usr/local/jadx/bin/jadx`。 | ## 17. 安全说明 保持实验室隔离并确保您的宿主机安全的规则。 - [ ] **切勿在 VM1 上执行样本。** VM1 保存您的 API keys 和 MCP 配置。样本只能存在于 REMnux(`/home/remnux/samples/`)或 SIFT(`/cases/`)上。 - [ ] **保持 REMnux 和 SIFT 处于 Host-Only 模式。** 安装工具后立即切换回去。切勿在会话期间将分析虚拟机留在 NAT 模式上。 - [ ] **使用受密码保护的 zip。** 始终以 `zip -P infected sample.zip sample.exe` 的形式传输样本。这是 VT 的标准做法,可防止意外执行。 - [ ] **在样本之间恢复快照。** 在分析前对 REMnux 拍摄干净的快照。每次会话后恢复,以防止交叉污染。 - [ ] **在 VMware 中为 REMnux 和 SIFT 禁用共享剪贴板和拖放功能。** 防止意外将文件传输到宿主机。 - [ ] **API keys 仅保留在 VM1 上。** VT API key 位于 VM1 的 `~/.config/malware-lab/secrets.env` 中。切勿传输到分析虚拟机。 - [ ] **对所有证据进行哈希处理。** 在分析前后使用 `sift-ssh hash_file` 以维护保管链。 - [ ] **Ghidra auth token 仅限实验室内部使用。** `ghidra-lab-token` 绑定到 Docker 内部的 `127.0.0.1` — 不暴露在实验室网络上。 *AI 驱动的恶意软件分析实验室 — 安装指南 v1.1* *VM1: Ubuntu 24.04 · VM2: REMnux · VM3: SIFT
标签:DAST, DLL 劫持, MCP, MITM代理, 云资产清单, 后端开发, 大语言模型, 安全沙箱, 恶意软件分析, 数字取证, 网络信息收集, 网络安全审计, 自动化脚本, 虚拟化环境, 请求拦截, 逆向工具, 逆向工程