the-lobsternaut/netrecon-sdn-plugin

GitHub: the-lobsternaut/netrecon-sdn-plugin

一款基于 C++17 的 SDN 被动网络侦察插件,通过聚合多源 OSINT 数据实现基础设施映射与风险评估。

Stars: 0 | Forks: 0

# 🌐 网络侦察插件 [![Build Status](https://img.shields.io/github/actions/workflow/status/the-lobsternaut/netrecon-sdn-plugin/build.yml?branch=main&style=flat-square)](https://github.com/the-lobsternaut/netrecon-sdn-plugin/actions) [![License](https://img.shields.io/badge/license-Apache--2.0-blue?style=flat-square)](LICENSE) [![C++17](https://img.shields.io/badge/C%2B%2B-17-blue?style=flat-square)](https://en.cppreference.com/w/cpp/17) [![SDN Plugin](https://img.shields.io/badge/SDN-Plugin-orange?style=flat-square)](https://github.com/the-lobsternaut) **被动网络情报 — DNS、WHOIS/RDAP、Certificate Transparency、子域名枚举、IP 地理位置、ASN 映射以及用于 OSINT 的基础设施分类。** ## 概述 NetRecon 插件执行被动网络侦察,以映射互联网基础设施并识别域名、IP 和服务背后的组织。所有技术均为被动方式(无端口扫描,无侵入性探测)。 ### 功能特性 - **被动 DNS** — 历史 DNS 解析记录和子域名发现 - **WHOIS/RDAP** — 注册人信息、创建/到期日期、注册商 - **Certificate Transparency** — 用于子域名枚举和证书历史记录的 CT 日志查询 - **IP 地理位置** — IP 地址的经纬度、城市、国家、ISP - **ASN 映射** — AS 编号到组织、对等关系 - **基础设施分类** — CDN、云服务 (AWS/GCP/Azure)、政府 (.gov/.mil)、军事 - **风险评分** — 暴露的服务、即将过期的证书、隐私代理使用情况 ## 架构 ``` graph TB subgraph "Data Sources" A["Passive DNS
(SecurityTrails, VirusTotal)"] B["WHOIS/RDAP
(ARIN, RIPE, APNIC)"] C["Certificate Transparency
(crt.sh, Censys)"] D["IP Geolocation
(MaxMind, ip-api)"] E["ASN Data
(PeeringDB, bgp.he.net)"] end subgraph "NetRecon Plugin" F["Query Engine"] G["Domain Resolver"] H["Infrastructure Classifier"] I["Risk Scorer"] J["$NET Serializer"] end subgraph "Output" K["$NET Binary"] L["→ Link Analysis ($LNK)"] end A & B & C & D & E --> F F --> G --> H --> I --> J --> K --> L ``` ## 数据源与 API | 来源 | URL | 类型 | 用途 | |--------|-----|------|---------| | **SecurityTrails** | [securitytrails.com](https://securitytrails.com/) | REST | 被动 DNS、子域名 | | **crt.sh** | [crt.sh](https://crt.sh/) | REST | Certificate Transparency 日志 | | **ARIN RDAP** | [rdap.arin.net](https://rdap.arin.net/) | RDAP | 北美 IP WHOIS | | **RIPE RDAP** | [rdap.db.ripe.net](https://rdap.db.ripe.net/) | RDAP | 欧洲 IP WHOIS | | **MaxMind GeoLite2** | [maxmind.com](https://www.maxmind.com/) | Database | IP 地理位置 | | **PeeringDB** | [peeringdb.com](https://www.peeringdb.com/) | REST | ASN/对等数据 | ## 研究与参考 - **RFC 7482** — 注册数据访问协议 (RDAP) 查询格式。 - **RFC 9083** — RDAP 的 JSON 响应。 - **RFC 6962** — Certificate Transparency。CT 日志规范。 - Durumeric, Z. et al. (2013). ["ZMap: Fast Internet-wide Scanning"](https://doi.org/10.5555/2504730.2504755)。*USENIX Security*。互联网扫描方法论背景。 - **OWASP** — [子域名枚举](https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/01-Information_Gathering/)。侦察技术。 ## 技术细节 ### 基础设施分类 | 类型 | 指标 | |------|-----------| | CDN | Cloudflare、Akamai、Fastly ASN + CNAME 模式 | | Cloud | AWS IP 范围、GCP、Azure ASN | | Government | .gov、.mil TLD、已知的政府 IP 范围 | | Military | .mil、DoD IP 空间、SIPR/NIPR 指标 | | ISP | 住宅/商业 ASN 分类 | ### 风险评分因子 | 因子 | 权重 | 描述 | |--------|--------|-------------| | 证书即将过期 | 高 | SSL 证书将在 30 天内过期 | | 隐私代理 | 中 | WHOIS 隐私保护 = 归因难度增加 | | 暴露的服务 | 高 | 来自 Censys/Shodan 的已知开放端口 | | 近期创建 | 中 | 域名创建时间 < 90 天 | | 无 DNSSEC | 低 | 缺少 DNSSEC 验证 | ## 构建说明 ``` git clone --recursive https://github.com/the-lobsternaut/netrecon-sdn-plugin.git cd netrecon-sdn-plugin mkdir -p build && cd build cmake ../src/cpp -DCMAKE_CXX_STANDARD=17 make -j$(nproc) ctest --output-on-failure ``` ## 使用示例 ``` #include "netrecon/types.h" netrecon::DomainRecord record{}; std::strncpy(record.domain, "example.com", 63); record.registrar = "Cloudflare, Inc."; record.created_epoch = 1609459200; record.lat_deg = 37.7749; record.lon_deg = -122.4194; record.infra_type = netrecon::InfraType::CLOUD; record.risk_score = 0.3f; auto buffer = netrecon::serialize({record}); ``` ## 插件清单 ``` { "schemaVersion": 1, "name": "netrecon", "version": "0.1.0", "description": "Network Reconnaissance — passive DNS, WHOIS/RDAP, CT logs, IP geolocation, ASN mapping.", "author": "DigitalArsenal", "license": "Apache-2.0", "inputFormats": ["application/json"], "outputFormats": ["$NET"] } ``` ## 许可证 Apache-2.0 — 详见 [LICENSE](LICENSE)。 *属 [Space Data Network](https://github.com/the-lobsternaut) 插件生态系统的一部分。*
标签:ASN映射, Bash脚本, C++17, CDN检测, CT日志, ESC4, GitHub, HTTP头分析, IP地理位置, OSINT, RDAP, SDN插件, Sigma 规则, WHOIS查询, 云服务识别, 军事设施, 协议探测, 域名分析, 基础设施识别, 子域名枚举, 实时处理, 情报收集, 政府网络, 漏洞研究, 系统安全, 网络安全, 被动DNS, 证书透明度, 资产测绘, 边界发现, 隐私保护, 风险评分