cyberspacesec/iconhash-skills
GitHub: cyberspacesec/iconhash-skills
一款用于网络空间测绘的 Favicon 哈希计算与 Web 服务识别工具,支持 CLI、Go SDK、HTTP API 及 MCP 多种接入方式。
Stars: 0 | Forks: 0
🔍 IconHash Skills
用于网络空间测绘的 Favicon 哈希计算器
计算 favicon 的 MMH3 哈希并识别 Web 服务,用于网络安全侦察。
🇬🇧 English | 🇨🇳 简体中文
## 🚀 接入方式
IconHash 支持 **4 种接入方式** —— 根据你的工作流选择:
| # | 方式 | 适用场景 | 快速开始 |
|---|--------|----------|-------------|
| 1 | **🧠 SKILLS** | AI Agent (Claude, GPT 等) | 一键复制下方内容 ↓ |
| 2 | **💻 CLI** | 终端用户、脚本 | [安装 CLI](#installation) |
| 3 | **📦 Go SDK** | Go 开发者、嵌入式集成 | `go get github.com/cyberspacesec/iconhash-skills` |
| 4 | **🔌 MCP / API** | AI 工具、Web 服务、自动化 | [API 与 MCP](#api-server--mcp) |
### 🧠 SKILLS 接入(面向 AI Agent)
将此内容添加到你的 AI Agent 技能配置中,为其赋予 favicon 哈希计算和 Web 服务识别能力:
```
# IconHash Skills — 用于 Cyber-Space Mapping 的 Favicon Hash 计算器
## 功能介绍
Calculate MMH3 favicon hashes and identify web services from their favicons. Output search queries for Fofa, Shodan, Censys, Quake, ZoomEye, Hunter.
## 安装方法
### 选项 A:下载 binary(推荐)
Linux x86_64: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_linux_x86_64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
macOS Apple Silicon: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_aarch64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
macOS Intel: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_x86_64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
### 选项 B:从源码编译
`git clone https://github.com/cyberspacesec/iconhash-skills.git && cd iconhash-skills && make build && sudo mv iconhash /usr/local/bin/`
### 选项 C:Go install
`go install github.com/cyberspacesec/iconhash-skills/cmd/iconhash@latest`
## 可用命令
- `iconhash url
` — Calculate hash from favicon URL
- `iconhash file ` — Calculate hash from local file
- `iconhash base64 ` — Calculate hash from base64 file
- `iconhash discover ` — Discover all favicons on a website and hash them
- `iconhash identify ` — Full identification: discover + hash + fingerprint lookup
- `iconhash lookup ` — Lookup a hash in the fingerprint database (700+ services)
- `iconhash batch -i urls.txt` — Batch hash URLs from file or stdin
- `iconhash fingerprints` — Browse/search fingerprint database
- `iconhash fingerprints update` — Update fingerprint database from remote
- `iconhash server -p 8080` — Start HTTP API server
## 关键 flags
- `--engine fofa|shodan|censys|quake|zoomeye|hunter` — Output format for search engines
- `--insecure` — Skip TLS verification
- `--proxy socks5://host:port` — Use proxy
- `--fingerprint-db ` — Custom fingerprint database
- `--uint32` — Output as uint32 instead of int32
## 示例
- `iconhash url https://example.com/favicon.ico` → hash: -305179312
- `iconhash identify https://gitlab.example.com` → discover favicons, hash them, match fingerprints
- `iconhash lookup -- -305179312` → identify service from hash
- `iconhash url https://example.com/favicon.ico --engine fofa` → icon_hash="-305179312"
## 完整文档
See https://github.com/cyberspacesec/iconhash-skills/blob/main/SKILLS.md
```
## 功能特性
- 🧮 计算 favicon 的 MMH3 (MurmurHash3) 哈希
- 🌐 多种输入源:URL、本地文件、base64 数据、stdin
- 🔎 6 种搜索引擎格式:Fofa, Shodan, Censys, Quake, ZoomEye, Hunter
- 🏷️ 包含 700+ 已知服务的指纹数据库,支持识别
- ⚡ 支持并发工作池的批量处理
- 🖥️ 带有认证功能的 HTTP API 服务器
- 🤖 支持模型上下文协议 (MCP),便于 AI 集成
- 📦 完整的 Go SDK,可嵌入其他工具
- 🐳 支持 Docker 容器化部署
- 📋 用于 AI Agent 集成的 SKILLS 文档
- 🏗️ 两种构建变体:Lite(小体积)和 Full(离线可用)
## 安装
### 下载预构建二进制文件(推荐)
从 [GitHub Releases](https://github.com/cyberspacesec/iconhash-skills/releases/latest) 下载。
**构建变体:**
- **Lite** (`iconhash_lite_*`):更小的二进制,指纹在首次使用时自动下载
- **Full** (`iconhash_full_*`):包含内嵌指纹的较大二进制,支持离线工作
```
# Linux x86_64 (Lite)
wget https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_linux_x86_64.tar.gz
tar xzf iconhash_lite_linux_x86_64.tar.gz
chmod +x iconhash && sudo mv iconhash /usr/local/bin/
# macOS Apple Silicon (Lite)
wget https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_aarch64.tar.gz
tar xzf iconhash_lite_macos_aarch64.tar.gz
chmod +x iconhash && sudo mv iconhash /usr/local/bin/
# Windows x86_64(下载并解压 zip)
# https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_windows_x86_64.zip
```
**支持的平台:** Linux (x86_64, aarch64, i386, arm, riscv64), macOS (x86_64, aarch64), Windows (x86_64, aarch64, i386), FreeBSD (x86_64, aarch64)
### 通过 Go 安装
```
go install github.com/cyberspacesec/iconhash-skills/cmd/iconhash@latest
```
### 从源码编译
```
git clone https://github.com/cyberspacesec/iconhash-skills.git
cd iconhash-skills
# Lite build(默认)
make build
# Full build(内嵌 fingerprints,支持离线使用)
make build-full
```
### Docker
```
docker pull cyberspacesec/iconhash:latest
docker run --rm cyberspacesec/iconhash:latest url https://example.com/favicon.ico
```
## 快速开始
```
iconhash url https://www.example.com/favicon.ico # Hash from URL
iconhash identify https://example.com # Identify a website
iconhash lookup -- -305179312 # Lookup fingerprint
iconhash batch -i urls.txt -o results.json # Batch process
iconhash server -p 8080 # Start API server
```
## 💻 CLI 参考
| 命令 | 用途 |
|---|---|
| `iconhash url ` | 从 URL 计算哈希 |
| `iconhash file ` | 从文件计算哈希 |
| `iconhash base64 ` | 从 base64 文件计算哈希 |
| `iconhash discover ` | 发现网站上的 favicon |
| `iconhash identify ` | 完整识别(发现 + 哈希 + 指纹) |
| `iconhash lookup ` | 在指纹数据库中查找哈希 |
| `iconhash batch -i ` | 批量处理 URL |
| `iconhash fingerprints` | 浏览/搜索指纹数据库 |
| `iconhash fingerprints update` | 更新指纹数据库 |
| `iconhash server` | 启动 HTTP API 服务器 |
### 全局参数
| 参数 | 缩写 | 说明 |
|---|---|---|
| `--engine` | `-e` | 格式:`plain`, `fofa`, `shodan`, `censys`, `quake`, `zoomeye`, `hunter` |
| `--uint32` | `-n` | 输出 uint32 而非 int32 |
| `--insecure` | `-k` | 跳过 TLS 验证 |
| `--timeout` | `-t` | HTTP 超时(默认 30s) |
| `--proxy` | | HTTP/SOCKS5 代理 URL |
| `--debug` | `-d` | 启用调试输出 |
| `--format` | | 输出:`text`, `json`, `csv` |
| `--output` | `-o` | 输出文件路径 |
| `--fingerprint-db` | | 自定义指纹数据库 |
📖 完整文档请参阅 [SKILLS.md](./SKILLS.md)。
## 📦 Go SDK
```
go get github.com/cyberspacesec/iconhash-skills
```
```
import (
"context"
"github.com/cyberspacesec/iconhash-skills/pkg/hasher"
"github.com/cyberspacesec/iconhash-skills/pkg/fingerprint"
"github.com/cyberspacesec/iconhash-skills/pkg/util"
)
// One-off hash with defaults
hash, _ := hasher.HashURL(context.Background(), "https://example.com/favicon.ico")
// Custom hasher
h := hasher.New(&hasher.HashOptions{InsecureSkipVerify: true})
hash, _ = h.HashFromURL(ctx, "https://example.com/favicon.ico")
// Full identification
db := fingerprint.DefaultDB()
results := h.Identify(ctx, "https://example.com", db, nil)
// Batch processing
results := h.BatchHashURLs(ctx, urls, 10)
// Format for all search engines
queries := util.FormatAll(hash)
// With proxy
opts, _ := hasher.NewOptionsWithProxy("socks5://127.0.0.1:1080", 30*time.Second, true)
```
## 🔌 API 服务器与 MCP
### HTTP API 服务器
```
iconhash server -p 8080 --auth-token secret123
```
| 端点 | 方法 | 说明 |
|---|---|---|
| `/health` | GET | 健康检查 |
| `/hash/url` | GET, POST | 从 URL 计算哈希 |
| `/hash/file` | POST | 从上传的文件计算哈希 |
| `/hash/base64` | POST | 从 base64 数据计算哈希 |
| `/hash/batch` | POST | 批量计算 URL 哈希 |
| `/hash/discover` | POST | 发现 favicon |
| `/lookup` | GET | 指纹查找 |
| `/fingerprints` | GET | 指纹数据库 |
| `/mcp` | POST | 模型上下文协议 |
### MCP 集成
```
import "github.com/cyberspacesec/iconhash-skills/pkg/mcp"
handler := mcp.NewHandler(false)
tools := handler.Tools()
result := handler.CallTool("iconhash_url", map[string]interface{}{
"url": "https://example.com/favicon.ico",
})
```
**MCP 工具:** `iconhash_url`, `iconhash_base64`, `iconhash_file`, `iconhash_discover`, `iconhash_lookup`
## 搜索引擎格式
| 引擎 | 格式 | 示例 |
|---|---|---|
| Fofa | `icon_hash=""` | `icon_hash="-305179312"` |
| Shodan | `http.favicon.hash:` | `http.favicon.hash:-305179312` |
| Censys | `services.http.response.favicons.md5_hash:` | |
| Quake | `favicon.hash:""` | |
| ZoomEye | `iconhash:""` | |
| Hunter | `web.icon=""` | |
## Docker
```
docker run --rm cyberspacesec/iconhash:latest url https://example.com/favicon.ico
docker run -d -p 8080:8080 cyberspacesec/iconhash:latest server -H 0.0.0.0 -p 8080
```
## 开发
```
make build # Lite build
make build-full # Full build (with fingerprints)
make test # Run tests
make test-coverage # Run tests with coverage
```
## 许可证
[MIT License](LICENSE)
## 🚀 接入方式
IconHash 支持 **4 种接入方式** —— 根据你的工作流选择:
| # | 方式 | 适用场景 | 快速开始 |
|---|------|---------|---------|
| 1 | **🧠 SKILLS** | AI Agent(Claude、GPT 等) | 一键复制 ↓ |
| 2 | **💻 CLI** | 终端用户、脚本 | [安装 CLI](#安装) |
| 3 | **📦 Go SDK** | Go 开发者、嵌入式集成 | `go get github.com/cyberspacesec/iconhash-skills` |
| 4 | **🔌 MCP / API** | AI 工具、Web 服务、自动化 | [API 与 MCP](#api-服务与-mcp) |
### 🧠 SKILLS 接入(面向 AI Agent)
将以下内容添加到你的 AI Agent 技能配置中,为其赋予 favicon 哈希计算和 Web 服务识别能力:
```
# IconHash Skills — 网络空间测绘 Favicon 哈希计算工具
## 功能描述
计算 favicon 的 MMH3 哈希,并通过指纹库识别 Web 服务。输出适用于 Fofa、Shodan、Censys、Quake、ZoomEye、Hunter 的搜索语法。
## 安装方式
### 方式 A:下载二进制文件(推荐)
Linux x86_64: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_linux_x86_64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
macOS Apple Silicon: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_aarch64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
macOS Intel: `wget -qO- https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_x86_64.tar.gz | tar xz && chmod +x iconhash && sudo mv iconhash /usr/local/bin/`
### 方式 B:源码编译
`git clone https://github.com/cyberspacesec/iconhash-skills.git && cd iconhash-skills && make build && sudo mv iconhash /usr/local/bin/`
### 方式 C:Go 安装
`go install github.com/cyberspacesec/iconhash-skills/cmd/iconhash@latest`
## 可用命令
- `iconhash url ` — 从 URL 计算 favicon 哈希
- `iconhash file ` — 从本地文件计算哈希
- `iconhash base64 ` — 从 base64 文件计算哈希
- `iconhash discover ` — 发现网站所有 favicon 并计算哈希
- `iconhash identify ` — 完整识别:发现 + 哈希 + 指纹匹配
- `iconhash lookup ` — 在指纹库中查找哈希(700+ 服务)
- `iconhash batch -i urls.txt` — 批量计算 URL 列表
- `iconhash fingerprints` — 浏览/搜索指纹数据库
- `iconhash fingerprints update` — 更新指纹数据库
- `iconhash server -p 8080` — 启动 HTTP API 服务器
## 关键参数
- `--engine fofa|shodan|censys|quake|zoomeye|hunter` — 搜索引擎输出格式
- `--insecure` — 跳过 TLS 证书验证
- `--proxy socks5://host:port` — 使用代理
- `--fingerprint-db ` — 自定义指纹数据库
- `--uint32` — 输出 uint32 而非 int32
## 示例
- `iconhash url https://example.com/favicon.ico` → 哈希: -305179312
- `iconhash identify https://gitlab.example.com` → 发现 favicon、计算哈希、匹配指纹
- `iconhash lookup -- -305179312` → 从哈希识别服务
- `iconhash url https://example.com/favicon.ico --engine fofa` → icon_hash="-305179312"
## 完整文档
查看 https://github.com/cyberspacesec/iconhash-skills/blob/main/SKILLS.md
```
## 功能特性
- 🧮 计算 favicon 的 MMH3(MurmurHash3)哈希
- 🌐 多种输入源:URL、本地文件、base64 数据、标准输入
- 🔎 6 种搜索引擎格式:Fofa、Shodan、Censys、Quake、ZoomEye、Hunter
- 🏷️ 指纹数据库包含 700+ 已知服务,支持识别
- ⚡ 批量处理,支持并发工作池
- 🖥️ HTTP API 服务器,支持认证
- 🤖 支持模型上下文协议(MCP),便于 AI 集成
- 📦 完整的 Go SDK,可嵌入其他工具
- 🐳 支持 Docker 容器化部署
- 📋 SKILLS 文档,方便 AI Agent 接入
- 🏗️ 两种构建变体:Lite(小体积)和 Full(离线可用)
## 安装
### 下载预构建二进制文件(推荐)
从 [GitHub Releases](https://github.com/cyberspacesec/iconhash-skills/releases/latest) 下载。
**构建变体:**
- **Lite**(`iconhash_lite_*`):更小的二进制,指纹首次使用时自动下载
- **Full**(`iconhash_full_*`):更大的二进制,内嵌指纹,离线可用
```
# Linux x86_64(Lite)
wget https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_linux_x86_64.tar.gz
tar xzf iconhash_lite_linux_x86_64.tar.gz
chmod +x iconhash && sudo mv iconhash /usr/local/bin/
# macOS Apple Silicon(Lite)
wget https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_macos_aarch64.tar.gz
tar xzf iconhash_lite_macos_aarch64.tar.gz
chmod +x iconhash && sudo mv iconhash /usr/local/bin/
# Windows x86_64(下载并解压 zip)
# https://github.com/cyberspacesec/iconhash-skills/releases/latest/download/iconhash_lite_windows_x86_64.zip
```
**支持平台:** Linux(x86_64、aarch64、i386、arm、riscv64)、macOS(x86_64、aarch64)、Windows(x86_64、aarch64、i386)、FreeBSD(x86_64、aarch64)
### 通过 Go 安装
```
go install github.com/cyberspacesec/iconhash-skills/cmd/iconhash@latest
```
### 源码编译
```
git clone https://github.com/cyberspacesec/iconhash-skills.git
cd iconhash-skills
# Lite 构建(默认)
make build
# Full 构建(内嵌指纹,离线可用)
make build-full
```
### Docker
```
docker pull cyberspacesec/iconhash:latest
docker run --rm cyberspacesec/iconhash:latest url https://example.com/favicon.ico
```
## 快速开始
```
iconhash url https://www.example.com/favicon.ico # 从 URL 计算哈希
iconhash identify https://example.com # 识别网站
iconhash lookup -- -305179312 # 查找指纹
iconhash batch -i urls.txt -o results.json # 批量处理
iconhash server -p 8080 # 启动 API 服务器
```
## 💻 CLI 命令
| 命令 | 功能 |
|---|---|
| `iconhash url ` | 从 URL 计算哈希 |
| `iconhash file ` | 从文件计算哈希 |
| `iconhash base64 ` | 从 base64 文件计算哈希 |
| `iconhash discover ` | 发现网站 favicon |
| `iconhash identify ` | 完整识别(发现 + 哈希 + 指纹) |
| `iconhash lookup ` | 在指纹库中查找 |
| `iconhash batch -i ` | 批量处理 URL |
| `iconhash fingerprints` | 浏览/搜索指纹库 |
| `iconhash fingerprints update` | 更新指纹库 |
| `iconhash server` | 启动 HTTP API 服务器 |
### 全局参数
| 参数 | 缩写 | 说明 |
|---|---|---|
| `--engine` | `-e` | 格式:`plain`、`fofa`、`shodan`、`censys`、`quake`、`zoomeye`、`hunter` |
| `--uint32` | `-n` | 输出 uint32 而非 int32 |
| `--insecure` | `-k` | 跳过 TLS 验证 |
| `--timeout` | `-t` | HTTP 超时(默认 30s) |
| `--proxy` | | HTTP/SOCKS5 代理地址 |
| `--debug` | `-d` | 启用调试输出 |
| `--format` | | 输出:`text`、`json`、`csv` |
| `--output` | `-o` | 输出文件路径 |
| `--fingerprint-db` | | 自定义指纹数据库 |
📖 完整文档见 [SKILLS.md](./SKILLS.md)。
## 📦 Go SDK
```
go get github.com/cyberspacesec/iconhash-skills
```
```
import (
"context"
"github.com/cyberspacesec/iconhash-skills/pkg/hasher"
"github.com/cyberspacesec/iconhash-skills/pkg/fingerprint"
"github.com/cyberspacesec/iconhash-skills/pkg/util"
)
// 一次性计算(默认选项)
hash, _ := hasher.HashURL(context.Background(), "https://example.com/favicon.ico")
// 自定义 hasher
h := hasher.New(&hasher.HashOptions{InsecureSkipVerify: true})
hash, _ = h.HashFromURL(ctx, "https://example.com/favicon.ico")
// 完整识别
db := fingerprint.DefaultDB()
results := h.Identify(ctx, "https://example.com", db, nil)
// 批量处理
results := h.BatchHashURLs(ctx, urls, 10)
// 格式化为所有搜索引擎
queries := util.FormatAll(hash)
// 使用代理
opts, _ := hasher.NewOptionsWithProxy("socks5://127.0.0.1:1080", 30*time.Second, true)
```
## 🔌 API 服务与 MCP
### HTTP API 服务器
```
iconhash server -p 8080 --auth-token secret123
```
| 端点 | 方法 | 说明 |
|---|---|---|
| `/health` | GET | 健康检查 |
| `/hash/url` | GET, POST | 从 URL 计算哈希 |
| `/hash/file` | POST | 从文件计算哈希 |
| `/hash/base64` | POST | 从 base64 计算哈希 |
| `/hash/batch` | POST | 批量计算 |
| `/hash/discover` | POST | 发现 favicon |
| `/lookup` | GET | 指纹查找 |
| `/fingerprints` | GET | 指纹数据库 |
| `/mcp` | POST | 模型上下文协议 |
### MCP 集成
```
import "github.com/cyberspacesec/iconhash-skills/pkg/mcp"
handler := mcp.NewHandler(false)
tools := handler.Tools()
result := handler.CallTool("iconhash_url", map[string]interface{}{
"url": "https://example.com/favicon.ico",
})
```
**MCP 工具:** `iconhash_url`、`iconhash_base64`、`iconhash_file`、`iconhash_discover`、`iconhash_lookup`
## 搜索引擎格式
| 引擎 | 格式 | 示例 |
|---|---|---|
| Fofa | `icon_hash=""` | `icon_hash="-305179312"` |
| Shodan | `http.favicon.hash:` | `http.favicon.hash:-305179312` |
| Censys | `services.http.responseavicons.md5_hash:` | |
| Quake | `favicon.hash:""` | |
| ZoomEye | `iconhash:""` | |
| Hunter | `web.icon=""` | |
## Docker
```
docker run --rm cyberspacesec/iconhash:latest url https://example.com/favicon.ico
docker run -d -p 8080:8080 cyberspacesec/iconhash:latest server -H 0.0.0.0 -p 8080
```
## 开发
```
make build # Lite 构建
make build-full # Full 构建(含指纹)
make test # 运行测试
make test-coverage # 运行测试并生成覆盖率
```
## 许可证
[MIT License](LICENSE)标签:C2日志可视化, EVTX分析, Favicon Hash, Go语言, MMH3, 实时处理, 指纹识别, 日志审计, 程序破解, 网络安全, 请求拦截, 隐私保护