Claude Code 安全工具链安装全记录¶
日期:2026-04-11 环境:macOS Darwin 25.3.0 (Apple Silicon) / Claude Code + Opus 4.6 目标:为 Claude Code 安装 5 个网络安全相关扩展(HTB MCP、渗透插件、Skills、Agents)
一、安装目标清单¶
| # | 工具 | 来源 | 用途 |
|---|---|---|---|
| 1 | HTB MCP Server | github.com/noaslr/htb-mcp-server | HTB 平台 API 集成(列靶机、提交 flag) |
| 2 | Blackbox Claude Plugin | github.com/allsmog/blackbox-claude-plugin | HTB 靶机自动化黑盒渗透 |
| 3 | Transilience Community Tools | github.com/transilienceai/communitytools | 23 个渗透 Skills + 10 个 Agents |
| 4 | Awesome Security Skills | github.com/Eyadkelleh/awesome-claude-skills-security | SecLists 字典 + LLM 安全测试 |
| 5 | Claude Bug Bounty Framework | github.com/shuvonsec/claude-bug-bounty | Bug Bounty 全流程技能 + 斜杠命令 |
二、环境检查¶
安装前先确认已有环境和缺失依赖。
2.1 检查 Claude Code 现有配置¶
结果: 已有 settings.json,配置了 Playwright MCP Server,其余为空白状态。
{
"model": "opus",
"mcpServers": {
"playwright": {
"command": "/opt/homebrew/bin/npx",
"args": ["@playwright/mcp@latest"]
}
}
}
2.2 检查目录结构¶
ls ~/.claude/plugins/ # 已有 marketplaces 相关文件
ls ~/.claude/skills/ # 不存在
ls ~/.claude/agents/ # 不存在
ls ~/.claude/commands/ # 不存在
2.3 检查关键依赖¶
which go && go version # Go → 未安装 ❌(HTB MCP Server 需要编译)
which nmap # nmap → /opt/homebrew/bin/nmap ✅
三、解决依赖问题¶
3.1 问题:Go 未安装¶
发现方式: which go 返回空,而 HTB MCP Server 是 Go 项目,需要 go build 编译。
解决方案:
结果: 安装 go 1.26.2 (arm64),耗时约 30 秒。
四、逐步安装过程¶
4.1 并行克隆所有仓库¶
五个仓库之间无依赖关系,并行执行节省时间:
# 1. HTB MCP Server → 临时目录(需要编译后移动)
git clone https://github.com/noaslr/htb-mcp-server.git /tmp/htb-mcp-server
# 2. Blackbox Plugin → 直接克隆到 plugins 目录
git clone https://github.com/allsmog/blackbox-claude-plugin.git \
~/.claude/plugins/blackbox-claude-plugin
# 3. Transilience → 临时目录(需要挑选子目录安装)
git clone https://github.com/transilienceai/communitytools.git /tmp/communitytools
# 4. Security Skills → 临时目录
git clone https://github.com/Eyadkelleh/awesome-claude-skills-security.git \
/tmp/awesome-claude-skills-security
# 5. Bug Bounty → 临时目录
git clone https://github.com/shuvonsec/claude-bug-bounty.git /tmp/claude-bug-bounty
设计思路: - Blackbox Plugin 有自己的 plugin 结构,直接放 ~/.claude/plugins/ 即可 - 其余项目需要从仓库中提取特定文件安装到对应位置,先克隆到 /tmp
4.2 编译 HTB MCP Server¶
cd /tmp/htb-mcp-server
go build -o htb-mcp-server .
# 创建专用 bin 目录存放二进制
mkdir -p ~/.claude/bin
cp htb-mcp-server ~/.claude/bin/
输出文件: ~/.claude/bin/htb-mcp-server(8.6MB,可执行)
4.3 探索各仓库结构¶
安装前先了解每个项目的目录结构,确定哪些文件需要复制到哪里:
# Transilience 的核心文件在 projects/pentest/.claude/ 下
ls /tmp/communitytools/projects/pentest/.claude/
# → agents/ skills/ tools/
ls /tmp/communitytools/projects/pentest/.claude/skills/
# → 23 个技能目录(reconnaissance, injection, api-security 等)
ls /tmp/communitytools/projects/pentest/.claude/agents/
# → 10 个 Agent 文件(pentester-orchestrator.md, hackthebox.md 等)
# awesome-claude-skills-security 结构
ls /tmp/awesome-claude-skills-security/
# → seclists-categories/(fuzzing, passwords, payloads 等)
# → LLM_Testing/
# claude-bug-bounty 结构
ls /tmp/claude-bug-bounty/
# → skills/(9 个子目录)
# → commands/(13 个 .md 斜杠命令)
# → SKILL.md(主技能清单)
关键发现: 每个项目的目录组织方式不同,需要分别处理。
4.4 安装 Transilience Skills & Agents¶
mkdir -p ~/.claude/skills ~/.claude/agents
# 复制 23 个渗透技能
cp -r /tmp/communitytools/projects/pentest/.claude/skills/* ~/.claude/skills/
# 复制 10 个 AI Agent
cp -r /tmp/communitytools/projects/pentest/.claude/agents/* ~/.claude/agents/
安装的 Skills(23 个): ai-threat-testing, api-security, authentication, client-side, cloud-containers, coordination, cve-poc-generator, essential-tools, github-workflow, hackerone, hackthebox, infrastructure, injection, osint, reconnaissance, server-side, skiller, social-engineering, source-code-scanning, system, techstack-identification, transilience-report-style, web-app-logic
安装的 Agents(10 个): pentester-orchestrator, pentester-executor, pentester-validator, script-generator, patt-fetcher, skiller, hackthebox, hackerone 等
4.5 安装 Security SecLists Skills¶
mkdir -p ~/.claude/skills/security-seclists
# 复制 SecLists 分类
cp -r /tmp/awesome-claude-skills-security/seclists-categories/* \
~/.claude/skills/security-seclists/
# 复制 LLM 安全测试
cp -r /tmp/awesome-claude-skills-security/LLM_Testing \
~/.claude/skills/security-seclists/
4.6 安装 Bug Bounty Framework¶
mkdir -p ~/.claude/skills/bug-bounty ~/.claude/commands
# 主技能清单
cp /tmp/claude-bug-bounty/SKILL.md ~/.claude/skills/bug-bounty/
# 9 个技能子目录
cp -r /tmp/claude-bug-bounty/skills/* ~/.claude/skills/bug-bounty/
# 13 个斜杠命令(/recon, /hunt, /validate 等)
cp -r /tmp/claude-bug-bounty/commands/* ~/.claude/commands/
安装的斜杠命令: /autopilot /chain /hunt /intel /recon /remember /report /resume /scope /surface /triage /validate /web3-audit
4.7 配置 HTB MCP Server¶
编辑 ~/.claude/settings.json,在 mcpServers 中添加 HTB 条目:
{
"model": "opus",
"mcpServers": {
"playwright": {
"command": "/opt/homebrew/bin/npx",
"args": ["@playwright/mcp@latest"]
},
"htb-mcp-server": {
"command": "/Users/x/.claude/bin/htb-mcp-server",
"env": {
"HTB_TOKEN": "YOUR_HTB_API_TOKEN_HERE"
}
}
}
}
注意: 需要手动替换
YOUR_HTB_API_TOKEN_HERE为真实的 HTB API Token。 获取方式:HTB 网站 → Profile Settings → App Tokens → 生成 JWT Token。
五、遇到的问题与解决思路¶
问题 1:Go 编译器缺失¶
| 项目 | 说明 |
|---|---|
| 现象 | which go 返回空 |
| 影响 | 无法编译 HTB MCP Server(Go 项目) |
| 思路 | macOS 上用 Homebrew 是最简单的方式 |
| 解决 | brew install go |
| 耗时 | ~30 秒 |
问题 2:各项目安装方式不统一¶
| 项目 | 说明 |
|---|---|
| 现象 | 5 个项目各自有不同的目录结构和安装方式 |
| 影响 | 不能一刀切,需要逐个分析安装位置 |
| 思路 | 先 ls 探查结构,确认核心文件在哪,再 copy 到 Claude Code 约定目录 |
| 解决 | Blackbox → plugins 目录;Transilience → skills + agents;Security → skills 子目录;Bug Bounty → skills + commands |
问题 3:HTB MCP Server 是二进制,非 npm 包¶
| 项目 | 说明 |
|---|---|
| 现象 | 不像 Playwright MCP 可以直接 npx 运行 |
| 影响 | 需要本地编译并指定绝对路径 |
| 思路 | 创建 ~/.claude/bin/ 统一存放自编译的 MCP 二进制 |
| 解决 | go build → 复制到 ~/.claude/bin/ → settings.json 用绝对路径引用 |
问题 4:HTB Token 需要用户手动填入¶
| 项目 | 说明 |
|---|---|
| 现象 | MCP Server 需要 JWT Token 认证 |
| 影响 | 自动安装无法完成这一步 |
| 思路 | 配置文件中留占位符,提示用户后续填入 |
| 解决 | "HTB_TOKEN": "YOUR_HTB_API_TOKEN_HERE" + 文档说明获取方式 |
六、最终目录结构¶
~/.claude/
├── bin/
│ └── htb-mcp-server # HTB MCP 二进制
├── plugins/
│ └── blackbox-claude-plugin/ # HTB 黑盒渗透插件
├── skills/
│ ├── reconnaissance/ # ┐
│ ├── injection/ # │
│ ├── api-security/ # │ Transilience
│ ├── authentication/ # │ (23 个 Skills)
│ ├── ... (共 23 个) # ┘
│ ├── security-seclists/ # Awesome Security Skills
│ │ ├── web-shells/
│ │ └── LLM_Testing/
│ └── bug-bounty/ # Bug Bounty Framework (9 个)
│ ├── SKILL.md
│ ├── bb-methodology/
│ ├── web2-recon/
│ └── ...
├── agents/
│ ├── pentester-orchestrator.md # ┐
│ ├── pentester-executor.md # │ Transilience Agents
│ ├── hackthebox.md # │ (10 个)
│ └── ... # ┘
├── commands/
│ ├── recon.md # ┐
│ ├── hunt.md # │ Bug Bounty 斜杠命令
│ ├── validate.md # │ (13 个)
│ └── ... # ┘
└── settings.json # MCP Server 配置
七、验证安装¶
# HTB MCP Server
ls -la ~/.claude/bin/htb-mcp-server
# → -rwxr-xr-x 8609266 字节 ✅
# Blackbox Plugin
ls ~/.claude/plugins/blackbox-claude-plugin/README.md
# → 存在 ✅
# Transilience
ls ~/.claude/skills/ | wc -l # → 25+(含子目录)
ls ~/.claude/agents/ | wc -l # → 10
# Bug Bounty Commands
ls ~/.claude/commands/ | wc -l # → 13
重启 Claude Code 后所有工具生效。 HTB MCP Server 需填入真实 Token 后才可用。
八、使用提示¶
- 所有工具按需触发,不会自动启动,不影响日常使用性能
- HTB 靶机实战:用
/bb-setup检查渗透工具就绪状态 - 全流程渗透:用
/coordination https://target启动 Transilience 协调器 - Bug Bounty:用
/recon、/hunt、/validate走完 BB 流程 - SecLists 字典在 SQL 注入、模糊测试等场景中自动被 Skills 调用