external-enumeration

被动映射公司的域名、子域名、DNS 所有权、技术栈和 CDN。用于侦察外部攻击面或枚举子域名。

仓库最近推送
GitHub Stars
156
Forks
34
Issues / PRs
0

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "external-enumeration":https://skillpi.com/zh/skills/deepskill-78e5d01ff046f39a9123c2f8c3ea18710681eb170d7ae402d0ac0d4423925bba。安装前核对上游来源和版本:https://github.com/forefy/.context。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

被动映射公司的域名、子域名、DNS 所有权、技术栈和 CDN。用于侦察外部攻击面或枚举子域名。

0 下载

介绍来源: third_party · forefy · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: external-enumeration
description: Passively map a company's domains, subdomains, DNS ownership, tech stack, and CDNs. Use to recon an external attack surface or enumerate subdomains.

External Enumeration Skill

You are performing passive external reconnaissance on a target company's domain infrastructure. Goal: produce a comprehensive, structured map of all domains, subdomains, technology stack, and notable security observations - using only passive/OSINT techniques (no active exploitation).


Phase 0 - Scope Clarification

Ask the user for:

  1. Primary domain(s) to enumerate (e.g. example.com)
  2. Known subsidiaries or related companies (acquisitions, brand names, sister domains)
  3. Output format - markdown report to a file path?
  4. Depth - quick pass (passive DNS only) or deep pass (stealth browser + port scan)?

Phase 1 - Domain Ownership & Attribution

Before enumerating subdomains, confirm what domains are actually owned by the target.

1.1 WHOIS Check

whois <domain> | grep -iE 'registrar|creation|name server|registrant'

Note: Most domains use privacy protection (e.g. GoDaddy DomainsbyProxy) - registrant names will be hidden. Do NOT rely on registrant names for attribution.

1.2 Nameserver Correlation (Primary Attribution Method)

for d in domain1.com domain2.io domain3.net; do
  echo -n "$d: "; dig NS $d +short | sort | tr '\n' ' '; echo
done

Identical NS pairs = same DNS account = same owner. This is the strongest passive attribution proof even when WHOIS is privacy-protected.

1.3 MX + TXT Record Cross-Reference

dig MX <domain> +short
dig TXT <domain> +short
  • Shared *.mail.protection.outlook.com MX = same Microsoft 365 tenant
  • TXT records reveal: Azure site verifications, Google Workspace, Atlassian, SendGrid
  • Azure TXT format: MS=ms... or azurewebsites.net subdomain references → same Azure tenant

1.4 Similar-Name Domain Trap

Note: Always verify similar-sounding domains (e.g. target.net, target.co) are actually owned by the target - different registrar or NS pair = likely unrelated squatter. Never assume.


Phase 2 - Multi-Source Subdomain Enumeration

Run all sources in parallel on first pass. crt.sh alone is never sufficient.

2.1 Certificate Transparency (crt.sh)

curl -s "https://crt.sh/?q=%.example.com&output=json" \
  | python3 -c "import sys,json; [print(e['name_value']) for e in json.load(sys.stdin)]" \
  | tr ',' '\n' | sort -u | grep -v '^\*'

2.2 HackerTarget

curl -s "https://api.hackertarget.com/hostsearch/?q=example.com" | cut -d',' -f1 | sort -u

2.3 Wayback Machine

curl -s "https://web.archive.org/cdx/search/cdx?url=*.example.com&output=text&fl=original&collapse=urlkey" \
  | grep -oP '[\w.-]+\.example\.com' | sort -u

2.4 urlscan.io

curl -s "https://urlscan.io/api/v1/search/?q=domain:example.com&size=100" \
  | python3 -c "import sys,json; d=json.load(sys.stdin); [print(r['page']['domain']) for r in d.get('results',[])]" \
  | sort -u

2.5 RapidDNS

curl -s "https://rapiddns.io/subdomain/example.com?full=1" \
  | grep -oP '[\w.-]+\.example\.com' | sort -u

2.6 AlienVault OTX

Note: Turn off ssl verification if using Python urllib. Rate limiting is aggressive; skip if blocked.

curl -s "https://otx.alienvault.com/api/v1/indicators/domain/example.com/passive_dns" \
| python3 -c "import sys,json; [print(r.get('hostname','')) for r in json.load(sys.stdin).get('passive_dns',[])]" \
| sort -u

2.7 subfinder (if installed)

subfinder -d example.com -silent 2>/dev/null | sort -u

Install: brew install subfinder

2.8 Deduplicate Everything

cat all_sources.txt | sort -u > subdomains_unique.txt
wc -l subdomains_unique.txt

Phase 3 - DNS Resolution & Live Check

# Resolve all subdomains, identify live ones
while read sub; do
  ip=$(dig +short A "$sub" 2>/dev/null | grep -m1 -oP '\d+\.\d+\.\d+\.\d+')
  if [ -n "$ip" ]; then
    echo "$sub -> $ip"
  fi
done < subdomains_unique.txt

Phase 4 - One-Pass Comprehensive Header Harvest

Collect ALL headers in a single pass. Do not come back for a second pass.

collect_headers() {
  local sub=$1
  local result=$(curl -sk -o /dev/null \
    --max-time 10 \
    -D - \
    -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36" \
    "https://$sub" 2>/dev/null | head -80)

  local status=$(echo "$result" | head -1 | grep -oP '\d{3}')
  local ip=$(dig +short A "$sub" 2>/dev/null | grep -m1 -oP '\d+\.\d+\.\d+\.\d+')

  python3 -c "
import sys, json
headers_raw = '''$result'''
h = {}
for line in headers_raw.split('\n')[1:]:
    if ': ' in line:
        k, v = line.split(': ', 1)
        h[k.lower().strip()] = v.strip()
print(json.dumps({'subdomain': '$sub', 'status': '$status', 'ip': '$ip', **h}))
"
}

Phase 5 - Technology Identification

5.1 From Server Headers

server value Technology
cloudflare Cloudflare WAF/proxy
gunicorn Python WSGI - direct exposure, no WAF
nginx Nginx (may be direct or behind CDN)
UploadServer Google Cloud Storage
AmazonS3 AWS S3 bucket

5.2 From CNAME Chains

dig CNAME <subdomain> +short
CNAME target Platform
*.hubspot.net HubSpot (email/link tracking)
*.lmspowered.com LearnUpon LMS
*.partner-experience.com Partner portal SaaS
*.pendo.io Pendo product analytics
*.salesforce.com Salesforce CRM
*.zendesk.com Zendesk support
*.freshdesk.com Freshdesk support
*.atlassian.net Atlassian (Jira/Confluence)
*.cloudfront.net AWS CloudFront (if direct CNAME, not leaked via)
*.vercel.app Vercel hosting
*.netlify.app Netlify hosting
*.azurewebsites.net Azure App Service

5.3 From Redirect Targets (location header)

  • launcher.myapps.microsoft.com → Azure AD SSO (check URL for tenant ID)
  • *.okta.com → Okta SSO
  • accounts.google.com → Google Workspace SSO
  • *.auth0.com → Auth0

5.4 Azure AD Tenant ID Extraction

If redirect leads to Microsoft login:

location: https://launcher.myapps.microsoft.com/api/signin/APP_ID?tenantId=TENANT_UUID

Extract tenantId= value - this is the organization's Azure AD tenant ID.


Phase 6 - Dual CDN Detection

This is a high-value finding often missed on first pass.

The pattern: Cloudflare as outer WAF → AWS CloudFront as real CDN → origin

curl -sI https://app.example.com | grep -iE 'via|x-amz|x-cache|server'

Indicators:

  • server: cloudflare AND via: 1.1 xxxxxxxxx.cloudfront.net (CloudFront) → dual CDN confirmed
  • x-amz-cf-pop: TLV55-P1 → CloudFront PoP in Tel Aviv
  • x-cache: Miss from cloudfront → CloudFront active behind CF
  • x-amz-cf-id: → unique CloudFront request ID

Why it matters: Reveals true backend CDN provider, geographic PoP locations, and hints at origin server region.


Phase 7 - Cloudflare Bypass (Stealth Browser)

When Cloudflare blocks curl, use stealth Playwright.

Note: Critical package name: Use puppeteer-extra-plugin-stealth - NOT playwright-extra-plugin-stealth (that package does NOT exist and will throw an error).

cd /tmp && mkdir cf-stealth && cd cf-stealth
npm init -y
npm install playwright playwright-extra puppeteer-extra-plugin-stealth
npx playwright install chromium
const { chromium } = require('playwright-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
chromium.use(StealthPlugin());

const targets = [
  'https://app.example.com',
];

(async () => {
  const browser = await chromium.launch({ headless: true });
  for (const url of targets) {
    const page = await browser.newPage();
    const headers = {};
    page.on('response', async resp => {
      if (resp.url() === url || resp.url().startsWith(url)) {
        Object.assign(headers, resp.headers());
      }
    });
    try {
      await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 15000 });
      console.log(JSON.stringify({ url, headers }));
    } catch(e) {
      console.log(JSON.stringify({ url, error: e.message }));
    }
    await page.close();
  }
  await browser.close();
})();

Phase 8 - Nonintrusive Port Probe (Second Pass)

Don't run on Cloudflare IPs, don't run on WAFs/CDNs protected targets. Only look for applicative ports, don't overdo the web scan to more than a few strategic port decisions (passive-first approach).

for host in direct-ip-1 direct-ip-2; do
  for port in 80 443 8080 8443 3000 4443; do
    result=$(curl -sk --max-time 5 -o /dev/null -w "%{http_code}" \
      "$([ $port = 443 ] || [ $port = 8443 ] && echo https || echo http)://$host:$port/")
    [ "$result" != "000" ] && echo "$host:$port -> HTTP $result"
  done
