Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
medusa — AI 优先的安全扫描器。v2026.7 新增:Claude Code 失陷检测——在克隆前审查 .claude/ 钩子、权限与技能——另配备常驻的 AI 攻击特征扫描器,以及原生 Rust 与 PHP 规则。此外:medusa scan --git 可审查任意仓库,medusa secrets scan 可扫描泄露的 API 密钥。40,000+ 种模式,零配置。 | Kitploit
工具/GitHubGitHub/pantheon-security/medusa
漏洞扫描器容器安全静态代码分析 (SAST)代码分析配置审计Web安全云安全DevSecOps秘密检测供应链安全AI 安全
GitHub
957156101个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
pantheon-security/medusa

medusa

AI 优先的安全扫描器。v2026.7 新增:Claude Code 失陷检测——在克隆前审查 .claude/ 钩子、权限与技能——另配备常驻的 AI 攻击特征扫描器,以及原生 Rust 与 PHP 规则。此外:medusa scan --git 可审查任意仓库,medusa secrets scan 可扫描泄露的 API 密钥。40,000+ 种模式,零配置。

查看仓库网站
分享

🐍 MEDUSA - AI 安全扫描器

PyPI Downloads Python License: AGPL-3.0 Tests Windows macOS Linux

AI 优先的安全扫描器,拥有 40,000+ 检测模式,覆盖 AI/ML、代理和 LLM 应用。 🤖 开箱即用 - 无需安装任何工具。 🚨 200 个 CVE:Log4Shell、Spring4Shell、XZ Utils、LangChain RCE、MCP-Remote RCE、React2Shell 🔥 medusa scan --git <URL> — 扫描任意仓库以发现 AI 供应链攻击(仓库投毒、提示注入、MCP 工具投毒) 🔐 medusa secrets scan — 在你的 Claude / Cursor / Copilot / shell 历史记录中发现泄漏的 API 密钥。支持 21 种签发者类型。交互式就地脱敏。 🚀 v2026.7.0:Claude Code 失陷检测、常驻的 AI 攻击特征扫描器、原生 Rust 和 PHP 安全规则,以及规则级诊断 — 基于 40,000+ 检测模式之上。


🎯 什么是 MEDUSA?

MEDUSA 是一款 AI 优先的安全扫描器,拥有 40,000+ 检测模式,开箱即用。只需安装并扫描 — 无需安装任何外部工具。MEDUSA 的内置规则可检测 AI/ML 应用、LLM 代理、MCP 服务器、RAG 流水线和传统代码中的漏洞。

✨ 主要特性

  • 🔥 medusa scan --git <URL> - 数秒内扫描任意 GitHub 仓库,检测 AI 供应链攻击
  • 🔐 medusa secrets scan + purge - 查找泄漏到 Claude Code / Cursor / Copilot / Zed / Gemini 聊天记录以及你的 bash / zsh / psql / mysql / python REPL 历史中的 API 密钥 / 令牌 / 私钥。支持 21 种签发者类型(Anthropic、OpenAI、PyPI、GitHub PAT、AWS、GCP、Stripe、Slack…)。交互式 [y/n/s/a/q] 清除,强制生成字节级一致的备份,并采用 JSONL 安全的脱敏方式。仅本地处理,无遥测。
  • 🤖 40,000+ AI 安全模式 - 行业领先的 AI/ML、代理和 LLM 应用覆盖
  • 🛡️ 仓库投毒检测 - 检测 28+ 种文件类型中的武器化 AI 编辑器配置(Cursor、Cline、Copilot、Claude Code、Gemini、Kiro 等)
  • 🚀 零配置要求 - pip install 后立即可用 - 无需安装工具
  • 🚨 200 个 CVE 检测 - Log4Shell、Spring4Shell、XZ Utils 后门、LangChain RCE、MCP 远程代码执行、React2Shell 等
  • ⚡ 并行处理 - 多核扫描(比串行快 10-40 倍),支持 macOS/Windows/Linux
  • 🎨 精美的 CLI - 富终端输出,带进度条
  • 🧠 IDE 集成 - 支持 Claude Code、Cursor、VS Code、Gemini CLI
  • 🔄 智能缓存 - 跳过未更改的文件,实现闪电般快速的重新扫描(基于内容哈希,在 CI 中正确)
  • ⚙️ 可配置 - 使用 .medusa.yml 进行项目级设置
  • 🌍 跨平台 - 原生支持 Windows、macOS 和 Linux
  • 📊 多种报告 - 支持 JSON、HTML、Markdown、SARIF 导出,适配任何工作流
  • 🔧 可选 Linter 支持 - 自动检测已安装的外部 linter,以增强覆盖

🆕 v2026.7.0 的新特性

Claude Code 供应链检测、更广泛的语言覆盖,以及规则级可观测性。

