rishiarora123/aem-recon-scanner

GitHub: rishiarora123/aem-recon-scanner

一款专注于 AEM 和 Next.js 部署环境的全流程自动化侦察与漏洞扫描器,通过浏览器 UI 提供从子域名发现到 Dispatcher 绕过漏洞检测的一站式服务。

Stars: 0 | Forks: 0

# AEM 侦察扫描器 一款专为 **Adobe Experience Manager (AEM)** 和 **Next.js** 部署环境设计的、高度聚焦的自动化侦察与漏洞扫描工具。给定一个根域名(或预构建的主机列表),它可以发现子域名、确认存活主机、识别技术栈指纹、映射 CVE,并探测 dispatcher 绕过漏洞——所有这些都可以通过单一的浏览器 UI 完成。 ![Python](https://img.shields.io/badge/Python-3.10+-blue?logo=python&logoColor=white) ![FastAPI](https://img.shields.io/badge/FastAPI-0.100+-009688?logo=fastapi&logoColor=white) ![License](https://img.shields.io/badge/License-MIT-green) ## 流程概述 ``` Domain │ ▼ Phase 1 ─ Subdomain Enumeration C99.nl (API/scraper) · subfinder · crt.sh · SecurityTrails · OTX │ ▼ Phase 2 ─ Alive Check Parallel httpx probing — HTTP status + response time │ ▼ Phase 3 ─ Tech Detection AEM fingerprinting (6 methods, score-based) Next.js detection (8+ methods) + CVE mapping │ ▼ Phase 4 ─ AEM Bypass Scan 13 bypass techniques × 58 sensitive endpoints ``` ### 额外功能 | 功能 | 详情 | |---|---| | **Next.js CVE 映射** | 检测到的版本与 6 个 CVE 进行交叉比对,并提供直接的 Nuclei 模板链接 | | **断网自动暂停** | 扫描在网络断开时自动暂停,并在网络恢复后从当前批次精确恢复 | | **重启后继续** | 服务器重启了?点击 ▶ Resume —— 从最后保存的进度继续执行 | | **流式下载** | 子域名/存活主机列表按行流式传输;不会出现导致浏览器卡死的 800 MB 响应 | | **独立的 Next.js 检测器** | 无需运行完整扫描即可检查任意 URL 的 Next.js 版本及 CVE | | **实时 WebSocket 推送** | 每次发现、错误和阶段切换都会实时推送到浏览器 | ## 快速开始 ### 前置条件 ``` # Python 3.10+ pip install -r requirements.txt # 可选但强烈推荐 brew install subfinder # macOS, or: # go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest # 使用 httpx 进行快速的存活检查: # https://github.com/projectdiscovery/httpx/releases ``` ### 运行 ``` python3 server.py # 打开 http://localhost:8000 ``` ## 配置 ### C99.nl API Key(推荐 —— 每个域名最多可获取 10 万个子域名) ``` export C99_API_KEY=your_key_here # $5 one-time at https://api.c99.nl ``` 如果没有 API Key,扫描器将回退到 HTML 抓取模式,并自动进行代理轮换。 ### C99 抓取的代理轮换 ``` export C99_PROXIES=http://1.2.3.4:8080,socks5://5.6.7.8:1080 ``` 如果未设置代理并检测到被阻止访问,扫描器会自动获取新的免费代理。 ## 子域名来源 | 来源 | 方式 | 覆盖范围 | |---|---|---| | **C99.nl** | 官方 JSON API 或 HTML 爬虫 | 覆盖最广 —— 每个域名最多 10 万个 | | **subfinder** | 被动 DNS 聚合器 CLI | 覆盖 40 多个被动 DNS 提供商 | | **crt.sh** | 证书透明度日志 | 良好的通配符证书覆盖范围 | | **SecurityTrails** | 公共 API | 历史子域名数据 | | **AlienVault OTX** | 威胁情报 API | 旧/被遗忘的子域名 | ## AEM 检测(第三阶段) 基于评分的指纹识别 —— 包含 6 种独立方法: | 方法 | 信号 | 分值 | |---|---|---| | A | HTML —— `/etc.clientlibs/`、`jcr:` 属性、`cq-` CSS 类、`/content/dam/` 路径 | 每个 +5 分 | | B | HTTP 标头 —— `x-dispatcher`、`x-vhost`、`x-aem-request-id` | 每个 +4 分 | | C | 路径探测 —— `/libs/granite/`、`/crx/de/`、`/bin/querybuilder.json` | 每个 +3 分 | | D | Body 特征码 —— `jcr:primaryType`、`sling:resourceType`、`granite.ui.` | 每个 +5 分 | | E | JS 对象 —— `CQ.WCM`、`Granite.*`、`Sling.servlet` | 每个 +3 分 | | F | 示例内容 —— `/content/we-retail/`、`/content/geometrixx/` | 每个 +5 分 | **置信度:** 评分 ≥ 10 → `confirmed`(已确认) · 评分 ≥ 5 → `suspected`(疑似) · 仅 helix-rum-js → `edge_delivery` ## Next.js 检测(第三阶段) | 方法 | 信号 | |---|---| | M0 | `X-Powered-By: Next.js` / `x-nextjs-cache` / `x-nextjs-prerender` 标头 | | M1 | `__NEXT_DATA__` JSON 标签 (Pages Router) —— 提取 `buildId` | | M2 | `` | | M2b | `` (App Router 标志) | | M3 | `
` 和 `data-next-page` 属性 | | M4 | HTML 中的 `/_next/static/` 资源路径 + 提取 build ID | | M5 | `/_next/image` endpoint 响应特征 | | M6 | 通过已知的 build ID 获取 `_buildManifest.js` | | M7 | 按优先级顺序获取所有 `/_next/static/chunks/*.js`,使用正则提取版本 | | M8 | 从 `framework-*.js` 提取 React 版本 → 推断 Next.js 范围(硬化构建回退策略) | ### 硬化构建处理 企业级构建(如 Microsoft、大型 Vercel 客户)会从 JS bundle 中移除所有版本字符串。 当未找到确切版本时,扫描器会: 1. 使用 React 特定模式从 `framework-*.js` 中提取 React 版本 2. 映射 React 主版本 → Next.js 范围:`React 19.x → Next.js ~15.x` 3. 显示琥珀色的 `~15.x ≈` 徽章 —— 明确区别于精确的青色 `v14.2.3` 徽章 ## Next.js CVE 数据库 检测到的版本会自动进行交叉比对。确切版本会得到明确匹配结果;推断出的范围会标记为“可能受影响”。 | CVE | 严重程度 | CVSS | 标题 | 受影响版本 | Nuclei | |---|---|---|---|---|---| | [CVE-2025-29927](https://nvd.nist.gov/vuln/detail/CVE-2025-29927) | **严重** | 9.1 | Middleware 身份验证绕过 | < 12.3.5 · 13.x < 13.5.9 · 14.x < 14.2.25 · 15.x < 15.2.3 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-29927.yaml) | | [CVE-2024-56332](https://nvd.nist.gov/vuln/detail/CVE-2024-56332) | **高危** | 8.1 | 通过图像优化实现的 SSRF | < 15.1.0 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-56332.yaml) | | [CVE-2024-34351](https://nvd.nist.gov/vuln/detail/CVE-2024-34351) | **高危** | 7.5 | 通过 Host 标头实现的 SSRF (Server Actions) | 14.0.0 – 14.1.0 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-34351.yaml) | | [CVE-2024-46982](https://nvd.nist.gov/vuln/detail/CVE-2024-46982) | **高危** | 7.5 | 通过 Host 标头实现的缓存中毒 | < 13.5.7 · 14.x < 14.2.10 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2024/CVE-2024-46982.yaml) | | [CVE-2025-32421](https://nvd.nist.gov/vuln/detail/CVE-2025-32421) | 中危 | 5.3 | 通过路径参数实现的 ReDoS | < 14.2.26 · 15.x < 15.1.7 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-32421.yaml) | | [CVE-2025-32280](https://nvd.nist.gov/vuln/detail/CVE-2025-32280) | 中危 | 5.9 | DoS —— App Router 中的无限循环 | < 14.2.30 · 15.x < 15.2.4 | [模板](https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-32280.yaml) | ### 针对扫描结果运行 Nuclei ``` # 使用 Nuclei templates 进行验证(安装:https://github.com/projectdiscovery/nuclei) nuclei -u https://target.example.com \ -t http/cves/2025/CVE-2025-29927.yaml \ -t http/cves/2024/CVE-2024-46982.yaml \ -t http/cves/2024/CVE-2024-34351.yaml \ -t http/cves/2024/CVE-2024-56332.yaml \ -t http/cves/2025/CVE-2025-32421.yaml \ -t http/cves/2025/CVE-2025-32280.yaml # 或者一次性运行所有 Next.js CVE templates nuclei -u https://target.example.com -tags nextjs,cve ``` ## AEM 绕过扫描(第四阶段) ### 13 种 Dispatcher 绕过技术 | # | 标签 | 路径模式 | |---|---|---| | 1 | `nocanon` | `/graphql/execute.json/..%2f../{endpoint}` | | 2 | `nocanon-upper` | `/graphql/execute.json/..%2F../{endpoint}` | | 3 | `nocanon-2slash` | `//graphql/execute.json/..%2f../{endpoint}` | | 4 | `nocanon-2slash-up` | `//graphql/execute.json/..%2F../{endpoint}` | | 5 | `path-param` | `/{endpoint};a.css` | | 6 | `hybrid` | `/{endpoint};x=graphql/execute.json` | | 7 | `dynmedia` | `/adobe/dynamicmedia/deliver/..;/..;/..;/{endpoint}` | | 8 | `nocanon-3dot` | `/graphql/execute.json/..%2f..%2f..%2f{endpoint}` | | 9 | `double-slash` | `//{endpoint}` | | 10 | `encoded-slash` | `/%2f{endpoint}` | | 11 | `semi-traverse` | `/content/..;/{endpoint}` | | 12 | `suffix-bypass` | `/{endpoint}.css/a.html` | | 13 | `ext-json` | `/{endpoint-root}.ext.json` | ### 58 个敏感的 AEM endpoint QueryBuilder · CRX/PackMgr · CRXDE Lite · OSGi Console · JMX · OSGi ConfigMgr · Product Info · Health Check · Content JSON · DAM JSON · User Admin · Granite Login · CSRF Token 泄露 · Trust Store · Replication Agents · Cloud Services · Domain Manager · ACS Audit Log 等。 ## 重启后继续 每个第二阶段的批次和第三阶段的主机都会被记录到 `scans_db.json` 作为检查点。重启时: 1. Dashboard 会显示被中断的扫描任务以及 **▶ Resume** 按钮 2. 恢复逻辑会自动选择正确的阶段: - 包含 `aem_hosts` → 从**第四阶段**继续 - 包含 `alive_hosts` → 从**第三阶段**继续 - 包含 `subdomains` 或 `phase2_cursor > 0` → 从**第二阶段**继续 - 其他情况 → 从**第一阶段**重新开始 ## 断网自动暂停 后台监控程序每 10 秒(在线时)/ 30 秒(离线时)探测一次 `8.8.8.8:53`、`1.1.1.1:53`、`8.8.4.4:53`。 当扫描过程中连接中断时: - 扫描状态 → `paused`,WebSocket 发送 `internet_pause` 事件 - UI 显示闪烁的琥珀色 **PAUSED** 徽章 - 扫描线程在当前探测点阻塞 当连接恢复时: - 扫描自动从暂停的确切位置恢复 - WebSocket 发送 `internet_resume` 事件,并附带停机时长 ## API 参考 ### 扫描生命周期 ``` POST /api/scan Start scan GET /api/scan/{id}/status Status poll GET /api/scan/{id}/results Full results (counts for large arrays) POST /api/scan/{id}/cancel Cancel POST /api/scan/{id}/resume Resume interrupted scan DELETE /api/scan/{id} Delete ``` ### 下载(流式) ``` GET /api/scan/{id}/download/subdomains Line-by-line subdomain list GET /api/scan/{id}/download/alive Line-by-line alive hosts GET /api/scan/{id}/download/vulnerabilities Vulnerability JSON ``` ### 实用工具 ``` POST /api/detect-nextjs Standalone Next.js detection GET /api/internet Connectivity status GET /api/scans List all scans POST /api/upload-hosts Upload host list (skip Phase 1) ``` ### WebSocket 事件 | `type` | 关键字段 | 含义 | |---|---|---| | `subdomain_found` | `subdomain` | 新发现子域名 | | `alive_host` | `host`、`status_code`、`response_time_ms` | 确认存活主机 | | `aem_detected` | `host`、`confidence`、`score`、`reasons` | AEM 结果 | | `nextjs_detected` | `host`、`version`、`router`、`cves[]` | Next.js + CVE | | `vuln_found` | `host`、`endpoint`、`bypass`、`status_code` | 绕过攻击命中 | | `internet_pause` | `message`、`context` | 网络断开 | | `internet_resume` | `message`、`waited_seconds` | 网络恢复 | | `phase` | `phase`、`name`、`status`、`count` | 阶段生命周期 | ## 输出结构 ``` scan.subdomains []str All discovered subdomains scan.alive_hosts []str Confirmed live hosts scan.aem_hosts {host → {confidence, score, reasons[]}} scan.nextjs_hosts {host → {version, version_inferred, react_version, router, cves[], ...}} scan.vulnerabilities [{host, endpoint, bypass, status_code, body_snippet, ...}] scan.vulnerability_summary {total, by_host, by_endpoint} ``` ## 法律声明 此工具仅供**授权的安全测试**使用。请仅扫描您拥有或获得明确书面授权进行测试的系统。未经授权的扫描可能会违反您所在司法管辖区的计算机犯罪相关法律。 ## 开源许可 MIT —— 见 [LICENSE](LICENSE)
标签:AV绕过, FastAPI, GitHub, Python, Web安全, 加密, 子域名枚举, 实时处理, 密码管理, 无后门, 漏洞扫描器, 系统安全, 蓝队分析, 运行时操纵, 逆向工具