done

Phase 9 - Subsidiary & Acquisition Research

Stealth startups acquired by the target may have no public domain - this is normal.

Search strategy:

  1. "[company name]" acquisition site:crunchbase.com
  2. "[company name]" acquired site:techcrunch.com OR site:businesswire.com
  3. LinkedIn: search target company name → filter by "acquired by" or check leadership history
  4. Check registrant/NS of likely related domains (founder names, product names)

Note: A stealth startup may have: no domain, no Wayback archive, no CT certificates, no passive DNS entries - this is expected, not a gap in enumeration.


Phase 10 - Notable Findings (Auto-Flag)

Always flag these automatically in the report:

Pattern Flag
access-control-allow-origin: * Warning - Open CORS - unauthenticated cross-origin requests allowed
HTTP 525 status Warning - SSL Handshake Failure - origin SSL misconfiguration behind Cloudflare
server: gunicorn or server: unicorn with no CDN Warning - Direct backend exposure - no WAF, origin IP exposed
HTTP 301 → self (same host) Info - Likely internal-only / auth-required (especially on cslab*, vpn*, admin*)
Azure AD tenantId= in redirect URL Info - Azure AD Tenant ID leak - extract UUID
x-amz-cf-pop with city code Info - CDN geographic PoP - reveals infrastructure region
via: *.cloudfront.net on a CF-served domain Info - Dual CDN architecture
Subdomain → *.mail.protection.outlook.com CNAME Info - Microsoft 365 tenant confirmation

Phase 11 - Report Structure

Always produce the markdown report with this structure:

# [Company] Recon Report
**Date:** YYYY-MM-DD  
**Scope:** domain1.com · domain2.io · domain3.com

## Table of Contents
1. Confirmed Owned Domains
2. Technology Stack Summary
3. Notable Findings
4. [Primary Domain] - Subdomain Headers
   - Live - Cloudflare + CloudFront (Dual CDN)
   - Live - Cloudflare Only
   - Live - Third-Party / No CDN
   - Cloudflare DNS-Only / No HTTP Response
5. [Other domains]
6. Ownership & Attribution
7. Enumeration Sources

## 1. Confirmed Owned Domains
| Domain | Registrar | Created | Nameservers | Verdict |

## 2. Technology Stack Summary
| Layer | Technology | Evidence |

## 3. Notable Findings
| Finding | Detail |

## 4. Per-Subdomain Tables
### [subdomain]
| Header | Value |
(include: status, ip, server, via, x-amz-cf-pop, x-cache, x-frame-options, CSP, CORS, location, platform)

## 5. Ownership & Attribution
(people, entities, investors, Azure tenant, WHOIS proof)

## 6. Enumeration Sources
| Source | Results | Method |
**Total unique subdomains: N**  
**Vercel detected: yes / no**

Common Pitfalls Reference

Pitfall Correct Approach
Assuming WHOIS registrant names identify owner Use NS correlation + MX + TXT instead (privacy protection hides names)
Assuming target.net or target.co = same company Verify NS + MX independently - often different owners
Running crt.sh only for subdomain discovery Always run 6+ sources in parallel
Doing header harvest after initial recon Collect ALL headers in the first live check pass
Port scanning CF-fronted IPs Pointless - Cloudflare terminates connections. Only port-scan direct/non-CF IPs

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 解决安全专业人员外部攻击面测绘的高频刚需
  • 提供端到端的被动侦察方法论,覆盖域名归属、子域枚举、技术栈识别等完整链条
触发精准88/100

待提升项

  • 缺少显式'When to Use'章节 原报告严重程度:轻微

    文档未设置独立的'When to Use'使用场景说明段落

    改进建议:建议在Phase 0前增加'When to Use'章节,明确适用场景如红队评估、威胁情报收集等

亮点

  • 触发词精准覆盖被动枚举、子域名发现、DNS所有权分析等核心能力
结构规范85/100

亮点

  • Phase划分清晰,从范围确认到报告生成共11个阶段逻辑连贯
  • 包含常见陷阱参考和自动标记规则,提升实用性
  • 提供了完整的Markdown报告模板结构
执行可靠82/100

待提升项

  • Bash脚本错误处理可增强 原报告严重程度:轻微

    部分curl/dig命令未显式处理网络超时或DNS解析失败的情况

    改进建议:建议在关键网络操作中添加更明确的错误重试或跳过机制

亮点

  • 工具来源均为标准OSINT平台(crt.sh、urlscan.io等),参数使用正确
  • 针对Cloudflare拦截提供了Playwright隐身浏览器作为可靠fallback方案
  • 端口探测明确排除CDN IP,避免无效扫描
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • api.hackertarget.com
  • app.example.com
  • crt.sh
  • launcher.myapps.microsoft.com
  • otx.alienvault.com
  • rapiddns.io
  • urlscan.io
  • web.archive.org

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。