youwannahackme/subix

GitHub: youwannahackme/subix

Subix 是一款基于 Go 的高性能混合子域名枚举引擎,将 42 个被动 OSINT 数据源与主动 DNS 解析、通配符过滤、递归扫描和排列引擎整合为一体化侦察流程。

Stars: 0 | Forks: 0

# 🔱 SUBIX [![Go Report Card](https://goreportcard.com/badge/github.com/youwannahackme/subix)](https://goreportcard.com/report/github.com/youwannahackme/subix) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Go Version](https://img.shields.io/github/go-mod/go-version/youwannahackme/subix)](https://github.com/youwannahackme/subix) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/youwannahackme/subix/pulls) **Subix** 是一个神级的、极速的、混合子域名枚举引擎,使用 Go 编写。它将 **42 个被动 OSINT 来源**的强大功能与高级主动功能——多线程 DNS 解析、智能通配符过滤、递归枚举和排列引擎——结合到一个高性能工具中。 与其他需要将多个 CLI 工具进行复杂链式操作的工具不同,Subix 可以在一次统一运行中处理从被动到主动发现的整个 pipeline。 ## 🗺️ 引擎架构与 Pipeline Subix 使用结构化的 pipeline 运行,在确保零误报的同时最大化覆盖率: ``` graph TD A[Target Domain] --> B(Passive OSINT Phase) B -->|42 Sources| C[Raw Subdomain Pool] C --> D(Wildcard Detection Phase) D -->|Filter Wildcards| E[Sanitized Subdomain Pool] E --> F(Active Resolution Phase) F -->|Multi-threaded DNS| G[Live Subdomains] G --> H(Permutation Engine) H -->|Mutations + Wordlist| I(Active Resolution) I --> J[Discovered Hidden Assets] G --> K(Recursive Scanning Depth N) K -->|Feed Back| B J --> L(Structured Output) G --> L L -->|Formats| M[TXT / JSON / CSV] ``` ## 🌟 核心功能 ### 1. 42 个被动 OSINT 来源 抓取并查询证书透明度日志、网络档案馆、搜索引擎和威胁情报 API。它内置了速率限制和带有指数退避的连接重试机制。 ### 2. 内置主动解析器 高并发 DNS 解析,验证哪些子域名是存活状态。使用 Go 原生的 net 解析器构建,以实现最大吞吐量。 ### 3. 智能通配符过滤 通过动态检测通配符 DNS 记录来防止误报。它会尝试解析随机生成的子域名(例如:`l8d2j1s9.target.com`),并自动过滤掉解析到通配符落地页的 IP。 ### 4. 递归枚举 将新发现的存活子域名递归地反馈到被动发现 pipeline 中,直至达到用户定义的深度。 ### 5. 排列引擎 使用内部或自定义字典(例如添加 `dev`、`stage`、`api`、`v1`)生成已发现子域名的变体,并对其进行主动解析。 ## 🛠️ 安装 你可以直接使用 Go 安装 Subix: ``` go install -v github.com/youwannahackme/subix@latest ``` 确保你的 Go bin 目录(通常是 `$HOME/go/bin` 或 `%USERPROFILE%\go\bin`)在你的系统 `PATH` 中。 ## ⚙️ 配置 Subix 开箱即用,支持免费的、无需 API key 的来源。要解锁全部 42 个来源的全部潜力,请在 provider 配置文件中配置你的 API key。 1. 在 `~/.config/subix/provider-config.yaml` 创建一个配置文件。 2. 添加你的 API key。你可以使用位于 [configs/provider-config.yaml](configs/provider-config.yaml) 的模板: ``` # ~/.config/subix/provider-config.yaml sources: certtransparency: crtsh: true censys: true api: virustotal: true shodan: true zoomeye: true fofa: true netlas: true alienvault: true apikeys: virustotal: "YOUR_VIRUSTOTAL_KEY" shodan: "YOUR_SHODAN_KEY" zoomeye: "YOUR_ZOOMEYE_KEY" fofa: "YOUR_FOFA_KEY" netlas: "YOUR_NETLAS_KEY" alienvault: "YOUR_ALIENVAULT_OTX_KEY" ``` 使用 `--config` 标志指定配置文件的自定义路径: ``` subix -d example.com --config ./my-config.yaml ``` ## 🚀 高级用法示例 ### 1. 基础被动扫描 使用所有已启用的免费/被动来源枚举子域名: ``` subix -d example.com ``` ### 2. 主动验证(DNS 解析) 通过 DNS 解析所有发现的子域名,并且仅输出存活的结果: ``` subix -d example.com -resolve -only-resolved ``` ### 3. 一站式完整侦察 Pipeline 运行被动枚举,过滤通配符,执行递归子域名扫描(深度为 2),生成并解析排列,并将输出保存到 JSON 文件中: ``` subix -d example.com -resolve -wildcard -recursive -depth 2 -permute -o results.json -j ``` ### 4. 高性能多域名扫描 以高并发(50 个线程)从文件中的域名列表进行扫描,并以 CSV 格式输出: ``` subix -l domains.txt -threads 50 -o active_subs.csv -c ``` ## 🔱 可用来源(42 个) | 类别 | 来源 | | :--- | :--- | | **证书透明度** | `crtsh`, `censys` (API), `certspotter` | | **DNS 与服务** | `dnsdumpster`, `hackertarget`, `urlscan`, `alienvault`, `anubis`, `subdomaincenter`, `threatcrowd`, `columbus`, `jldc`, `sonar`, `robtex`, `rapiddns`, `synapsint`, `riddler` | | **网络档案馆** | `wayback`, `commoncrawl` | | **搜索引擎** | `bing`, `duckduckgo`, `google`, `yahoo`, `baidu`, `yandex`, `ask` | | **高级 API(需 Key)** | `securitytrails`, `virustotal`, `shodan`, `passivetotal`, `chaos`, `bevigil`, `zoomeye`, `fofa`, `hunter`, `intelx`, `leakix`, `netlas`, `binaryedge`, `threatbook`, `quake`, `c99` | 要在终端中列出所有可用的来源: ``` subix --list-sources ``` ## 💛 开发者指南:添加新来源 向 Subix 添加新的被动来源非常简单。每个来源都必须实现在 `pkg/types/types.go` 中定义的 `Source` 接口: ``` type Source interface { Name() string Run(domain string, session *Session) ([]string, error) } ``` ### 实现示例 在 `internal/sources/services/myservice.go` 下创建一个新文件: ``` package services import ( "encoding/json" "fmt" "io" "net/http" "github.com/youwannahackme/subix/pkg/types" ) type MyService struct{} func (m *MyService) Name() string { return "myservice" } func (m *MyService) Run(domain string, session *types.Session) ([]string, error) { url := fmt.Sprintf("https://api.myservice.com/subdomains?domain=%s", domain) req, err := http.NewRequest("GET", url, nil) if err != nil { return nil, err } req.Header.Set("User-Agent", types.DefaultUserAgent) resp, err := session.DoWithRetry(req) if err != nil { return nil, err } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } var results []string if err := json.Unmarshal(body, &results); err != nil { return nil, err } return results, nil } ``` 然后在 `internal/sources/source.go` 的 `AllSources()` 函数中注册你的新来源。 ## 📄 许可证 该项目基于 MIT 许可证授权 - 有关详细信息,请参阅 [LICENSE](LICENSE) 文件。
标签:DNS解析, ESC4, EVTX分析, GitHub, Go, OSINT, Ruby工具, 子域名枚举, 实时处理, 开源项目, 日志审计, 系统安全