变更详情
🛡️Claude Code 失陷检测medusa scan --git 现在会在你克隆之前对 .claude/ 进行结构性审查 — 被投毒的 hooks(curl|bash、base64→exec、凭据外泄、反向 shell)、过度宽泛的 permissions(Bash(*)、bypassPermissions)、通配符工具 subagents,以及投放器 skills。
🎯常驻攻击特征扫描器弥补假阴性空白 — 数据文件(.jsonl/.csv)和普通文本中的越狱 / 提示注入载荷现在无论 LLM 上下文置信度如何都会被捕获,此外还支持隐形 Unicode / 双向文本(Trojan Source,CVE-2021-42574)恢复。
🦀原生 Rust 安全规则22 条开箱即用的规则(无需工具链)— 禁用 TLS 验证、命令注入、不可信反序列化、原始 SQL、不安全的内存操作、弱加密、SSRF。
🐘原生 PHP 安全规则16 条开箱即用的规则 — SQLi、命令/eval 注入、LFI/RFI、路径遍历、unserialize() 对象注入、无限制上传、反射型 XSS、SSRF、弱加密。
🔬规则诊断(--trace-rules)每条规则的触发日志 + 计时(rule-trace.jsonl、slow_rules.csv),以及可抵御挂起的心跳机制 — 发现并修复了一个真实的灾难性回溯 ReDoS,还新增了一条 ReDoS/嵌套集合 lint 规则,可在编写时阻止不良模式。
⚡引擎 + 准确性扫描引擎性能快速优化、针对 --git 目标审核的上下文感知筛选模式、大文件字节上限采样,以及文档占位符导致秘密误报的修复。
历史版本

v2026.5.12 — 最大的模式发布:检测模式从 9,600 增至 40,000+,从 8,466 篇 AI 安全研究论文中提取,并进行了误报加固;新增结构性规则完整性扫描器。

v2026.5.10 — 安全加固:修复 VS Code 扩展命令注入漏洞、--fail-on 缓存发现缺陷、工具缓存过期路径问题,用户主目录 MCP 配置改为需主动启用(opt-in)。

v2026.5.9 — 智能体商务覆盖:UCPScanner + AP2Scanner + 45 条手工调优的正向模式规则。

v2026.5.8 — medusa secrets:扫描 AI 聊天与 shell 历史中的泄漏凭据(21 种签发者类型),支持交互式 [y/n/s/a/q] 清除。

v2026.5.7 — 间接提示注入规则(101/102)、供应链导入扫描器、macOS/Windows 多进程修复。

v2026.5.5 — 安全加固发布(argv 注入防御、git SSRF、HMAC 缓存完整性、markdown XSS 修复)。

外部 Linter(可选):MEDUSA 会自动检测已安装的 bandit、eslint、shellcheck 等工具。参见 可选工具指南。


🔐 扫描你的 AI 聊天记录,查找泄漏的秘密

你的 PyPI 令牌现在可能就在你的 Claude 聊天记录里。

开发人员每天都在将 API 密钥、令牌和凭据粘贴到 AI 助手中 — 「用 pypi-AgEI... 部署这个」、「用我的 ghp_... 推送」、「AWS 密钥是 AKIA...」。 这些助手将对话以明文形式保存在磁盘上。任何对 $HOME 有读取权限的人 — 或任何未来拥有 shell 访问权限的恶意软件 — 都可以执行 grep -r 'sk-\|ghp_\|AKIA' ~/ 并在数秒内收割生产凭据。

medusa secrets scan 会找到它们。medusa secrets purge 会清理它们。

30 秒快速上手```bash

medusa secrets scan

root@kitploit:~
The input section is empty — no chunk content was provided to translate. Please supply the source text for chunk 3 of 73, and I’ll translate it into Chinese following all the formatting rules.```text
Scanning 118 file(s)...

── claude-code ──────────────────────────────────────────────
/home/ross/.claude/history.jsonl  (13 finding(s))
[CRITICAL] Anthropic API key (anthropic)
    /home/ross/.claude/history.jsonl:1005:13
    sk-ant-api03***...***
[CRITICAL] PyPI API token (pypi)
    /home/ross/.claude/history.jsonl:125:94
    pypi-AgEIc***...***
[CRITICAL] GitHub fine-grained PAT (github)
    /home/ross/.claude/history.jsonl:2306:13
    github_pat_11A***...***
[HIGH]     HuggingFace token (huggingface)
    /home/ross/.claude/history.jsonl:3387:13
    hf_JOi***...***
...

Total: 13 credentials across 1 file(s).
Report:  /home/ross/.medusa/secrets-scan/secrets-20260519-074452.json

The input chunk is empty — there is no translatable content provided. Please supply chunk 5 of 73 so I can translate it.```bash medusa secrets purge

root@kitploit:~
The input content appears to be empty — no source text was provided after "INPUT:". Please supply the actual Markdown chunk you'd like translated.```text
[CRITICAL] PyPI API token  (pypi)
    /home/ross/.claude/history.jsonl:125:94
    pypi-AgEIc***...***
  redact?  [y/n/s/a/q/?]: y

[CRITICAL] Anthropic API key  (anthropic)
    /home/ross/.claude/history.jsonl:1005:13
    sk-ant-api03***...***
  redact?  [y/n/s/a/q/?]: y
...

✓ /home/ross/.claude/history.jsonl  (13 redacted)
    backup → /home/ross/.medusa/secrets-scan/backups/20260519-074452/home/ross/.claude/history.jsonl

原始文件在每次更改前都会逐字节备份。JSONL 在脱敏后仍保持可解析。脱敏标记([REDACTED-MEDUSA-...-<run-id>])每次运行都是唯一的,因此你可以追溯到产生它的扫描。

命令```bash

medusa secrets scan # everything (default — chat + shell) medusa secrets scan --source ai-chats # AI assistants only medusa secrets scan --source shell # ~/.bash_history, ~/.zsh_history, fish, psql, mysql, ... medusa secrets scan --path FILE # explicit file (e.g. a ChatGPT export) medusa secrets scan --reveal # show real values (requires 'I UNDERSTAND')

medusa secrets purge # interactive [y/n/s/a/q] medusa secrets purge SCAN_ID # purge a specific report medusa secrets purge --all --yes-i-know # batch mode for power users / CI

root@kitploit:~
### 检测内容(21 个签发方)

**AI 提供商**:Anthropic、OpenAI、HuggingFace、Replicate、Cohere
**软件包注册表**:PyPI、npm
**代码托管平台**:GitHub PAT(经典 + 细粒度 + OAuth + App)、GitLab PAT
**云服务**:AWS 访问密钥、GCP 服务账号 JSON
**支付 / 通信**:Stripe 在线/受限密钥、Slack 机器人/用户令牌、SendGrid、Twilio、Discord Webhook
**加密**:PEM 编码的私钥(RSA、DSA、EC、OpenSSH、PGP)

### 安全特性

- **仅本地运行。** 报告保存在 `~/.medusa/secrets-scan/` 目录下,权限为 `0o600`。无网络、无遥测、绝不写入项目目录树。
- **写入前备份。** 每次脱敏操作前都会创建字节级完全相同的备份。`cp` 命令可恢复。
- **JSONL 安全。** 脱敏标记不包含任何 JSON 不安全字符;写入后受影响的行会重新解析。
- **漂移时拒绝操作。** 如果源文件在扫描和清除之间发生了变化,清除工具将拒绝操作,而不是冒险覆盖编辑内容。
- **原子写入。** 临时文件 + `os.replace` 替换。要么重写生效,要么保留原文件。

[**📖 完整 secrets-scanner 指南 →**](https://github.com/pantheon-security/medusa/blob/main/docs/SECRETS_SCANNER.md)

---

## 🚀 快速开始

### 安装```bash
# Install MEDUSA (works on Windows, macOS, Linux)
pip install medusa-security

# Run your first scan - that's it!
medusa scan .

虚拟环境(推荐):```bash

Create and activate virtual environment

python3 -m venv medusa-env source medusa-env/bin/activate # On Windows: medusa-env\Scripts\activate

Install and scan

pip install medusa-security medusa scan .

root@kitploit:~
**平台说明:**
- **Windows**:如果找不到 `medusa` 命令,请使用 `py -m medusa`
- **macOS/Linux**:开箱即用

### 扫描任意 GitHub 仓库```bash
# Scan a remote repo for AI supply chain attacks
medusa scan --git https://github.com/org/repo

# Shorthand - just user/repo
medusa scan --git org/repo

# Scan a specific branch
medusa scan --git https://github.com/org/repo/tree/main

MEDUSA 可自动检测 28+ 个已知作为攻击向量的 AI 编辑器配置文件:

风险等级检测到的文件
严重(RCE).cursorrules, .cursor/mcp.json, .clinerules/, .windsurfrules, .codex/config.toml, .kiro/settings/mcp.json, .vscode/settings.json, mcp.json
高CLAUDE.md, GEMINI.md, AGENTS.md, AGENT.md, SKILL.md, .github/copilot-instructions.md, CONVENTIONS.md, .amazonq/rules/, .roo/rules/, .augment/rules/

已检测到的已知攻击:Clinejection、CurXecute (CVE-2025-54135)、IDEsaster (CVE-2025-64660)、ToxicSkills、CamoLeak、RoguePilot、AIShellJack、Cacheract

可选:AI 模型扫描```bash

Install modelscan for ML model vulnerability detection

medusa install --ai-tools

root@kitploit:~
### 可选:外部 Linter

MEDUSA 会自动检测是否安装了外部 Linter(如 bandit、eslint、shellcheck 等),并自动使用它们来增强扫描覆盖率。

**[查看安装指南 →](https://github.com/pantheon-security/medusa/blob/main/docs/OPTIONAL_TOOLS.md)** 以获取特定平台的说明。

> **注意:** 外部 Linter 是可选的。MEDUSA 内置的 40,000+ 条规则无需它们也能正常工作。如需安装支持,请参阅各工具供应商的文档。

### 演示

<div align="center">

![MEDUSA 运行演示](https://assets.kitploit.com/production/public/readmes/49181/80281d742fbec3c1bf5c3cb62999af22a9fcfb2bdb89ba79eec5d27b80716e7a.gif)

</div>

### 📊 报告格式

MEDUSA 会生成多种格式的精美报告:

**JSON** - 机器可读,适合 CI/CD 集成```bash
medusa scan . --format json

