# DetectRadar — Complete Technical & API Reference (`llms-full.txt`) > DetectRadar (`https://detectradar.com`) 是一套免注册的代理环境与网络泄露诊断工具,同时提供面向终端用户与自动化脚本的零鉴权自查 JSON 接口。 > DetectRadar is an open-source (MIT) proxy environment, leak detection, and browser consistency suite combining an Astro/Svelte web client with a Go backend and an authoritative DNS probe server (NS + DNSTap). --- ## 1. Web Tools / 核心工具页面 - **`https://detectradar.com/`** — 网络环境一致性检测雷达(首页): 1. **出口网络身份**:结合云 CIDR、ASN、BGP 与 rDNS 分类 `usage_type`(`"isp" | "hosting" | "unknown"`),联合 DNSBL/PBL 黑名单与开放代理端口评估风险,返回 `fraud_score` 与标签。 2. **一致性(Consistency)**:仅比对浏览器 `Intl` 时区与 IP 归属时区偏移(UTC offset normalized)、以及 `navigator.languages` 与出口国家常用语。硬件行仅展示,不计入扣分。 3. **泄露排查(Leaks)**:通过 STUN ICE 候选捕捉 WebRTC 与 IPv6 候选,并异步结合权威 DNS 探测(`/dns-leak-test/`)识别后台直连泄露。**边界提示**:前端 IPv6 探针(`ipv6.ts`)复用 WebRTC ICE 候选,如果在浏览器彻底禁用 WebRTC,浏览器端不会触发 IPv6 ICE 泄露告警;请使用 `curl -6 -s https://detectradar.com/api/v1/ip` 单独复核 IPv6 出口。 4. **浏览器指纹(Fingerprint & Automation)**:在浏览器本地对 Canvas、Audio、WebGL 渲染输出与 WebGL 扩展列表计算 **SHA-256 哈希**后上报(`unmasked_vendor` 与 `unmasked_renderer` 原文上传);仅对比 WebGL 显卡声明与 `navigator.platform` 操作系统是否自洽(不校验出口国家),并检测 `navigator.webdriver` 自动化标记。 - **`https://detectradar.com/dns-leak-test/`** — DNS 泄露专项检测与对比页: - 每次检测生成全新随机子域 `r{rand}-{testID}.`,杜绝递归缓存影响;支持修改代理或路由器配置后同页复测并并排展示与上次结果差异。 --- ## 2. DNS Verdict Policy v2 (`assessment.go` / `dnsPresentation.ts`) DetectRadar 第 2 版 DNS 判定规则严格限制触发条件,防止把用户主动配置的公共 DoH 误报为本地运营商泄露: - **`public`(跳过误判 / 仅作展示)**:`AliDNS`(`223.5.5.5` / `223.6.6.6`)、`DNSPod`(`119.29.29.29`)、`AdGuard DNS`、`Cloudflare`、`Google`、`Quad9`、`OpenDNS`、`NextDNS` 等已知公共递归解析器。 - **`hosting`(跳过误判)**:通用机房/托管节点解析器不触发运营商接入网泄露告警。 - **`domestic-exit`(判定:`未泄露`)**:当当前出口 IP `country == "CN"` 时,返回安全结论。 - **`mainland-carrier`(判定:`泄露`)**:**仅当** `exit.Country != "CN"` **且**捕获到 `country == "CN"` 且 `network_type == "access"`(境内运营商接入侧解析器)时判定为泄露。 - **`unobserved`(页面显示:`无 DNS 结果`)** / **`unknown`(页面显示:`无法判断`)**:未捕获解析样本,或缺少出口/解析器国家信息。 --- ## 3. Zero-Auth JSON API & CLI Workflows 所有 `/api/` 与 `/health` 路径通过 Nginx `X-Robots-Tag: noindex, nofollow` 防止原始 JSON 进入搜索引擎索引,但对终端用户、`curl`、AI Agent 与监控脚本免鉴权开放(按连接客户端真实源 IP 自查)。 ### 3.1 Exit IP Intelligence: `GET /api/v1/ip` Default (`L1+L2`, no external latency): ```bash curl -s https://detectradar.com/api/v1/ip ``` Observed JSON response schema: ```json { "ip": "69.63.208.30", "country": "US", "country_name": "美国", "city": "Los Angeles", "region": "加利福尼亚", "postal": "90017", "timezone": "America/Los_Angeles", "latitude": 34.052571, "longitude": -118.243907, "asn": "AS906", "org": "DMIT Cloud Services", "is_vpn": false, "is_proxy": false, "is_tor": false, "is_relay": false, "is_hosting": true, "is_mobile": false, "is_anonymous": false, "usage_type": "hosting", "confidence": 100, "detect_method": "asn_match", "fraud_score": 0, "tip": "当前为托管/机房 IP", "source": "local", "tier": "L1+L2", "fetched_at": "2026-11-21T17:59:02.889703972+08:00" } ``` Notes: - `usage_type` enum is `"isp" | "hosting" | "unknown"` (there is NO `"datacenter"` string value). - Default `L1+L2` mode keeps `is_vpn` and `is_proxy` at Go zero-value `false`; append `?deep=true` to invoke upstream `L3` enrichment (`"tier": "L1+L2+L3"`). - Verify dual-stack separation in shell: ```bash curl -4 -s https://detectradar.com/api/v1/ip curl -6 -s https://detectradar.com/api/v1/ip ``` ### 3.2 Exit IP Reputation: `GET /api/v1/ip/reputation` ```bash curl -s https://detectradar.com/api/v1/ip/reputation ``` Returned keys: - `ip`, `level`, `blacklist_hit`, `blacklist_sources`, `pbl_listed`, `open_ports`, `open_proxy_port`, `weak_proxy_port`, `is_tor_exit`, `exposure_tags`, `checked_sources`, `recommendation`. ### 3.3 Terminal DNS Leak Test: `POST /api/v1/leaks/dns` + `dig` + `GET /api/v1/leaks/dns/{id}` Step 1 — Create probe token: ```bash curl -s -X POST https://detectradar.com/api/v1/leaks/dns ``` Response: ```json { "id": "leak_dns_b1e7ecdb", "test_domain": "b1e7ecdb18225455812f070fe72ef59b.leak.detectradar.com", "created_at": "2026-11-21T10:06:09Z", "expires_at": "2026-11-21T11:06:09Z" } ``` Step 2 — Resolve a subdomain under `test_domain` from the device/network under test: ```bash dig +short "r1.b1e7ecdb18225455812f070fe72ef59b.leak.detectradar.com" ``` Step 3 — Fetch captured recursive resolvers & assessment: ```bash curl -s "https://detectradar.com/api/v1/leaks/dns/leak_dns_b1e7ecdb" ``` Response keys: ```json { "id": "leak_dns_b1e7ecdb", "leaked": false, "level": "unknown", "dns_servers": [ { "ip": "111.23.238.154", "country": "CN", "isp": "移动", "asn": "AS56047", "network_type": "access", "queried_at": "2026-11-21T10:06:24Z" } ], "expected_country": "", "actual_countries": ["CN", "US"], "recommendation": "无法判断", "assessment": { "policy_version": 2, "state": "unknown", "reason": "missing-exit" } } ``` Tip: When invoked purely from CLI without browser `scan_id`, `expected_country` is empty (`missing-exit`), while `dns_servers` still lists every resolver IP, country, ISP, ASN, and `network_type` (`"public" | "access" | "hosting"`) observed by DetectRadar's authoritative NS. Compare `dns_servers` against `GET /api/v1/ip`, or POST `{ "exit": ..., "resolvers": ... }` to `POST /api/v1/leaks/dns/assessment` to run Policy v2 directly. --- ## 4. Machine-Readable Metadata & Policies - **License**: MIT (`https://opensource.org/licenses/MIT`), source at `https://github.com/harrisonwang/detect-radar` - **Sitemaps**: `https://detectradar.com/sitemap.xml` / `https://detectradar.com/sitemap-index.xml` - **Robots & Content Signals**: `https://detectradar.com/robots.txt` (`Content-Signal: search=yes, ai-input=yes, ai-train=yes`) - **Legal / Contact**: `/privacy/`, `/terms/`, `/contact/` (`admin@detectradar.com`)