Dexel-Software-Solutions/Subdomain-hunter

GitHub: Dexel-Software-Solutions/Subdomain-hunter

一款集成了多源被动采集、智能 DNS 暴力破解、服务探测和 ASN 风险评分的一站式子域名枚举工具。

Stars: 3 | Forks: 0

Subdomain Enumerator
![Python](https://img.shields.io/badge/Python-3.10%2B-red?style=flat-square&logo=python&logoColor=white&labelColor=0d1117) ![版本](https://img.shields.io/badge/Version-3.0.0-red?style=flat-square&labelColor=0d1117) ![许可证](https://img.shields.io/badge/License-MIT-orange?style=flat-square&labelColor=0d1117) ![状态](https://img.shields.io/badge/Status-Active-brightgreen?style=flat-square&labelColor=0d1117) ![作者](https://img.shields.io/badge/Dev-Demiyan_Dissanayake-red?style=flat-square&labelColor=0d1117)
## 🆕 v3.0 中的新功能 | # | 问题 | 应用修复 | |:-:|-------|-------------| | 1 | `crt.sh` 503 错误导致工具崩溃 | 指数退避 + 随机抖动 + 5 次重试 | | 2 | 仅支持单一 CT 日志来源 | 新增 **HackerTarget**、**AlienVault OTX**、**RapidDNS** | | 3 | 仅 145 个词的暴力破解,无逻辑 | 250+ 个基础词汇 + 智能排列引擎 (`dev-api`、`api-prod`…) | | 4 | 失效的子域名污染结果 | 在信息丰富化之前进行 DNS 有效性检查 + 可路由 IP 过滤 | | 5 | 无 HTTP/服务检测 | HTTP 状态、HTTPS 状态、页面标题、开放端口扫描 | | 6 | 基础重试,无抖动,无 UA 轮换 | 随机抖动延迟 + 5 个 UA 轮换池 | | 7 | 纯子域名列表 — 无威胁情报 | ASN · 组织 · 国家 · 托管提供商 · 风险标志 | | 8 | 词表路径在 Windows/Git Bash 上出错 | `Path.resolve()` + 反斜杠规范化 | | 9 | `https://www.domain.lk\` 解析错误 | 完整 URL 清理:scheme、端口、路径、`www.`、末尾的 `\` | | 10 | 无法了解 CT 日志阶段的进度 | 在每个阶段使用 Rich `console.status()` 加载动画 | ## ✨ 功能特性 ``` ┌─────────────────────────────────────────────────────────────┐ │ DISCOVERY INTELLIGENCE │ │ ───────────────────────── ────────────────────────────── │ │ 🔍 crt.sh CT Log Mining 🏢 ASN + Org + Country │ │ 🌐 HackerTarget API ☁️ Hosting Provider Inference │ │ 🛸 AlienVault OTX 🚩 Risk Flag Scoring │ │ ⚡ RapidDNS Passive 🔗 HTTP/HTTPS Status Codes │ │ 💥 Smart Brute-force 📄 Page Title Extraction │ │ 🔌 Open Port Detection │ │ FILTERING │ │ ───────────────────────── │ │ 🌀 Wildcard DNS Detection OUTPUT │ │ ✅ Dead Subdomain Pruning ────────────────────────────── │ │ 🧬 Permutation Expansion 📤 JSON + CSV export │ │ 🖥️ Rich Terminal UI │ └─────────────────────────────────────────────────────────────┘ ``` ## 🚀 安装 ``` git clone https://github.com/Dexel-Software-Solutions/Subdomain-hunter.git cd Subdomain-hunter pip install -r requirements.txt ``` **依赖要求:** `dnspython>=2.4.0` · `rich>=13.0.0` · Python 3.10+ ## 📖 用法 ### 基础用法 ``` python src/enumerator.py example.com ``` ### 使用自定义词表进行完整扫描 ``` python src/enumerator.py example.com --wordlist /path/to/big.txt --workers 100 ``` ### 导出结果 ``` python src/enumerator.py example.com --output-json results.json --output-csv results.csv ``` ### 仅被动模式(快速,无暴力破解) ``` python src/enumerator.py example.com --no-bruteforce --no-http-detect --no-asn ``` ### Windows / Git Bash(支持完整 URL 输入) ``` python src/enumerator.py "https://www.example.com/" --wordlist "C:/tools/wordlists/subs.txt" ``` ## ⚙️ CLI 参考 ``` positional: domain Target domain or URL discovery: --no-ct Skip crt.sh CT log mining --no-passive Skip HackerTarget / OTX / RapidDNS --no-bruteforce Skip brute-force --no-permute Skip smart wordlist permutations --wordlist FILE Custom wordlist path dns: --workers N Concurrent DNS threads [default: 50] --dns-timeout F DNS resolution timeout (s) [default: 3.0] --nameservers N+ Custom DNS resolvers enrichment: --no-validate Skip dead-subdomain filtering --no-enrich Skip DNS enrichment (CNAME, MX, TXT...) --no-http-detect Skip HTTP/HTTPS probing --no-asn Skip ASN/geo/hosting lookup --http-timeout F HTTP probe timeout (s) [default: 10.0] output: --output-json FILE Save report as JSON --output-csv FILE Save report as CSV ``` ## 📊 输出字段 | 字段 | 描述 | |-------|-------------| | `fqdn` | 完全限定域名 | | `ip_addresses` | 解析出的 IPv4 / IPv6 地址 | | `cname` | CNAME 链目标 | | `http_status` | HTTP 响应码 | | `https_status` | HTTPS 响应码 | | `http_title` | HTML `` 内容 | | `open_ports` | 检测到的开放端口 (80, 443, 8080…) | | `asn` | 自治系统号 | | `asn_org` | ASN 组织名称 | | `country` | 国家代码 | | `hosting` | 推断出的提供商 (AWS · Cloudflare · GCP…) | | `risk_flags` | `SENSITIVE_SUBDOMAIN` · `HTTP_EXPOSED` · `NO_HTTPS` · `BEHIND_CLOUDFLARE`… | | `sources` | 发现此记录的探测技术 | ## 🏗️ 架构 ``` SubdomainEnumerator │ ├── CTLogMiner ← crt.sh (retry + jitter) ├── HackerTargetSource ← hackertarget.com API ├── AlienVaultSource ← otx.alienvault.com ├── RapidDNSSource ← rapiddns.io │ ├── BruteForceEngine ← ThreadPoolExecutor (50 workers) │ └── WordlistManager ← builtin 250+ words + permutations │ ├── DNSResolver ← dnspython / socket fallback ├── RecordEnricher ← CNAME, AAAA, MX, NS, TXT │ ├── ServiceDetector ← HTTP/HTTPS status + ports ├── ASNEnricher ← ip-api.com batch lookup └── RiskAnalyzer ← flag scoring engine ``` ## ⚠️ 法律声明 本工具仅 intended 用于**您拥有或已获得明确书面授权进行测试的域名**。 未经授权的子域名枚举在您所在的司法管辖区可能属于违法行为。 <div align="center"> 由 **Demiyan Dissanayake** 用 ❤️ 制作 ![](https://img.shields.io/badge/Sri_Lanka-🇱🇰-red?style=flat-square&labelColor=0d1117) ![](https://img.shields.io/badge/Security_Research-🔐-red?style=flat-square&labelColor=0d1117) </div></div><div><strong>标签:</strong>ASN enrichment, CT日志, DNS爆破, Docker容器, ESC4, GitHub, HTTP探测, OSINT, Python, 子域名扫描器, 子域名挖掘, 子域名枚举, 批量查询, 攻击面发现, 无后门, 系统安全, 网络安全, 证书透明度, 资产探测, 隐私保护, 风险评分</div></article></div> <!-- 人机验证 --> <script> (function () { var base = (document.querySelector('base') && document.querySelector('base').getAttribute('href')) || ''; var path = base.replace(/\/?$/, '') + '/cap-wasm/cap_wasm.min.js'; window.CAP_CUSTOM_WASM_URL = new URL(path, window.location.href).href; })(); </script> </body> </html>