HTML - 惊艳的玻璃拟态UI与交互式图表```bash medusa scan . --format html

root@kitploit:~
**Markdown** - 适合 GitHub/wikis 的文档友好格式```bash
medusa scan . --format markdown

所有格式 - 一次生成所有内容```bash medusa scan . --format all

root@kitploit:~
---

## 📚 语言支持

MEDUSA 支持 **79 种扫描器类型**,涵盖 AI/ML 安全、所有主流编程语言和文件格式:

### 后端语言(9 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Python | Bandit | `.py` |
| JavaScript/TypeScript | ESLint | `.js`, `.jsx`, `.ts`, `.tsx` |
| Go | golangci-lint | `.go` |
| Ruby | RuboCop | `.rb`, `.rake`, `.gemspec` |
| PHP | Native rules (+ PHPStan optional) | `.php` |
| Rust | Native rules (+ Clippy optional) | `.rs` |
| Java | Checkstyle | `.java` |
| C/C++ | cppcheck | `.c`, `.cpp`, `.cc`, `.cxx`, `.h`, `.hpp` |
| C# | Roslynator | `.cs` |

### JVM 语言(3 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Kotlin | ktlint | `.kt`, `.kts` |
| Scala | Scalastyle | `.scala` |
| Groovy | CodeNarc | `.groovy`, `.gradle` |

### 函数式语言(5 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Haskell | HLint | `.hs`, `.lhs` |
| Elixir | Credo | `.ex`, `.exs` |
| Erlang | Elvis | `.erl`, `.hrl` |
| F# | FSharpLint | `.fs`, `.fsx` |
| Clojure | clj-kondo | `.clj`, `.cljs`, `.cljc` |

### 移动开发(2 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Swift | SwiftLint | `.swift` |
| Objective-C | OCLint | `.m`, `.mm` |

### 前端与样式(3 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| CSS/SCSS/Sass/Less | Stylelint | `.css`, `.scss`, `.sass`, `.less` |
| HTML | HTMLHint | `.html`, `.htm` |
| Vue.js | ESLint | `.vue` |

### 基础设施即代码(4 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Terraform | tflint | `.tf`, `.tfvars` |
| Ansible | ansible-lint | `.yml` (playbooks) |
| Kubernetes | kubeval | `.yml`, `.yaml` (manifests) |
| CloudFormation | cfn-lint | `.yml`, `.yaml`, `.json` (templates) |

### 配置文件(4 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| JSON | built-in | `.json` |
| TOML | taplo | `.toml` |
| XML | xmllint | `.xml` |
| Protobuf | buf lint | `.proto` |

### Shell 与脚本(4 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Bash/Shell | ShellCheck | `.sh`, `.bash` |
| PowerShell | PSScriptAnalyzer | `.ps1`, `.psm1` |
| Lua | luacheck | `.lua` |
| Perl | perlcritic | `.pl`, `.pm` |

### 文档(2 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| Markdown | markdownlint | `.md` |
| reStructuredText | rst-lint | `.rst` |

### 其他语言(5 种)
| 语言 | 扫描器 | 扩展名 |
|----------|---------|------------|
| SQL | SQLFluff | `.sql` |
| R | lintr | `.r`, `.R` |
| Dart | dart analyze | `.dart` |
| Solidity | solhint | `.sol` |
| Docker | hadolint | `Dockerfile*` |

**总计:79 种扫描器类型 — 41 种语言/工具扫描器 + 38 种 AI/ML 安全扫描器 — 覆盖 100+ 种文件扩展名**

---

## 🚨 React2Shell CVE 检测(v2025.8 新增)

MEDUSA 现在可检测 **CVE-2025-55182 "React2Shell"** —— 一个影响 React Server Components 和 Next.js 的 CVSS 10.0 RCE 漏洞。```bash
# Check if your project is vulnerable
medusa scan .

# Vulnerable versions detected:
# - React 19.0.0 - 19.2.0 (Server Components)
# - Next.js 15.0.0 - 15.0.4 (App Router)
# - Various canary/rc releases

扫描范围:package.json、package-lock.json、yarn.lock、pnpm-lock.yaml

修复:升级至 React 19.0.1+ 和 Next.js 15.0.5+


🤖 AI 智能体安全

MEDUSA 提供业界领先的 AI 安全扫描,配备 40,000+ 检测模式,面向智能体 AI 时代。已针对 OWASP Top 10 for LLM Applications 2025 更新,并涵盖 AI 编程编辑器与 MCP 服务器中 200+ 个 CVE 的检测。

AI 安全完整文档

AI 安全覆盖范围

