Skip to main content
Glama

mythic-mcp

Mythic C2 フレームワークを MCP サーバーとして公開し、LLM(Claude など)がエージェントを操作したり、タスクを発行したり、プラットフォームデータを会話的に照会できるようにします。

機能

  • エージェント管理 — アクティブなコールバックを詳細情報付きで一覧表示、個別エージェントの調査、エージェントの強制終了、スリープタイマーの変更

  • タスク実行 — シェルコマンド、ファイルの読み取り/ダウンロード/アップロード、mimikatz、make_token、および任意の Mythic コマンド用の汎用ディスパッチャー

  • プラットフォームデータ — 資格情報ストア、アーティファクトログ、イベントログ、ファイルブラウザ、ペイロードリスト、C2 プロファイルステータス

  • 構造化レスポンス — すべてのツールは、信頼性の高い LLM 解析のために {"status":"ok","data":...} または {"status":"error","message":...} を返します

  • 組み込みプロンプト — start_pentest および start_recon プロンプトテンプレート

Related MCP server: caldera-mcp

要件

  • Python 3.10+

  • uv パッケージマネージャー

  • 実行中の Mythic サーバー (v3.x+)

インストール

git clone <this-repo>
cd mythic-mcp
uv sync

実行

位置引数

uv run main.py <username> <password> [host] [port]
uv run main.py mythic_admin mythic_admin_password localhost 7443

環境変数

export MYTHIC_USERNAME=mythic_admin
export MYTHIC_PASSWORD=mythic_admin_password
export MYTHIC_HOST=localhost
export MYTHIC_PORT=7443
uv run main.py

TLS なし

uv run main.py mythic_admin password localhost 7443 --no-ssl

サーバーが出力なしで静かに起動した場合、正常に動作しています — MCP メッセージを stdio で待機しています。

Claude Desktop への接続

設定ファイルを見つけます:

OS

パス

Linux

~/.config/Claude/claude_desktop_config.json

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

最初に uv のパスを取得します:

which uv

mcpServers の下にエントリを追加します:

{
  "mcpServers": {
    "mythic_mcp": {
      "command": "/home/user/.local/bin/uv",
      "args": [
        "--directory",
        "/path/to/mythic-mcp",
        "run",
        "main.py"
      ],
      "env": {
        "MYTHIC_USERNAME": "mythic_admin",
        "MYTHIC_PASSWORD": "mythic_admin_password",
        "MYTHIC_HOST": "localhost",
        "MYTHIC_PORT": "7443"
      }
    }
  }
}

Claude Desktop を完全に終了して再起動します。サーバーが接続すると、チャット UI のツールアイコンに登録されたすべてのツールが一覧表示されます。

ツール

エージェント / コールバック管理

ツール

説明

get_all_agents()

アクティブなすべてのコールバックを詳細情報(OS、アーキテクチャ、PID、IP、スリープ、プロセス、ペイロードタイプなど)とともに一覧表示

get_agent_details(agent_id)

表示 ID による単一エージェントの詳細情報

kill_agent(agent_id)

Mythic でエージェントを非アクティブとしてマーク

set_sleep(agent_id, interval, jitter)

スリープ間隔(秒)とジッター(%)を変更

タスク実行

ツール

説明

run_shell_command(agent_id, command_line)

エージェントのデフォルトインタプリタを介してシェルコマンドを実行

read_file(agent_id, file_path)

ターゲットからファイルを読み取る(cat を使用)

download_file(agent_id, file_path)

ファイルをダウンロードし、base64 として返す

upload_file(agent_id, file_name, remote_path, content_b64)

base64 エンコードされたファイルをターゲットにアップロード

run_as_user(agent_id, username, password)

make_token — 別のユーザーとしてネットワーク呼び出しを行うための認証

execute_mimikatz(agent_id, mimikatz_arguments)

mimikatz を実行(例: sekurlsa::logonpasswords)

execute_command(agent_id, command_name, parameters)

汎用ディスパッチャー — 名前で任意の Mythic コマンド

プラットフォームデータ

ツール

説明

get_credentials()

Mythic 資格情報ストア内のすべての資格情報

get_artifacts(limit)

アーティファクトログ(ファイル、レジストリキー、作成されたプロセス)

get_event_log(limit)

操作イベントログ

browse_files(agent_id, path)

ターゲット上のディレクトリのファイルブラウザエントリ

list_payloads()

ビルドステータスと C2 プロファイルを含む、削除されていないすべてのペイロード

list_c2_profiles()

実行ステータスを含むすべての C2 プロファイル

プロンプト

プロンプト

説明

start_pentest(threat_actor, objective)

特定の脅威アクターを模倣して目的に向かうよう Claude を準備

start_recon()

すべてのアクティブエージェントに対して初期偵察を実行するよう Claude を準備

Claude での使用例

Use the start_recon prompt.
List all active agents, then run whoami on agent 1.
Download /etc/passwd from agent 2 and show me its contents.
Run mimikatz sekurlsa::logonpasswords on agent 3.
Use execute_command to run 'ps' on agent 1 with parameters {"host": "."}.

アーキテクチャ

Claude Desktop
     │  MCP stdio
     ▼
main.py  (FastMCP tools + prompts)
     │
     ▼
lib/mythic_api.py  (MythicAPI class)
     ├─ mythic Python library  →  Mythic GraphQL/REST API
     └─ httpx (raw GraphQL)   →  Mythic GraphQL endpoint

すべてのタスク呼び出しは、60 秒のタイムアウトで asyncio.wait_for を使用します。GraphQL リクエストは、Mythic の自己署名証明書を処理するために TLS 検証をスキップします(verify=False)。

環境変数リファレンス

変数

デフォルト

説明

MYTHIC_USERNAME

—

Mythic オペレーターユーザー名(必須)

MYTHIC_PASSWORD

—

Mythic オペレーターパスワード(必須)

MYTHIC_HOST

localhost

Mythic サーバーのホスト名または IP

MYTHIC_PORT

7443

Mythic サーバーのポート

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers