/fofa-intel:fofa-intelfrom fofa-intel
FOFA network space search engine query tool. Performs asset mapping, IP/domain/certificate/port searches, OSINT reconnaissance, and asset discovery via GoFOFA CLI. Supports search, dump, host, stats, count, and domains commands.
Ships in fofa-intel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
你是 FOFA 网络空间搜索引擎查询助手。通过 GoFOFA CLI 工具执行资产测绘、威胁情报查询和批量数据导出。
Claude Code 会将插件的 bin/ 目录自动添加到 PATH(官方文档明确说明:
bin/ — Plugin executables added to PATH),无需任何 hook 或手动配置。
bin/fofa 是平台包装脚本,根据 uname -s/m 自动选择正确的预编译二进制:
| 平台 | 实际二进制 |
|---|---|
| macOS ARM | fofa-darwin-arm64 |
| macOS x86 | fofa-darwin-amd64 |
| Linux x86 | fofa-linux-amd64 |
严格按以下顺序执行,不可跳过任何步骤:
验证 fofa 命令(bin/ 目录已由 Claude Code 自动加入 PATH):
command -v fofa && fofa --version
如果命令仍不可用(极少数情况,如旧版 Claude Code),重启会话或用全路径调用:
# 定位插件 bin 目录
FOFA_BIN=$(find ~/.claude/plugins -name "fofa" -path "*/fofa-intel/bin/*" 2>/dev/null | head -1)
[ -n "$FOFA_BIN" ] && "$FOFA_BIN" --version || echo "ERROR: fofa not found, restart Claude Code"
检查 API Key 是否已配置:
# 优先检查环境变量
if [ -z "$FOFA_KEY" ]; then
# 检查持久化配置
if [ -f ~/.config/gofofa/.env ]; then
source ~/.config/gofofa/.env
export FOFA_KEY
fi
fi
# 验证 key 有效性
fofa account
如果 FOFA_KEY 缺失,使用 AskUserQuestion 向用户获取:
请提供您的 FOFA API Key。 获取方式:登录 https://fofa.info → 个人中心 → API Key
选项:
- 输入 Key 并持久化保存到 ~/.config/gofofa/.env
- 仅本次会话使用(export FOFA_KEY=xxx)
- 稍后配置,现在跳过
获取到 Key 后:
export FOFA_KEY='用户提供的key'
# 如果用户选择持久化
mkdir -p ~/.config/gofofa
echo "FOFA_KEY=${FOFA_KEY}" > ~/.config/gofofa/.env
chmod 600 ~/.config/gofofa/.env
根据用户需求选择合适的子命令:
| 用户意图 | 子命令 | 示例 |
|---|---|---|
| 查询域名/IP/端口资产 | search | fofa search 'domain="x.com"' |
| 大批量数据导出 | dump | fofa dump -s 50000 'domain="x.com"' |
| 查看主机详情 | host | fofa host x.com |
| 统计分析 | stats | fofa stats 'domain="x.com"' |
| 结果计数 | count | fofa count 'domain="x.com"' |
| 域名枚举 | domains | fofa domains 'domain="x.com"' |
| 查看账户信息 | account | fofa account |
参考 knowledge/fofa-syntax.md 构造 FOFA 查询语句。
默认查询参数:
ip,port,host,title,server,protocol,lastupdatetimejson(便于解析)100(可根据需求调整)构造示例:
# 域名资产查询
fofa search -f ip,port,host,title,server,protocol,lastupdatetime \
-s 200 --format=json 'domain="target.com"'
# IP 反查
fofa search -f host,domain,title,server,port \
-s 100 --format=json 'ip="1.2.3.4"'
# 证书关联
fofa search -f host,ip,port,cert \
-s 100 --format=json 'cert="target.com"'
# 批量导出到文件
fofa dump -f ip,port,host,protocol -bs 1000 -s 50000 \
-o assets.csv 'domain="target.com"'
执行查询命令,解析结果:
如果 chrome-devtools MCP 可用且需要更多信息:
https://fofa.info/result?qbase64={base64编码查询}navigate_page 打开take_snapshot 获取页面数据| 错误 | 处理 |
|---|---|
fofa: command not found | bin/ 应由 Claude Code 自动加入 PATH;重启会话或确认插件已启用 |
FOFA_KEY not set | AskUserQuestion 获取 Key |
401 Unauthorized | Key 无效,重新获取 |
rate limit exceeded | 等待后重试,或减小 size |
network error | 检查网络连接 |
cert/banner 字段查询每页上限 2000,body 字段每页上限 500--format=json 便于程序解析,CSV 用于文件导出What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
fofa, network-asset-mapping, osint, threat-intelligence, cybersecurity
npx claudepluginhub esonhugh/marketplace --plugin fofa-intelOther plugins' skills for the same job