类别模式数量检测内容
提示注入800+直接/间接注入、越狱、角色操纵
MCP 服务器安全400+工具投毒、Schema 投毒、ATPA、采样注入、rug-pull
仓库投毒150+武器化的 AI 编辑器配置、Clinejection、CurXecute、IDEsaster、CamoLeak
RAG 安全300+向量注入、文档投毒、租户隔离
智能体安全500+过度自主权、记忆投毒、HITL 绕过
模型安全400+不安全加载、检查点暴露、对抗性攻击
供应链350+依赖混淆、拼写仿冒、锁文件后门
传统 SAST1,400+SQL 注入、XSS、命令注入、密钥泄露

AI 攻击覆盖范围

上下文与输入攻击

  • 提示注入模式
  • 角色/人设操纵
  • 隐藏指令
  • 混淆技巧

记忆与状态攻击

  • 记忆投毒
  • 上下文操纵
  • 检查点篡改
  • 跨会话暴露

工具与操作攻击

  • 工具投毒(CVE-2025-6514)
  • 命令注入
  • 工具名称欺骗
  • 混淆代理模式

工作流与路由攻击

  • 路由操纵
  • 智能体冒充
  • 工作流劫持
  • 委托滥用

RAG 与知识攻击

  • 知识库投毒
  • 嵌入流水线攻击
  • 来源混淆
  • 检索操纵

高级攻击

  • HITL 绕过技术
  • 语义操纵
  • 评估投毒
  • 训练数据攻击

支持的 AI 文件(28+ 种)```

Critical - Known RCE vectors

.cursorrules # Cursor AI (CVE-2025-54135) .cursor/rules/.mdc # Cursor rules directory .cursor/mcp.json # Cursor MCP (CurXecute RCE) .clinerules/.md # Cline (Clinejection) .windsurfrules # Windsurf (CVE-2025-36730) .windsurf/rules/* # Windsurf workspace rules .codex/config.toml # Codex CLI (CVE-2025-61260) .kiro/settings/mcp.json # Kiro (CVE-2026-0830) .vscode/settings.json # VS Code (IDEsaster) *.code-workspace # VS Code workspace mcp.json / .mcp.json # MCP server configs

High - AI instruction files

CLAUDE.md # Claude Code GEMINI.md # Gemini CLI AGENTS.md # OpenAI Codex AGENT.md # Roo Code SKILL.md # ClawHub/ToxicSkills CONVENTIONS.md # Aider .github/copilot-instructions.md # GitHub Copilot .amazonq/rules/.md # Amazon Q Developer .augment/rules/ # Augment Code .roo/rules/.md # Roo Code .tabnine/guidelines/.md # Tabnine .continue/config.yaml # Continue.dev .cody.yml # Sourcegraph Cody

root@kitploit:~
### 快速 AI 安全扫描```bash
# Scan AI configuration files
medusa scan . --ai-only

# Example output:
# 🔍 AI Security Scan Results
# ├── .cursorrules: 3 issues (1 CRITICAL, 2 HIGH)
# │   └── AIC001: Prompt injection - ignore previous instructions (line 15)
# │   └── AIC011: Tool shadowing - override default tools (line 23)
# ├── mcp-config.json: 2 issues (2 HIGH)
# │   └── MCP003: Dangerous path - home directory access (line 8)
# └── rag_config.json: 1 issue (1 CRITICAL)
#     └── AIR010: Knowledge base injection pattern detected (line 45)

🎮 使用方法

基本命令```bash

Initialize configuration

medusa init

Scan current directory

medusa scan .

Scan specific directory

medusa scan /path/to/project

Quick scan (changed files only)

medusa scan . --quick

Force full scan (ignore cache)

medusa scan . --force

Use specific number of workers

medusa scan . --workers 4

Fail on HIGH severity or above

medusa scan . --fail-on high

Custom output directory

medusa scan . -o /tmp/reports

root@kitploit:~
### 安装命令```bash
# Check tool status
medusa install --check

# Install AI tools (modelscan for ML model scanning)
medusa install --ai-tools

# Show detailed output
medusa install --ai-tools --debug

注意:MEDUSA v2026.2+ 不再安装外部 linter。如有需要,请通过你的包管理器(apt、brew、npm、pip)安装它们。MEDUSA 会自动检测并使用任何已安装的 linter。

初始化命令```bash

Interactive initialization wizard

medusa init

Initialize with specific IDE

medusa init --ide claude-code

Initialize with multiple IDEs

medusa init --ide claude-code --ide gemini-cli --ide cursor

Initialize with all supported IDEs

medusa init --ide all

Force overwrite existing config

medusa init --force

Initialize and install tools

medusa init --install

root@kitploit:~
### 附加命令```bash
# Uninstall modelscan
medusa uninstall modelscan

# Check for updates
medusa version --check-updates

# Show current configuration
medusa config

# Override scanner for specific file
medusa override path/to/file.yaml YAMLScanner

# List available scanners
medusa override --list

# Show current overrides
medusa override --show

# Remove override
medusa override path/to/file.yaml --remove

扫描选项参考

