Skip to content

Migrate Metasploit MCP to Claude Code skills architecture#74

Merged
valITino merged 2 commits intomainfrom
claude/explore-skills-config-0bHwj
Mar 15, 2026
Merged

Migrate Metasploit MCP to Claude Code skills architecture#74
valITino merged 2 commits intomainfrom
claude/explore-skills-config-0bHwj

Conversation

@valITino
Copy link
Copy Markdown
Owner

Summary

This PR migrates the blhackbox pentesting framework from a standalone Metasploit MCP server to a Claude Code-native skills architecture. The Metasploit MCP server (metasploit-mcp/) is removed entirely, and autonomous pentesting workflows are now implemented as Claude Code slash commands (.claude/skills/) that orchestrate existing MCP servers (Kali, WireMCP, Screenshot).

Key Changes

Removed Components

  • Metasploit MCP Server (metasploit-mcp/server.py, entrypoint.sh, requirements.txt) — 1,077 lines of msgpack-based RPC client code
  • Metasploit Docker image (docker/metasploit-mcp.Dockerfile) — no longer needed; Metasploit tools are accessed via Kali MCP
  • Template-based prompt system (blhackbox/prompts/templates/README.md, agent prompt loading) — replaced by skills

Added Components

  • 10 autonomous pentesting skills (.claude/skills/*/SKILL.md):

    • /full-pentest — end-to-end penetration testing
    • /full-attack-chain — maximum-impact testing with attack chain reporting
    • /quick-scan — fast triage with on-the-spot exploitation
    • /recon-deep — comprehensive attack surface mapping
    • /web-app-assessment — focused web application testing
    • /network-infrastructure — network-level assessment with credential testing
    • /osint-gathering — passive-only intelligence collection
    • /vuln-assessment — systematic vulnerability identification and exploitation
    • /api-security — REST/GraphQL API testing (OWASP API Top 10)
    • /bug-bounty — bug bounty hunting with exploitation-driven PoC reports
  • Development guidelines (blhackbox/mcp/CLAUDE.md, blhackbox/backends/CLAUDE.md, blhackbox/models/CLAUDE.md, blhackbox/reporting/CLAUDE.md) — document contracts and constraints for future development

Modified Components

  • README.md — Added "Skills / Slash Commands" section documenting the new skill-based UX, interactive prompts, and comparison with legacy MCP templates
  • DOCKER.md — Added "Skills in Docker" section with quick-start examples
  • docker-compose.yml — Mount .claude/ and .instructions/ directories into Claude Code container for skill discovery
  • docker/claude-code.Dockerfile — Copy project instructions and skills into image (overridden by volume mounts at runtime)
  • docker/claude-code-entrypoint.sh — Updated status dashboard to reference skills instead of templates
  • blhackbox/prompts/init.py — Removed agent prompt loading (no longer used)
  • tests/test_prompts.py — Removed load_agent_prompt test

Implementation Details

Architecture Shift

  • Before: Metasploit MCP server exposed 15 tools (exploit execution, session management, etc.) via msgpack RPC to any MCP client
  • After: Claude Code discovers skills as native slash commands; skills orchestrate existing MCP servers (Kali, WireMCP, Screenshot) via Bash/Agent tools

Skills Design

Each skill:

  • Accepts a target via $ARGUMENTS (e.g., /full-pentest example.com)
  • Prompts for additional context interactively (scope, credentials, engagement type)
  • Executes a multi-phase workflow (recon → scanning → exploitation → reporting)
  • Mandates exploitation and data extraction — findings without PoC are rejected
  • Generates structured reports with evidence

Backward Compatibility

  • MCP templates (get_template tool) remain available for Claude Desktop and ChatGPT via the blhackbox MCP server
  • Skills are Claude Code-only; they coexist with template-based workflows for other clients

Testing

  • Removed test_load_agent_prompt from tests/test_prompts.py (agent prompts no

https://claude.ai/code/session_01KBrjHu875M7qs84jAXpB63

claude added 2 commits March 15, 2026 07:55
…ted code

Phase 1 — Skills & Configuration:
- Convert all 10 pentest templates into native Claude Code skills in
  .claude/skills/ — each becomes a /slash-command (e.g., /full-pentest,
  /quick-scan, /bug-bounty) with $ARGUMENTS for target input
- Multi-placeholder templates (bug-bounty, full-attack-chain, api-security,
  web-app-assessment) now collect scope/auth/rules interactively instead
  of requiring manual placeholder editing — better UX
- Add 4 subdirectory CLAUDE.md files (mcp/, models/, backends/, reporting/)
  with directory-scoped development rules loaded on-demand
- Mount .claude/skills/ and CLAUDE.md into claude-code Docker container
  via docker-compose volumes + baked-in Dockerfile COPY as fallback
- Update entrypoint dashboard to show /skill-name usage pattern

Phase 2 — Cleanup (safe removals, zero functional dependencies):
- Remove deprecated metasploit-mcp/ directory (MSF integrated in kali-mcp)
- Remove docker/metasploit-mcp.Dockerfile
- Remove empty mcp_servers/ stub directory
- Remove duplicate blhackbox/prompts/templates/README.md
- Remove dead load_agent_prompt() function and its test
- Clean metasploit-mcp reference from README.md directory tree

All 187 tests pass. MCP template path preserved for non-Claude-Code clients.

https://claude.ai/code/session_01KBrjHu875M7qs84jAXpB63
README.md:
- Add Skills / Slash Commands section with all 10 skills, usage examples,
  and comparison table (skills vs MCP templates)
- Add Advanced Usage & FAQ section with 10 practical tutorials:
  full pentest workflow, bug bounty with scope, API with auth, chaining
  recon into pentest, web app with creds, quick triage, natural language
  usage, creating custom skills, subdirectory CLAUDE.md explained,
  lab/CTF authorization setup
- Update Tutorial 1 (Docker) to show skill-based usage (/quick-scan,
  /full-pentest) instead of free-form prompts
- Update Tutorial 2 (Web) to mention skills availability
- Update Project Structure tree with .claude/skills/, subdirectory
  CLAUDE.md files, and reorganized module listing
- Remove duplicate lab testing example (now in FAQ)
- Update Table of Contents with Skills and Advanced sections

DOCKER.md:
- Add Skills in Docker section with quick start, mount explanation,
  and available skills table
- Update Claude Code image details to include skills info
- Add skills and CLAUDE.md to host bind mounts table

https://claude.ai/code/session_01KBrjHu875M7qs84jAXpB63
@valITino valITino merged commit 92c1066 into main Mar 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants