Dry1ceD7/subsift

GitHub: Dry1ceD7/subsift

subsift 是一个纯 Python 标准库实现的子域名降噪与优先级评分工具,用于从被动枚举的大量输出中快速筛选和标记高价值目标主机。

Stars: 0 | Forks: 0

# subsift [![CI](https://static.pigsec.cn/wp-content/uploads/repos/cas/ad/ad5834178f7599af9fdda11629d49cae07f2997beec49821b2920eff5bfd50e7.svg)](https://github.com/Dry1ceD7/subsift/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](pyproject.toml) **从子域名枚举的噪音中筛选出信号。** 将 `subfinder`/`amass`/`httpx` 的输出通过管道传入,即可获得经过降噪、标记和优先级评分的视图,展示真正值得关注的对象——非生产环境、admin、auth、API、CI/CD、infra、payment——同时丢弃临时的 CI 预览、wildcard-DNS 垃圾信息以及带编号的白标页面。 纯 Python **标准库,零依赖**。单文件。可读取文件或 stdin。 ``` subfinder -d target.com -silent | subsift --interesting ``` ![subsift 演示](https://static.pigsec.cn/wp-content/uploads/repos/cas/c2/c2cedb03bcb352b80b4a77eb4ad6173582e654364593831e0a8aaaf81aee368d.gif) ## 问题所在 对大型目标进行被动枚举会返回数千个主机。其中大部分是噪音: 针对每个 PR 的预览部署 (`2871-fix-uncover.ci0.dev.example.com`)、构建哈希标签、 wildcard-DNS 污染,以及数千个带编号的白标站点 (`10441.partner.example.com`)。寻找那少数几个真正重要的主机——`admin.*`、`*.dev`、 `gitlab.*`、`api-payments-*`——往往是一个缓慢、手动的 `grep` 考古过程。 `subsift` 只需一步即可完成这种分拣。 ## 功能介绍 - **去除噪音** —— 临时的/预览部署、哈希/uuid 标签、内嵌域名的 wildcard 垃圾信息、过度嵌套的产物。 - **合并** 膨胀的带编号白标域名(保留几个,其余的进行计数)。 - **标记** 每个主机的环境 (`dev/test/staging/uat/qa/sandbox/rc/internal`) 和类别 (`admin, auth, api, cicd, monitoring, infra, data, payment, storage, mail`)。 - **评分** 根据漏洞赏金的关注度进行排序,让高价值内容浮到顶部。 ### 真实案例 —— 输入 10,886 个子域名,输出高价值目标 ``` $ subsift justeat-subs.txt --stats >/dev/null [subsift] kept 6917 hosts; dropped 3969 noise ({'deep-nesting':1486,'ephemeral-preview':1560,'hash-label':902,...}) $ subsift justeat-subs.txt --interesting --min-score 5 10 docker-registry.dev.pyszne.pl [dev, cicd, infra] 10 gitlab-ssh.dev.pyszne.pl [dev, cicd, infra] 9 g-admin-api.dev.lieferando.de [dev, admin, api] 8 kubernetes.auth.lieferando.de [auth, infra] 8 vpn.auth.lieferando.de [auth, infra] 7 admin.api-courier.skipthedishes.com [admin, api] 7 api-payments-secure-prod.skippay... [api, payment] 7 internal-k8s.scoober.com [internal, infra] ``` ## 安装 无需依赖——只需获取该文件: ``` curl -O https://raw.githubusercontent.com/Dry1ceD7/subsift/main/subsift.py && chmod +x subsift.py ``` 或者进行安装: ``` pip install subsift # once published # 或从 source 构建: pip install . ``` ## 用法 ``` subsift [FILE] [options] # FILE or stdin --interesting only hosts with score >= --min-score, sorted high→low --min-score N threshold for --interesting (default 2) --json emit JSON lines with tags + score (feed the next tool) --stats print an env/category/noise breakdown --httpx input is httpx JSON lines (reads the url/input field) --keep-noise don't drop anything, just tag --collapse N keep at most N numbered white-label hosts per parent (default 2) ``` ### 实用示例 ``` # passive enum → 仅保留感兴趣的 hosts → 探测这些 hosts subfinder -d target.com -silent | subsift --interesting | awk '{print $2}' | httpx -silent # 标记 httpx 输出并保留 JSON 以供后续使用 httpx -l subs.txt -json | subsift --httpx --json > tagged.jsonl # 仅针对 non-prod + admin/auth/infra surface,并附带细分 subsift subs.txt --stats | grep -E 'admin|auth|infra|cicd|payment' ``` ## 评分机制(可调) 关注度是一个简单的加权求和:高价值类别(`admin`、`auth`、 `payment`、`infra`、`cicd`、`data`)得分最高,其次是 `api`/`monitoring`, 非生产环境会获得额外加分(通常 auth 较弱 = 成功几率更高),而纯粹的 `storage`/`cdn` 会被扣分。所有这些配置都位于 `subsift.py` 顶部的字典中——你可以根据自己的喜好进行编辑。 ## 适用范围与道德规范 `subsift` 仅读取并对你已拥有的主机名进行分类——它**不会 发起任何网络请求**。请在授权的测试活动中(如漏洞赏金范围、你自己的 资产)使用它,并遵守每个项目的规则。 ## 贡献 特征匹配规则永远无法做到完美——非常欢迎提交 PR 来添加环境 token、类别关键词、 噪音规则或公共后缀。请在 `tests/` 中附上相应的测试用例。 ## 许可证 MIT —— 详情请见 [LICENSE](LICENSE)。
标签:GitHub, Python, 子域名枚举, 实时处理, 无后门, 系统安全, 网络调试, 自动化, 逆向工具