OptionDescription
TARGET要扫描的目录或文件(默认:.)
-g, --git URL克隆并扫描远程 git 仓库(GitHub URL 或 user/repo 简写)
-w, --workers N并行工作进程数(默认:自动检测)
--quick快速扫描(仅扫描已更改的文件,需要 git)
--force强制完整扫描(忽略缓存)
--no-cache禁用结果缓存
--fail-on LEVEL在以下严重级别时以错误退出:critical、high、medium、low
-o, --output PATH报告的自定义输出目录
--format FORMAT输出格式:json、html、sarif、junit、text(可指定多个)
--no-report跳过生成 HTML 报告

安装选项参考

OptionDescription
--check检查工具状态
--ai-tools安装 AI 安全工具(modelscan)
--debug显示详细的调试输出

v2026.2+ 变更:MEDUSA 不再管理外部 linter 的安装。--all 标志已弃用。如有需要,请通过系统包管理器安装外部 linter。


⚙️ 配置

.medusa.yml

MEDUSA 使用 YAML 配置文件进行项目特定设置:```yaml

MEDUSA Configuration File

version: 2026.5.5

Scanner control

scanners: enabled: [] # Empty = all scanners enabled disabled: [] # List scanners to disable

Build failure settings

fail_on: high # critical | high | medium | low

Exclusion patterns

exclude: paths: - node_modules/ - venv/ - .venv/ - .git/ - pycache/ - dist/ - build/ files: - ".min.js" - ".min.css"

IDE integration

ide: claude_code: enabled: true auto_scan: true cursor: enabled: false vscode: enabled: false

Scan settings

workers: null # null = auto-detect CPU cores cache_enabled: true # Enable file caching for speed

root@kitploit:~
### 生成默认配置```bash
medusa init

This creates .medusa.yml with sensible defaults and auto-detects your IDE.


🤖 IDE 集成

MEDUSA 通过原生集成支持 5 大主流 AI 编程助手。使用 medusa init --ide all 初始化,或选择特定平台。

支持的平台

IDE上下文文件命令状态
Claude CodeCLAUDE.md/medusa-scan, /medusa-install✅ 完全支持
Gemini CLIGEMINI.md/scan, /install✅ 完全支持
OpenAI CodexAGENTS.md原生斜杠命令✅ 完全支持
GitHub Copilot.github/copilot-instructions.md代码建议✅ 完全支持
Cursor复用 CLAUDE.mdMCP + Claude 命令✅ 完全支持

快速设置```bash

Setup for all IDEs (recommended)

medusa init --ide all

Or select specific platforms

medusa init --ide claude-code --ide gemini-cli

root@kitploit:~
### Claude Code

**它会创建:**
- `CLAUDE.md` - 项目上下文文件
- `.claude/agents/medusa/agent.json` - Agent 配置
- `.claude/commands/medusa-scan.md` - 扫描斜杠命令
- `.claude/commands/medusa-install.md` - 安装斜杠命令

**用法:**```
Type: /medusa-scan
Claude: *runs security scan*
Results: Displayed in terminal + chat

Gemini CLI

它创建的内容:

  • GEMINI.md - 项目上下文文件
  • .gemini/commands/scan.toml - 扫描命令配置
  • .gemini/commands/install.toml - 安装命令配置

用法:```bash gemini /scan # Full scan gemini /scan --quick # Quick scan gemini /install --check # Check tools

root@kitploit:~
### OpenAI Codex

**它创建的内容:**
- `AGENTS.md` - 项目上下文(根级别)

**用法:**```
Ask: "Run a security scan"
Codex: *executes medusa scan .*

GitHub Copilot

它创建的内容:

  • .github/copilot-instructions.md - 安全标准和最佳实践

它的帮助方式:

  • 了解项目安全标准
  • 建议安全的代码模式
  • 推荐在更改后运行扫描
  • 帮助修复安全问题

Cursor

它创建的内容:

  • .cursor/mcp-config.json - MCP 服务器配置
  • 复用 .claude/ 结构(Cursor 是 VS Code 的分支)

用法:

  • 使用方式与 Claude Code 集成类似
  • 原生 MCP 支持,便于未来更深度的集成

🔧 高级功能

系统负载监控

MEDUSA 会自动监控系统负载并调整工作进程数量:```python

Auto-detects optimal workers based on:

- CPU usage

- Memory usage

- Load average

- Available cores

Warns when system is overloaded:

⚠️ High CPU usage: 85.3% Using 2 workers (reduced due to system load)

root@kitploit:~
### 智能缓存

基于哈希的缓存会跳过未更改的文件:```bash
# First scan
📂 Files scanned: 145
⏱️  Total time: 47.28s

# Second scan (no changes)
📂 Files scanned: 0
⚡ Files cached: 145
⏱️  Total time: 2.15s  # 22× faster!

并行处理

多核扫描以实现巨大加速:``` Single-threaded: 417.5 seconds 6 workers: 47.3 seconds # 8.8× faster 24 workers: ~18 seconds # 23× faster

root@kitploit:~
---

## 📊 示例工作流

### 新项目设置```bash
# 1. Initialize
cd my-awesome-project
medusa init

🐍 MEDUSA Initialization Wizard

