keyreyla/scorpion
GitHub: keyreyla/scorpion
Scorpion 是一个零配置、零 API 密钥的开源侦察框架,仅通过免费公共端点完成子域名、DNS、HTTP、端口和云存储等攻击面发现,适合安全测试的首次侦察阶段。
Stars: 1 | Forks: 0
# scorpion
Scorpion 是一个开源的侦察框架,仅使用免费/公共端点来发现攻击面——子域名、DNS 记录、HTTP 端点、开放端口、云存储。无需付费 API,无外部工具依赖。
## 徽章
[](https://www.python.org/downloads/)
[](LICENSE)
[](../../actions)
[]()
## 预览
```
scorpion recon example.com --passive-only
scorpion v0.2.0 -- First-Pass Recon Starter Kit
Zero API Keys | Zero Config | Zero Cost
Quick Start:
scorpion recon example.com # Full reconnaissance
scorpion passive example.com # Zero packets to target
scorpion recon example.com --cve # + CVE matching
scorpion recon example.com --stealth # Human-like timing
For deep vuln scanning -> use Nuclei, Nmap, or Burp Suite
Starting reconnaissance on example.com...
+----- scorpion live ---------------------------+
| Target: example.com |
| Phase: DNS Resolution |
| Elapsed: 0:00:05 |
| |
| Total: 12 Critical: 0 High: 0 |
| Medium: 0 Low: 1 Info: 11 |
+------------------------------------------------+
+----- findings stream -------------------------+
| TYPE TARGET SEV CONF |
| subdomain www.example.com info 95% |
| subdomain mail.example.com info 95% |
| dns example.com info 90% |
| http https://example.com info 90% |
| ... ... ... ... |
+------------------------------------------------+
Reports saved to: ./output/
findings.jsonl findings.csv report.html
```
## 它是什么 / 它不是什么
| scorpion 是 | scorpion 不是 |
|---|---|
| 首次侦察入门工具包 | Nuclei、Nmap、Burp Suite 的替代品 |
| 零配置,零 API 密钥 | 全面的漏洞扫描器 |
| 攻击面发现 | 漏洞利用框架 |
| 侦察方法学的教学工具 | 隐蔽/OPSEC 工具 |
| 带有插件的模块化框架 | 生产级安全平台 |
**推荐工作流:**
```
scorpion (surface discovery) -> nmap (port analysis) -> nuclei (vuln scanning) -> burp suite (deep testing)
```
## 安装
### 选项 1:通过 GitHub 使用 pip 安装(推荐)
```
pip install git+https://github.com/keyreyla/scorpion.git
```
### 选项 2:curl 单行命令安装
```
curl -sSL https://raw.githubusercontent.com/keyreyla/scorpion/main/scripts/install.sh | bash
```
### 选项 3:从源码安装
```
git clone https://github.com/keyreyla/scorpion.git
cd scorpion
pip install -e .
```
### 环境要求
- **Python 3.11+**
- **兼容 ARM64**(Termux/PRoot、树莓派、Apple Silicon)
- 至少 **~200MB 内存**
## 使用方法
### 命令
#### `scorpion recon ` — 全面侦察
运行被动 + 主动模块。发现子域名、解析 DNS、探测 HTTP、扫描常见端口、检查云存储。
```
scorpion recon example.com
```
**何时使用:** 您希望全面了解目标的攻击面。这是您的默认起点。
**风险等级:** 低。主动模块仅连接到常见端口(80、443、8080、8443)上已发现的子域名。不进行漏洞利用。
**模拟输出:**
```
Phase: CT Logs -> 9 subdomains found
Phase: DNS Resolution -> 9 records resolved
Phase: HTTP Probe -> 6 live endpoints detected
Phase: Port Scan -> 3 open ports found
Phase: Cloud Enum -> 0 buckets detected
Phase: GitHub Recon -> 0 leaks found
Total Findings: 24
Subdomains: 9
DNS Records: 9
HTTP Responses: 6
Open Ports: 3
Cloud Storage: 0
```
#### `scorpion passive ` — 零数据包发送到目标
仅使用第三方来源:证书透明度日志、基于 HTTPS 的 DNS、WHOIS 查询、GitHub 公共搜索。没有任何请求触及目标的基础设施。
```
scorpion passive example.com
```
**何时使用:** 任何项目的第一步。当您需要保持隐身时。当范围不明确且您希望在接触目标之前收集情报时。
**风险等级:** 无。所有查询均发送到第三方服务(crt.sh、Google DoH、Cloudflare DoH、WHOIS 服务器)。
**模拟输出:**
```
Phase: CT Logs -> 9 subdomains found
Phase: DNS Resolution -> 9 records resolved (via Google DoH)
Phase: WHOIS/ASN -> ASN 15133, Edgecast Inc.
Phase: GitHub Recon -> 0 public leaks
Total Findings: 18
All from passive sources. Target was never contacted.
```
#### `scorpion recon --deep` — 激进枚举
添加基于字典的子域名爆破、排列引擎、更广的端口范围(前 1000 个)、对存活端点的目录探测。
```
scorpion recon example.com --deep
```
**何时使用:** 在初始被动侦察之后。当您需要最大覆盖范围时。当目标明确在激进测试的授权范围内时。
**风险等级:** 中高。发起数千次请求。可能触发速率限制、WAF 拦截或 IDS 告警。仅在明确授权进行主动测试的目标上使用。
**模拟输出:**
```
Phase: CT Logs -> 9 subdomains found
Phase: DNS Resolution -> 9 records resolved
Phase: Subdomain Enum -> 3478 attempts, 12 new subs found
Phase: HTTP Probe -> 18 live endpoints
Phase: Port Scan -> top 1000 ports, 8 open
Phase: Vuln Scan -> 3 missing headers, 1 SSL issue
Phase: Dir Probe -> 42 interesting paths
Total Findings: 87
Note: Deep scan completed. Consider running --cve for CVE matching.
```
#### `scorpion recon --cve` — 结合 CVE 匹配
在检测到技术栈后,与 NVD CVE 数据库进行匹配(免费,无需 API 密钥)。
```
scorpion recon example.com --cve
```
**模拟输出:**
```
Phase: CVE Matching -> checking 3 detected services...
nginx/1.18.0 -> 2 CVEs found (1 HIGH, 1 MEDIUM)
WordPress/6.1 -> 5 CVEs found (2 CRITICAL, 3 HIGH)
PHP/7.4.3 -> 3 CVEs found (1 HIGH, 2 MEDIUM)
CVE Summary: 10 total (3 CRITICAL, 4 HIGH, 3 MEDIUM)
See report.html for full details with CVSS scores.
```
#### `scorpion recon --stealth ` — 时间控制
| 配置文件 | 延迟 | 可检测性 | 使用场景 |
|---|---|---|---|
| `normal` | 1-5秒 | 中等 | 默认侦察 |
| `stealth` | 5-30秒 | 低 | 规避 WAF/IDS |
| `aggressive` | 0.1-1秒 | 高 | 快速内部测试 |
```
scorpion recon example.com --stealth stealth
```
#### `scorpion recon -s scope.json` — 范围策略
```
scorpion recon example.com -s policies/bugcrowd.json
```
范围策略 JSON:
```
{
"program_name": "Example Bug Bounty",
"in_scope_domains": ["example.com", "*.example.com"],
"out_of_scope_domains": ["partner.example.com"],
"in_scope_ips": ["203.0.113.0/24"],
"exclude_paths": ["/admin", "/internal"]
}
```
超出范围的发现将被标记并从主动模块中排除。
### 真实工作流示例
```
# 步骤 1: 仅被动 — 收集情报,零接触
scorpion passive example.com -o recon/passive
# 步骤 2: 审查发现,确认范围
cat recon/passive/findings.jsonl | grep '"scope_status": "in_scope"'
# 步骤 3: 全面侦察 — 主动但合理
scorpion recon example.com -o recon/full -r 2.0
# 步骤 4: 深度扫描 — 仅针对确认的范围内目标
scorpion recon example.com --deep --cve -o recon/deep -s scope.json
# 步骤 5: 导出报告供团队使用
cat recon/deep/report.html # open in browser
cat recon/deep/findings.csv # import to spreadsheet
```
### 输出格式
| 格式 | 文件 | 使用场景 |
|---|---|---|
| **JSONL** | `findings.jsonl` | 主要输出。机器可读。可通过管道传递给 jq、grep 或自定义脚本。每行是一个发现结果。 |
| **CSV** | `findings.csv` | 电子表格导入。与非技术团队成员共享。在 Excel 或 Google Sheets 中进行过滤/排序。 |
| **HTML** | `report.html` | 人类可读的报告。带有颜色编码的严重性徽章和修复提示。适合与客户或团队分享。 |
| **SQLite** | `scorpion.db` | 内部去重数据库。可直接查询以进行自定义分析:`sqlite3 scorpion.db "SELECT * FROM findings WHERE severity='high'"` |
## 集成
Scorpion 被设计为侦察管道的**第一步**。将其输出通过管道传递给其他工具:
### 与 nmap 集成
```
# 将发现的子域提供给 nmap
scorpion passive example.com -o /tmp/recon
cat /tmp/recon/findings.jsonl | jq -r 'select(.type=="subdomain") | .target' | nmap -iL - -p 80,443,8080,8443 -sV -oA nmap-scorpion
```
### 与 nuclei 集成
```
# 将存活的 HTTP 端点提供给 nuclei
scorpion recon example.com --passive-only -o /tmp/recon
cat /tmp/recon/findings.jsonl | jq -r 'select(.type=="endpoint") | .target' | nuclei -l - -o nuclei-results.txt
```
### 与 httpx 集成
```
# 使用 httpx 验证子域
scorpion passive example.com -o /tmp/recon
cat /tmp/recon/findings.jsonl | jq -r 'select(.type=="subdomain") | .target' | httpx -silent -status-code -title -tech-detect
```
### 与 ffuf 集成
```
# 对发现的端点进行目录爆破
scorpion recon example.com --passive-only -o /tmp/recon
cat /tmp/recon/findings.jsonl | jq -r 'select(.type=="endpoint") | .target' | while read url; do
ffuf -u "$url/FUZZ" -w wordlists/common.txt -mc 200,301,403 -o ffuf-$url.json
done
```
### 与 burp suite 集成
```
# 导出为兼容 Burp 的格式以供手动测试
cat output/findings.jsonl | jq -r 'select(.type=="endpoint") | .target' > burp-targets.txt
# 将 burp-targets.txt 导入 Burp Suite -> Target -> Scope
```
### scorpion 的定位
```
scorpion nmap nuclei burp suite
(discovery) -> (ports) -> (vulns) -> (manual)
passive + TCP connect 8000+ intruder,
active enum banner grab templates repeater,
service det CVE match scanner
```
## 使用场景
### 漏洞赏金
以被动侦察开始每项任务。在进行任何主动请求之前发现所有子域名和端点。将发现结果导出为 JSONL 以按范围进行过滤。使用 `--stealth stealth` 以避免触发告警。
### 渗透测试
对范围内的目标运行全面侦察。使用 `--deep` 获取最大覆盖范围。导出 HTML 报告作为客户交付物。通过管道将子域名传递给 Nuclei 进行自动化漏洞扫描。
### 红队
使用被动模式进行初始情报收集。结合自定义字典进行有针对性的子域名枚举。导出 CSV 以便团队协作。范围策略确保您始终遵守交战规则。
### 资产发现
持续监控设置:定期运行 scorpion,比较不同运行之间的 findings.jsonl 以检测新子域名、变更的技术栈或新暴露的云存储桶。
## 速查表
```
scorpion --version # check version
scorpion --help # show all commands
scorpion help # detailed help with examples
scorpion recon example.com # full recon
scorpion passive example.com # passive only
scorpion recon example.com --deep # aggressive enum
scorpion recon example.com --cve # + CVE matching
scorpion recon example.com --stealth stealth # slow timing
scorpion recon example.com -s scope.json # scope policy
scorpion recon example.com -o ./output # custom output dir
scorpion recon example.com -r 3.0 -c 5 # rate limit + concurrency
scorpion recon example.com --plugins # run community plugins
scorpion recon example.com --skip-cloud # skip cloud enum
scorpion recon example.com --skip-vuln # skip vuln scanning
scorpion recon example.com -w wordlist.txt # custom wordlist
scorpion plugins # list installed plugins
```
## 功能特性
| 模块 | 功能 | 需要 API 密钥 |
|---|---|---|
| 证书透明度 | 通过 crt.sh 发现子域名 | 否 |
| DNS 解析 | 通过 Google/Cloudflare DoH 获取 A、AAAA、CNAME、MX、TXT、NS、SOA 记录 | 否 |
| 子域名爆破 | 基于字典 + 排列枚举 | 否 |
| HTTP 探测 | 状态码、技术栈检测、安全响应头 | 否 |
| 端口扫描 | 带有 Banner 抓取的异步 TCP 连接扫描 | 否 |
| 漏洞检查 | SSL 验证、缺失响应头、敏感内容 | 否 |
| CVE 匹配 | 针对检测到的服务匹配 NVD 数据库 | 否 |
| 云存储枚举 | 通过 HTTP 检测 S3、GCS、Azure Blob | 否 |
| GitHub 侦察 | 公共代码搜索以查找泄露的配置 | 否 |
| WHOIS/ASN | 直接查询 WHOIS 服务器 | 否 |
| 插件系统 | 通过 hook API 实现社区扩展 | 否 |
## 架构
```
INTAKE PASSIVE OSINT ACTIVE ENUM TRIAGE
(scope) (ct, dns, git) (sub, http) (dedup, score)
| | | |
v v v v
validate cache store rate limiter output
scope (sqlite) (semaphore) jsonl/html/csv
+ cve matcher (NVD)
+ plugin system (hook API)
+ stealth mode (UA rotation, timing)
```
## 置信度评分
```
confidence = source_reliability x corroboration x freshness
```
| 来源 | 可靠性 |
|---|---|
| CT Log (crt.sh) | 0.95 |
| Google DNS (DoH) | 0.90 |
| DNS Bruteforce | 0.85 |
| HTTP Probe | 0.90 |
| Port Scan | 0.90 |
| CVE Matcher | 0.85 |
| GitHub Public | 0.60 |
| Cloud Enum | 0.70 |
## 插件系统
将一个 Python 文件放入 `scorpion/plugins/` 目录中,它将自动加载:
```
from scorpion.plugins import BasePlugin
from scorpion.models import Finding, FindingType, Severity
class MyPlugin(BasePlugin):
name = "my_plugin"
version = "0.1.0"
description = "Does something useful"
async def run(self, target: str, **kwargs) -> list[Finding]:
return [Finding(
type=FindingType.ENDPOINT,
target=target,
value="found something",
source="plugin:my_plugin",
confidence=0.8,
severity=Severity.MEDIUM,
)]
```
```
scorpion plugins # list installed
scorpion recon target --plugins # run during recon
```
## 道德与法律
Scorpion 仅用于**授权的安全测试**。
1. 验证范围 — 仅测试明确在授权范围内的目标
2. 遵守速率限制 — 不要使目标基础设施过载
3. 被动优先 — 始终从被动侦察开始
4. 记录一切 — 每个发现结果都包含来源和时间戳
5. 遵守项目规则 — HackerOne/Bugcrowd 政策优先于所有默认设置
Scorpion 不会:进行漏洞利用、撞库、DDoS、社会工程学或在范围外进行测试。
## 开发
```
pip install -e ".[dev]"
pytest tests/ -v
ruff check scorpion/
ruff format scorpion/
```
## 贡献
1. 派生仓库
2. 创建一个功能分支(`git checkout -b feat/amazing-feature`)
3. 提交您的更改(`git commit -m 'feat: add amazing feature'`)
4. 推送到分支(`git push origin feat/amazing-feature`)
5. 发起一个 Pull Request
有关指南,请参见 [CONTRIBUTING.md](CONTRIBUTING.md)。
## 许可证
MIT 许可证 — 详情请参见 [LICENSE](LICENSE)。
**scorpion v0.2.0** — 作者 [keyreyla](https://github.com/keyreyla)
标签:Bug Bounty, CVE匹配, DNS解析, Docker容器, GitHub, HTTP端点, Python, Snort++, Windows内核, 云存储, 免费API, 动态插桩, 反取证, 可自定义解析器, 子域名枚举, 安全评估, 实时处理, 密码管理, 开放端口, 开源安全工具, 开源项目, 攻击面发现, 数据展示, 无后门, 白帽子, 系统安全, 红队, 网络安全, 表面网, 被动扫描, 资产测绘, 逆向工程平台, 隐私保护, 隐蔽扫描, 零配置