Skip to main content

An MCP server for AI agents to use during red teaming exercises

Project description

Red-team-mcp

An MCP (Model Context Protocol) server for AI agents to use during red teaming exercises.

Overview

This server provides resources and tools for AI agents to access during red teaming scenarios. It implements the Model Context Protocol to allow AI agents to retrieve information, access tools, and perform actions needed for security testing and evaluation.

Architecture

graph TD
    Agent[AI Agent Client] <--> |MCP Protocol| Server[FastMCP Server]

    subgraph "MCP Server Components"
        Server --> PortScanner[Port Scanner Module]
        Server --> VulnScanner[Vulnerability Scanner Module]
        Server --> SSHTools[SSH Tools Module]
        Server --> Metasploit[Metasploit Integration]
        Server --> DomainDiscovery[Domain Discovery Module]
        Server <--> Database[(MongoDB Database)]
    end

    subgraph "External Tools"
        PortScanner --> Masscan[masscan]
        VulnScanner --> Nuclei[nuclei]
        SSHTools --> SSH[SSH Client]
        Metasploit --> MSFRPC[Metasploit RPC]
        DomainDiscovery --> Subfinder[subfinder]
    end

    Database --> Findings[Findings]

Components

1. Port Scanner

  • Integrates with masscan for high-speed port scanning
  • Allows AI agents to discover open ports and services on target networks
  • Configurable scan parameters (IP ranges, port ranges, scan rate)
  • Results parsing and formatting for agent consumption

2. Vulnerability Scanner

  • Integrates with Nuclei for vulnerability detection
  • Supports custom templates and severity filtering
  • Stores results in MongoDB for fast searching

3. SSH Tools

  • SSH command execution with credential authentication
  • SSH brute force capabilities with username/password lists
  • Results stored with host and port information

4. Metasploit Integration

  • Exploit Database: Pre-populated MongoDB collection with all Metasploit exploits
  • Fast Search: Search exploits by platform, CVE, rank, author, or keywords
  • Exploit Execution: Execute exploits against targets with payload configuration
  • Live Querying: Real-time exploit listing from Metasploit RPC server

Implementation Plan

  1. Set up basic MCP server structure
  2. Implement masscan integration with parameter validation
  3. Create result parsing and storage mechanisms
  4. Add additional components (forthcoming)
  5. Implement logging and monitoring
  6. Build permission and boundary systems

Todos

  • Add nuclei scanner
  • Add SSH scanner
  • Add Metasploit integration
  • Implement fully asynchronous FastMCP server
  • Add tests
  • Prompt for step by step hacking of a machine. (See agents/simple_agent.py)

Setup

installing 3rp party tools

The setup is depending on the following tools

  • mongodb
  • nuclei

Exploit Database Setup

To enable fast exploit searching, populate the Metasploit exploits database:

  1. Prerequisites:

    • Metasploit Framework installed
    • MongoDB running on localhost:27017
    • Metasploit RPC server running: msfrpcd -P msf -a 127.0.0.1
    • Python dependencies: pip install pymetasploit3
  2. Populate Database:

    python scripts/setup_exploits_db.py
    
  3. Test Setup:

    python scripts/test_exploits_db.py
    

This creates a searchable database of all Metasploit exploits with metadata including:

  • CVE references
  • Platform information
  • Exploit rank and author
  • Compatible payloads
  • Required options

Usage

Exploit Search Examples

# Search Windows SMB exploits
search_exploits_fast(platform='windows', search_term='smb')

# Find EternalBlue exploit
search_exploits_fast(cve='CVE-2017-0144')

# Get high-quality exploits
search_exploits_fast(rank='excellent')

# Search by author
search_exploits_fast(author='hdm')

Development

Details on extending the server with new tools and resources will be added.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_skjortan23_red_team_mcp-0.1.1.tar.gz (81.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_skjortan23_red_team_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_skjortan23_red_team_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 81.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_skjortan23_red_team_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ea19d31ed17ca6640afa9a3560dbadf2b4203b2137c0e0aff9885f1f9299ed85
MD5 a52933a4e926da96c2e71f8d85b93b7c
BLAKE2b-256 c34c8dc37c85811c25925987cbb8955a89520ecc2baeb9d67313f7befdf477c1

See more details on using hashes here.

File details

Details for the file iflow_mcp_skjortan23_red_team_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_skjortan23_red_team_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 78.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_skjortan23_red_team_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57a134864cefe81f61708f4050b51ec98f1045f752696ce4429249855008ca9d
MD5 d59a6f4b05665f71b8908f5e16cbd49a
BLAKE2b-256 7ea2a8acebfd0f820487dbe618cb4afa333db27355b57a3f5ecefad9686b81d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page