✅ Step 1: Project Analysis
   Found 15 language types
   Primary: PythonScanner (44 files)

✅ Step 2: Scanner Availability
   Available: 6/79 scanners
   Missing: 73 tools

✅ Step 3: Configuration
   Created .medusa.yml
   Auto-detected IDE: Claude Code

✅ Step 4: IDE Integration
   Created .claude/agents/medusa/agent.json
   Created .claude/commands/medusa-scan.md

✅ MEDUSA Initialized Successfully!

# 2. First scan
medusa scan .

🔍 Issues found: 23
   CRITICAL: 0
   HIGH: 2
   MEDIUM: 18
   LOW: 3

# 3. Fix issues and rescan
medusa scan . --quick

⚡ Files cached: 142
🔍 Issues found: 12  # Progress!

CI/CD 集成```yaml

.github/workflows/security.yml

name: Security Scan

on: [push, pull_request]

jobs: medusa: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3

root@kitploit:~
  - name: Set up Python
    uses: actions/setup-python@v4
    with:
      python-version: '3.11'

  - name: Install MEDUSA
    run: pip install medusa-security

  - name: Run security scan
    run: medusa scan . --fail-on high
root@kitploit:~
> **注意**:无需工具安装步骤 - MEDUSA 的 40,000+ 条内置规则可立即生效。

---

## 🏗️ 架构

### 扫描器模式

所有扫描器都遵循一致的模式:```python
class PythonScanner(BaseScanner):
    """Scanner for Python files using Bandit"""

    def get_tool_name(self) -> str:
        return "bandit"

    def get_file_extensions(self) -> List[str]:
        return [".py"]

    def scan_file(self, file_path: Path) -> ScannerResult:
        # Run bandit on file
        # Parse JSON output
        # Map severity levels
        # Return structured issues
        return ScannerResult(...)

自动注册

扫描器会自动注册自身:```python

medusa/scanners/init.py

registry = ScannerRegistry() registry.register(PythonScanner()) registry.register(JavaScriptScanner())

... all 79 scanners

root@kitploit:~
### 严重性映射

所有工具统一使用的严重性级别:

- **CRITICAL** - 安全漏洞、致命错误
- **HIGH** - 错误、安全警告
- **MEDIUM** - 警告、代码质量问题
- **LOW** - 风格问题、约定
- **INFO** - 建议、重构机会

---

## 🧪 测试与质量

### 自用测试结果

MEDUSA 会扫描自身——以及实际项目:```
Self-scan (473 files):
  ✅ Issues found: 114 (pre-filter) → 0 (post-filter)
  ✅ FP reduction: 100% on own codebase
  ⏱️  Time: 8.2s

OpenClaw benchmark (4,124 files, 751K LOC):
  🔍 Issues found: 825 (post-filter)
  ✅ FPs filtered: 11,436 (93.9% reduction)
  ⏱️  Time: 3.3 hours (79 scanners)

性能基准

项目规模文件数时间速度
小型(MEDUSA 自扫描)473~8秒59 文件/秒
中型1,000~45秒22 文件/秒
大型(OpenClaw)4,124~3.3小时0.34 文件/秒*

*大型项目的时间主要被外部工具子进程(Semgrep、Trivy、GitLeaks)占用。内置模式扫描几乎是即时的。


🗺️ 路线图

✅ 已完成(v2026.5.0)

  • medusa scan --git <URL> - 扫描任意 GitHub 仓库中的 AI 供应链攻击
  • 仓库投毒检测 - 45 条新规则,覆盖 Clinejection、CurXecute、IDEsaster、CamoLeak、ToxicSkills
  • 28+ 种 AI 编辑器配置检测 - 对 15+ 种 AI 编码工具的优先文件扫描
  • MCP 高级攻击 - 模式投毒、ATPA、采样注入、跨服务器操纵
  • 40,000+ 检测模式 - 行业领先的 AI 安全覆盖
  • 78 个专业分析器 - 全面的语言和平台覆盖
  • 133 个关键 CVE - CVEMiner 数据库用于已知漏洞扫描
  • 583 个误报过滤模式 - 在实际项目上误报率降低 97.7%
  • Agent 协议安全 - UCP、AP2、ACP 漏洞检测(91 条规则)
  • 数据集投毒检测 - CSV、JSON、JSONL 注入扫描
  • 代码级提示注入 - F-string 注入、ChatML 标记、角色操纵
  • 跨平台 - 原生支持 Windows、macOS、Linux
  • IDE 集成 - Claude Code、Cursor、Gemini CLI、GitHub Copilot、OpenAI Codex

🔮 即将推出

  • MEDUSA Professional - 用于生产环境 LLM 保护的运行时代理过滤器
  • GitHub 应用 - 自动 PR 扫描
  • VS Code 扩展 - 原生 IDE 集成
  • REST API - CI/CD 流水线集成

🤝 贡献

