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

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

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

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

工具目录

分类

查看所有分类
Loading categories
masq — 针对 AI 代理基础设施的实时侦察与安全态势审计:扫描 MCP 配置、会话日志和 API,以发现密钥、被投毒的目录及 CoT 泄露。 | Kitploit
工具/GitLabGitLab/wattocyber/masq
侦察静态分析漏洞分析API安全测试配置审计秘密检测供应链安全AI 安全日志分析
GitLabwattocyber/masq

masq

针对 AI 代理基础设施的实时侦察与安全态势审计:扫描 MCP 配置、会话日志和 API,以发现密钥、被投毒的目录及 CoT 泄露。

查看仓库
3天前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
网站

masq:坐上智能体的座位

文艺复兴时期的假面舞会。坐上智能体的座位。

masq

坐上智能体的座位。

这款 CLI 像模型一样说 MCP 与 OpenAI 兼容协议,然后像 linpeas 那样输出报告。报告既有发现,也有修复建议。不含利用载荷。不解密 CoT。

是什么对智能体基础设施的实时侦察:MCP 配置、监听端口、会话日志、加密思维链回显、未认证 API、目录投毒、技能树。
面向谁Hermes、Grok、Claude、Cursor、VS Code、Codex 以及本地模型栈的运维者——他们需要看到智能体所能看到的东西。
不是什么不是越狱提示生成器。不是 arXiv:2608.09867 的弱模型解码器。不是运行时网关。
状态Beta。公开门槛是离线 cargo test。实时 --lab 只用于你拥有的主机。
许可证MIT

pipeline license rust

为什么会有这个工具

静态 MCP 扫描器(Invariant mcp-scan、mcp-security-scan)会对模式和配置做 lint。健康检查器只会 ping initialize。缺口在于座位:

  1. 加密的推理 blob 会回显给客户端,并存入会话日志。它们可以跨会话、跨用户、跨更弱的姐妹模型复用(arXiv:2608.09867)。抓取 315k 个公开 blob 找回了 182 个凭据。masq 检测这些 blob,但不对其解码。
  2. 相当大比例的公共 MCP 服务器没有认证。只要能 initialize,你就是这个智能体。
  3. 本地模型端口(:11434、:8000)常常无 bearer 令牌地绑定 0.0.0.0。

复用而非重写轮子:现成的目录检测器 + pin/check、netstat、仅 GET 的 ureq、以 OWASP MCP Top 10 作为发现分类体系。我们没有克隆 mcp-scan 或 mcp-security-scan。

安装

root@kitploit:~
git clone https://gitlab.com/WattoCyber/masq.git
cd masq
cargo install --path .
# binary: masq
cargo test
# expect: exit 0

World 套件(用二进制跑固定样本、本地 mock、本机侦察):

root@kitploit:~
python scripts/world_suite.py
# field = ~/.grok/sessions  lab = allowlisted hosts  bench = frozen-corpus wall
python scripts/world_suite.py --lanes all

从桌面端部署到 Kali 风格的远程主机:

root@kitploit:~
MASQ_REMOTE_HOST=user@host bash scripts/deploy_kali.sh
# on the box:
~/.local/bin/masq --plain
MASQ_LAB_HOSTS=... ~/.local/bin/masq --lab --plain

常规用法

root@kitploit:~
masq                         # live stream + posture report (includes skills)
masq --lab                   # same, plus allowlisted homelab hosts
masq tui                     # boxed TUI, stays until Ctrl+C
masq --plain                 # report only, no live stream
masq --json                  # machine report
masq recon                   # same dump, recon only
masq sniff ~/.grok/sessions  # CoT / secrets in session logs
masq sniff --timeline PATH   # file-order blob/secret/reason lines (no decrypt)
masq api                     # GET /v1/models on local (and --lab) ports
masq sit --url http://127.0.0.1:4443/mcp
masq chameleon --url http://127.0.0.1:4443/mcp -o /tmp/chameleon
masq chameleon --url ws://127.0.0.1:9000/mcp -o /tmp/chameleon
masq chameleon --url unix:///tmp/mcp.sock -o /tmp/chameleon
masq chameleon --token-file ~/.secrets/mcp.txt --url http://127.0.0.1:9/mcp -o /tmp/chameleon
masq chameleon -- python -m their_mcp -o /tmp/chameleon
# then: npx -y @copilotkit/aimock --config /tmp/chameleon/aimock.json
masq discover                # find VS Code / Cursor / Claude / Grok / Hermes MCP configs
masq proxy --upstream http://127.0.0.1:4443/mcp --block
masq sast ./server           # local sinks (semgrep if present)
masq classify --url http://127.0.0.1:4443/mcp --lab
masq overnight --lab --hours 6
masq map --from reports/overnight-YYYYMMDD/latest.json

