Skip to main content
Glama

CyberMCP

by ricauts

CyberMCP - 使用 MCP 进行网络安全 API 测试

CyberMCP 是一个模型上下文协议 (MCP) 服务器,用于测试后端 API 的安全漏洞。它提供了一组专用工具和资源,可供 LLM 用来识别 API 中常见的安全问题。

特征

  • 身份验证漏洞测试:检查 JWT 漏洞、身份验证绕过和弱身份验证机制
  • 注入测试:测试 SQL 注入、XSS 和其他注入漏洞
  • 数据泄漏测试:识别敏感数据泄露问题
  • 速率限制测试:测试速率限制绕过和 DDoS 漏洞
  • 安全标头测试:检查缺失或配置错误的安全标头
  • 综合资源:访问 API 安全测试的清单和指南
  • 身份验证支持:多种身份验证方法来测试安全端点

项目结构

CyberMCP/ ├── src/ │ ├── tools/ # MCP tools for security testing │ ├── resources/ # MCP resources (checklists, guides) │ ├── transports/ # Custom transport implementations │ ├── utils/ # Utility functions and auth management │ └── index.ts # Main entry point ├── package.json # Dependencies and scripts ├── tsconfig.json # TypeScript configuration └── README.md # This file

安装

  1. 克隆存储库:
    git clone https://github.com/your-username/CyberMCP.git cd CyberMCP
  2. 安装依赖项:
    npm install
  3. 构建项目:
    npm run build

用法

运行 MCP 服务器

您可以使用 stdio 传输(默认)或 HTTP 传输运行服务器:

使用 stdio 传输(用于与 LLM 平台集成):

npm start

使用 HTTP 传输(用于本地开发和测试):

TRANSPORT=http PORT=3000 npm start

连接到服务器

MCP 服务器可以连接到任何 MCP 客户端,包括支持模型上下文协议的 LLM 平台。

安全工具

验证

CyberMCP 支持多种身份验证方法来测试安全的 API:

  • 基本身份验证:使用用户名和密码设置 HTTP 基本身份验证
  • 令牌认证:使用持有者令牌、JWT 或自定义令牌格式
  • OAuth2 身份验证:完整的 OAuth2 流程支持,具有不同的授权类型
  • 自定义 API 登录:针对任何登录 API 端点进行身份验证

身份验证工具:

  • basic_auth :使用用户名/密码进行身份验证
  • token_auth :设置基于令牌的身份验证
  • oauth2_auth :执行 OAuth2 身份验证
  • api_login :使用自定义 API 端点登录
  • auth_status :检查当前身份验证状态
  • clear_auth :清除当前身份验证状态

认证测试

  • JWT 漏洞检查:分析 JWT 令牌是否存在安全问题
  • 身份验证绕过检查:测试端点是否存在身份验证绕过漏洞

注入测试

  • SQL注入检查:测试SQL注入漏洞的参数
  • XSS 检查:测试跨站脚本漏洞

数据泄漏测试

  • 敏感数据检查:识别泄露的 PII、凭证和敏感信息
  • 路径遍历检查:测试目录遍历漏洞

安全标头测试

  • 安全标头检查:分析 HTTP 标头以获取最佳安全实践

资源

清单

通过cybersecurity://checklists/{category}访问安全检查表,其中类别可以是:

  • authentication
  • injection
  • data_leakage
  • rate_limiting
  • general

指南

通过guides://api-testing/{topic}访问详细的测试指南,其中主题可以是:

  • jwt-testing
  • auth-bypass
  • sql-injection
  • xss
  • rate-limiting

API 测试所需信息

为了有效地测试 API 的安全漏洞,您需要:

  1. API 端点:要测试的端点的 URL
  2. 身份验证信息:用于访问安全端点的凭证或令牌
  3. 参数名称:接受用户输入的参数的名称
  4. 测试数据:参数的样本有效数据
  5. 预期行为:正常响应应该是什么样的
  6. 身份验证流程:目标 API 中的身份验证如何工作

身份验证示例

基本身份验证

basic_auth: username: "admin" password: "secure_password"

令牌认证

token_auth: token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." token_type: "Bearer" expires_in: 3600

OAuth2 身份验证

oauth2_auth: client_id: "client_123" client_secret: "secret_456" token_url: "https://example.com/oauth/token" grant_type: "client_credentials" scope: "read write"

自定义 API 登录

api_login: login_url: "https://example.com/api/login" credentials: username: "admin" password: "secure_password" token_path: "data.access_token"

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

模型上下文协议服务器旨在测试后端 API 是否存在安全漏洞,例如身份验证绕过、注入攻击和数据泄漏。

  1. 特征
    1. 项目结构
      1. 安装
        1. 用法
          1. 运行 MCP 服务器
          2. 连接到服务器
        2. 安全工具
          1. 验证
          2. 认证测试
          3. 注入测试
          4. 数据泄漏测试
          5. 安全标头测试
        3. 资源
          1. 清单
          2. 指南
        4. API 测试所需信息
          1. 身份验证示例
            1. 基本身份验证
            2. 令牌认证
            3. OAuth2 身份验证
            4. 自定义 API 登录
          2. 执照

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server implementation for interacting with Salesforce through its REST API.
              Last updated -
              4
              34
              TypeScript
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol server that enables seamless execution of commands, Python code, web content fetching, and reusable task management with secure credentials handling.
              Last updated -
              2
              Python
              MIT License
              • Apple
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that enables interaction with Infisical APIs for secret management, allowing users to create, update, delete, and list secrets through function calling.
              Last updated -
              9
              73
              20
              JavaScript
              Apache 2.0
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that enables users to perform third-party enrichment lookups for security observables (IP addresses, domains, URLs, emails) through services like VirusTotal, Shodan, and others.
              Last updated -
              1
              Python
              • Apple

            View all related MCP servers

            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/ricauts/CyberMCP'

            If you have feedback or need assistance with the MCP directory API, please join our Discord server