我们欢迎贡献!以下是入门方法:```bash

1. Fork and clone

git clone https://github.com/yourusername/medusa.git cd medusa

2. Create virtual environment

python -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows

3. Install in editable mode

pip install -e ".[dev]"

4. Run tests

pytest

5. Create feature branch

git checkout -b feature/my-awesome-feature

6. Make changes and test

medusa scan . # Dogfood your changes!

7. Submit PR

git push origin feature/my-awesome-feature

root@kitploit:~
### 添加新扫描器

请参阅 `docs/development/adding-scanners.md`,了解添加新语言支持的指南。

---

## 📜 许可证

AGPL-3.0-or-later - 参见 [LICENSE](https://github.com/pantheon-security/medusa/blob/main/LICENSE) 文件

MEDUSA 是免费开源软件。您可以自由使用、修改和分发它,但任何修改或衍生作品(包括 SaaS 部署)也必须以 AGPL-3.0 许可证发布。

如需商业许可选项,请联系:[email protected]

---

## 即将推出

MEDUSA Professional 为生产环境中的 LLM 应用新增了**运行时保护**功能,可在提示注入、越狱和数据外泄尝试到达您的模型之前实时拦截。

| 功能 | 开源版 | 专业版 | 企业版 |
|---------|-------------|--------------|------------|
| 静态扫描(40,000+ 模式) | 是 | 是 | 是 |
| 运行时代理过滤器(1,100+) | - | 是 | 是 |
| REST API 与 Webhooks | - | 是 | 是 |
| 自定义规则与 SSO | - | - | 是 |
| **价格** | 免费 | $99/开发者/月 | $499/50 开发者/月 |

运行时代理目前处于内测阶段。如果您正在保护生产环境中的 LLM 应用并希望获得提前访问权限,请联系 **[email protected]**。

---

## 🙏 致谢

**开发:**
- Pantheon Security
- Claude AI(Anthropic)- AI 辅助开发

**技术栈:**
- Python 3.10+
- Click - CLI 框架
- Rich - 终端格式化
- Bandit、ESLint、ShellCheck 及其他 39+ 开源安全工具

**灵感来源:**
- Bandit(Python 安全)
- SonarQube(多语言分析)
- Semgrep(基于模式的安全)
- Mega-Linter(全面 linting)

---

## 📖 指南

- **[快速入门](https://github.com/pantheon-security/medusa/blob/main/docs/guides/quick-start.md)** - 5 分钟内开始使用
- **[AI 安全扫描](https://github.com/pantheon-security/medusa/blob/main/docs/AI_SECURITY.md)** - AI/LLM 安全完整指南(OWASP 2025、MCP、RAG)
- **[处理误报](https://github.com/pantheon-security/medusa/blob/main/docs/guides/handling-false-positives.md)** - 减少噪音,发现真正的问题
- **[IDE 集成](https://github.com/pantheon-security/medusa/blob/main/docs/guides/ide-integration.md)** - 配置 Claude Code、Gemini、Copilot

---

## 📞 支持

- **GitHub Issues**:[报告 Bug 或请求功能](https://github.com/Pantheon-Security/medusa/issues)
- **邮箱**:[email protected]
- **文档**:https://docs.pantheonsecurity.io
- **Discord**:https://discord.gg/medusa(即将上线)

---

## 📈 统计数据

**版本**:2026.5.5
**发布日期**:2026-04-03
**检测模式**:40,000+ AI 安全规则
**分析器**:79 个专业扫描器
**误报过滤模式**:514 个智能过滤器(误报率降低 96.8%)
**CVE 覆盖**:200 个严重漏洞(37+ AI 编辑器 CVE)
**仓库投毒**:可检测 28+ 种 AI 编辑器配置文件类型
**语言覆盖**:46+ 种文件类型
**平台支持**:Linux、macOS、Windows
**AI 集成**:Claude Code、Gemini CLI、GitHub Copilot、Cursor、OpenAI Codex
**标准**:OWASP Top 10 for LLM 2025、MITRE ATLAS
**下载量**:PyPI 上 11,500+

---

## 🌟 为什么选择 MEDUSA?

### 与 Bandit 对比
- ✅ 40,000+ 模式(不仅仅是 Python 安全)
- ✅ AI/ML 安全覆盖
- ✅ 零配置要求
- ✅ IDE 集成

### 与 SonarQube 对比
- ✅ 更简单的安装(`pip install && scan`)
- ✅ 无需服务器
- ✅ AI 优先的安全重点
- ✅ 免费且开源

### 与 Semgrep 对比
- ✅ 内置 AI/ML 专用规则
- ✅ MCP、RAG、Agent 安全
- ✅ 更优秀的 IDE 集成
- ✅ 无需规则配置

### 与传统 SAST 对比
- ✅ 立即可用(无需安装工具)
- ✅ 包含 AI 安全模式
- ✅ 并行处理
- ✅ 智能缓存

---

**🐍🐍🐍 MEDUSA - 多语言安全扫描器 🐍🐍🐍**

**一条命令。全面安全。**```bash
medusa init && medusa scan .

最后更新:2026-04-03 状态:生产就绪 当前版本:v2026.5.5 - 安全加固

下载工具