# catalog
masq fixtures/t3_line_jump.json
masq fixtures/clean_calculator.json --trusted
masq pin fixtures/clean_calculator.json -k calc
masq check fixtures/clean_calculator.json -k calc
masq detectors

退出码:0 干净 · 2 发现数 ≥ --fail-on(默认 high)· 1 错误。

TUI 为可选开启(masq tui 或 --tui)。在 tty 上默认先是 linpeas 式实时流,然后输出报告。Cron 场景请用 --plain / --no-color。

命令

别名:doctor / audit → scan。chameleon → mimic。posture → seat。

模块与 OWASP MCP Top 10 的对照

传输与认证

sit / chameleon 支持的传输:

  • Streamable HTTP (http://)
  • HTTP+SSE(先 GET 端点事件,再 POST)
  • ws://
  • unix: 与 npipe:
  • stdio(--framing auto 先试 NDJSON,再试 Content-Length)

认证(绝不会写入报告):

  • --token-file PATH(第一行会成为 Authorization: Bearer …)
  • --token-env VAR
  • --header "Name: value"(可重复)

wss:// 未内置。用 Stunnel 转到 ws://,或使用 HTTP。HTTP 不跟随任何重定向。

Stdio 的 initialize 不会通告 sampling。标记服务器通告的 sampling / elicitation。文档 URL(model-catalog.json、/docs/)会被有意忽略。

masq 能发现的宿主应用

$HOME / %USERPROFILE% 下的配置与技能根目录:

VS Code、Cursor、Windsurf、Claude Desktop、Claude Code、Grok、Hermes、Codex、Continue、Gemini CLI、Amp、Kiro、OpenCode、Amazon Q、Antigravity、OpenClaw。

以及 cwd 下的 .mcp.json 和 MASQ_EXTRA_CONFIG(OS 路径列表)。

Lab 白名单(--lab)

--lab 是白名单,不是 /24 扫描。它由操作者配置。除回环地址外没有编译进任何内容。

  • MASQ_LAB_HOSTS 环境变量:以逗号、空格或换行分隔的 host:port 或主机名。
  • .masq/lab-hosts 文件:每行一个主机,# 为注释。

示例:

root@kitploit:~
export MASQ_LAB_HOSTS="192.0.2.10,192.0.2.11"
masq --lab

API 探测和 TUI fleet 汇总会读取 MASQ_LAB_HOSTS。MASQ_SIT_URLS(或 --mcp-url)为 --lab 提供要 sit 的 MCP URL。

非回环的 sit --url 需要 --lab 且目标在白名单中。回环上的未认证 initialize 是 High。离开本机则是 Critical。

不要把 proxy 指向你不会 sit 的主机。

硬性限制

Sniff 优先级:先 chat_history.jsonl,再 Hermes 的 request_dump_*,然后其他 jsonl。遍历会完整走完,不会只保留 WalkDir 的前 300 个命中。要更深入,请用 masq sniff <单个会话目录>。

Overnight(夜间巡检)

root@kitploit:~
masq overnight --lab --hours 6 --interval-mins 20
# writes <cwd>/reports/overnight-YYYYMMDD/{latest.json,latest.md,latest.txt,delta.txt}

不修改配置。不会对实时服务器执行 tools/call。delta.txt 为 baseline / no_change / CHANGE,外加 + 严重级别 标题 与 - 严重级别 标题。

classify --llm 和 TUI 分诊附加功能是仅有的 completions POST(Grok /v1/chat/completions,操作者确认)。没有密钥:仅本地修复建议。密钥来自 XAI_API_KEY 或 ~/.secrets/xai.txt。绝不转储。

架构

root@kitploit:~
CLI (clap)  masq
  → seat | recon | sniff | api | sit | chameleon
  → discover | proxy | sast | classify | overnight | map
  → scan | multi | pin | check | detectors | tui
  → client (HTTP / SSE / ws / unix / npipe / stdio)
  → normalize (full-schema walk, caps)
  → detectors + sniff + recon + sit findings
  → report (text / JSON / Markdown) + optional TUI

库 crate:masq(scan_from_tools_list、scan_stdio、run_seat、PostureReport)。

坦诚的边界

不要转储 ~/.secrets。recon 只统计文件。输出“路径 + loaded”。

离线测试

root@kitploit:~
cargo test
cargo clippy --all-targets -- -D warnings

预期退出码为 0。

固定样本:T1 描述投毒、T3 跳行、T6 参数名、T8 ANSI、T13 重复名称、pin 抽换、多列表、tests/mock_mcp_server.py 下的实时 NDJSON mock。

密钥不会进入 git(reports/、data/、.env、*.key、secrets/、.masq/)。

许可证

MIT。版权所有 2026 SamsonCyber。

下载工具
命令作用
seat(默认)完整态势:recon + sniff + api + skills + 可选 sit。
recon配置文件、监听端口、影子 URL、sudo argv、未固定的 npx/uvx。
sniff在会话日志中查找密钥、明文推理、加密 CoT 回显。
sniff --timeline按文件顺序输出 T0001 行。不解密。每文件上限 200 个事件。
api在回环上仅用 GET 请求 /v1/models(及同类端点);--lab 会加入白名单对端。
sit说 MCP:initialize、notifications/initialized、tools/list、prompts/list、resources/list。绝不主动发起 tools/call。
chameleon / mimic对实时目录或文件目录执行 sit,写出 catalog.json + aimock.json + calls.json。示例 tools/call 信封仅供 aimock 使用。
discover打印已知的智能体 MCP 配置路径。不生成进程。
proxy转发智能体的 JSON-RPC。--block 会拒绝形似密钥的 tools/call 参数/结果。默认监听 127.0.0.1:9877。
sast本地源码中的 sink。若已安装 semgrep 则使用之。
classify对实时 tools/list 做本地 IPI / 投毒审查。--llm 会询问 Grok(操作者密钥)。
overnight反复执行 seat,直到 --hours 时间过去。写报告。不修改配置。
map对保存的 posture JSON 做文本攻击路径查询。不画图。
scan / multi静态目录 lint(裸 .json 路径会重写为这条命令)。
pin / check内容哈希 pin 存储(.masq/pins.json),用于防目录抽换的 CI。
detectors打印目录规则包。
tui带边框的 seat。一直运行到 Ctrl+C。
模块覆盖范围
reconMCP01 密钥路径、MCP04 未固定的 npx/uvx、MCP07/09 监听端口与影子 URL、MCP05 sudo argv
catalogMCP03 模式投毒 / 遮蔽 / 抽换
skills对 SKILL.md 应用相同的目录检测器(Hermes、Grok、Claude、Cursor、Codex、Gemini、Amp、Kiro、OpenCode、OpenClaw)。不依赖 Snyk 云。
sitMCP02 权限蔓延、MCP03 实时 tools/list、MCP07 未认证 initialize、服务器通告 sampling/elicitation、Streamable HTTP(2025-06-18)及早期 HTTP+SSE(2024-11-05)、Origin DNS 重绑定
sniffMCP01 + MCP10 + arXiv:2608.09867 加密 CoT 回显(包括 thinkingSignature)
apiMCP07 未认证 /v1/models、MCP09 LAN 绑定
watch对 .masq/pins.json + skills 做 pin 差异比对。overnight 会启用它。不是代理。
fleet将 lab 白名单汇总进一个 FLEET 区块
map对 posture 报告做文本路径查询
限制值
tools/list 文件8 MiB
sniff 文件8 MiB(更大时仅采样前 2 MiB)
sniff 文件数 / 扫描根300(优先级内取最新 mtime)
timeline 事件 / 文件200,之后输出 timeline truncated
timeline T 行数500(inspect 与 collapse 仍会运行)
schema 遍历深度64
每个清单的 tools 数5_000
HTTP 探测仅 GET,API 2s / sit 5s
sit 握手超时 + 终止
本工具本工具不会
以智能体客户端的身份 sit(initialize + list)对实时服务器主动发起 tools/call
检测日志中的加密 CoT 回显解密 CoT 或将其重放给更弱的模型
GET /v1/modelsPOST completions(可选开启的 TUI 分诊 / classify --llm 除外)
对目录做 pin 哈希防抽换签名 PKI / 企业级 pin 保险库
在 proxy --block 中转发智能体的 tools/call完整运行时 DLP 网关 / SaaS 控制面
本地技能树 lintSnyk / 云端 SCA
检查项预期
masq fixtures/clean_calculator.json --trustedexit 0
masq fixtures/t3_line_jump.jsonexit 2
masq fixtures/t13_duplicate_names.jsonexit 2(工具遮蔽)
masq sniff --timeline fixtures/(非 TTY / --json)仅带该标志时输出 T0001
masq chameleon fixtures/clean_calculator.json -o <tmpdir>catalog.json、aimock.json、calls.json
实时运行 masq --no-color令牌已脱敏(…,而非完整 sk-)