一键导入
automated-subdomain-enumeration
Systematic approach to discovering subdomains through passive and active reconnaissance techniques
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Systematic approach to discovering subdomains through passive and active reconnaissance techniques
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Systematic approach to analyzing compiled binaries, understanding program behavior, and identifying vulnerabilities without source code access
Methodical approach to finding security vulnerabilities through source code review and static analysis
Systematic approach to discovering novel vulnerabilities through code analysis, fuzzing, and attack surface research
Systematic methodology for developing reliable exploits from vulnerability discovery to weaponization
Building effective fuzzing harnesses to maximize code coverage and vulnerability discovery through automated input generation
Techniques for creating and adapting payloads for various exploitation scenarios, target environments, and evasion requirements
| name | Automated Subdomain Enumeration |
| description | Systematic approach to discovering subdomains through passive and active reconnaissance techniques |
| when_to_use | When performing initial reconnaissance on a target domain, building an attack surface map, or identifying forgotten or misconfigured subdomains that may present vulnerabilities |
| version | 1.0.0 |
| languages | bash, python, go |
Subdomain discovery is a critical first step in reconnaissance. Forgotten subdomains often contain vulnerabilities, outdated software, or misconfigurations that attackers can exploit. A systematic approach combines multiple data sources and techniques to build a comprehensive subdomain list.
Core principle: Combine passive reconnaissance (non-intrusive) with active enumeration (DNS queries, brute-forcing) to maximize coverage while respecting scope and legal boundaries.
Use this skill when:
Don't use when:
Goal: Gather subdomains without directly touching target infrastructure.
Techniques:
Certificate Transparency Logs
# Use crt.sh or similar CT log search
curl -s "https://crt.sh/?q=%25.target.com&output=json" | \
jq -r '.[].name_value' | \
sed 's/\*\.//g' | \
sort -u > ct_subdomains.txt
Search Engine Dorking
# Google dorks for subdomains
# site:target.com -www
# Use tools like subfinder, amass with passive sources
subfinder -d target.com -silent -all -o passive_subdomains.txt
DNS Aggregators
GitHub/GitLab Code Search
# Search for domain mentions in code
# "target.com" site:github.com
# Look for: config files, API endpoints, documentation
Web Archives
# Wayback Machine API
curl -s "http://web.archive.org/cdx/search/cdx?url=*.target.com/*&output=json&fl=original&collapse=urlkey" | \
jq -r '.[] | .[0]' | \
grep -oP '(?<=://)[^/]*' | \
sort -u >> archive_subdomains.txt
Goal: Actively query DNS infrastructure to discover additional subdomains.
Techniques:
Brute Force with Wordlists
# Use tools like puredns, massdns, or dnsx
puredns bruteforce wordlist.txt target.com \
--resolvers resolvers.txt \
--write active_subdomains.txt
DNS Zone Transfers (if misconfigured)
# Test for zone transfer vulnerability
dig axfr @ns1.target.com target.com
Reverse DNS Lookups
# Get IP ranges, perform reverse lookups
# Useful for finding additional subdomains on same infrastructure
Permutation Scanning
# Generate permutations of found subdomains
# Example: dev.api.target.com, staging.api.target.com
altdns -i subdomains.txt -o permuted.txt -w words.txt
dnsx -l permuted.txt -o verified_permuted.txt
Goal: Verify discovered subdomains are live and gather additional context.
Live Host Detection
# Use httpx to probe for web services
cat all_subdomains.txt | httpx -silent -o live_hosts.txt
# Get status codes, titles, tech stack
httpx -l all_subdomains.txt -title -tech-detect -status-code -o enriched.txt
Port Scanning
# Identify services on discovered hosts
naabu -list live_hosts.txt -p 80,443,8080,8443 -o ports.txt
Screenshot Capture
# Visual reconnaissance of web interfaces
gowitness file -f live_hosts.txt -P screenshots/
Technology Fingerprinting
# Identify web technologies, frameworks, CMS
wappalyzer -l live_hosts.txt -o tech_stack.json
Goal: Structure discovered data for efficient analysis and next steps.
Categorize Subdomains
Prioritize Targets
Document Findings
# Target: target.com
## Statistics
- Total subdomains discovered: X
- Live hosts: Y
- Unique IP addresses: Z
- Technologies identified: [list]
## High-Priority Targets
1. dev.api.target.com - Swagger UI exposed, no auth
2. old-admin.target.com - PHP 5.6, potential RCE
3. test-payment.target.com - Test environment with prod data?
## Next Steps
- Deep enumeration of api.target.com endpoints
- Vulnerability scan of outdated PHP instance
- Manual inspection of test environment
All-in-one suites:
Specialized tools:
Setup example:
# Install Go tools
go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install github.com/projectdiscovery/dnsx/cmd/dnsx@latest
go install github.com/projectdiscovery/httpx/cmd/httpx@latest
go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest
# Install other dependencies
pip install altdns
#!/bin/bash
# automated_subdomain_enum.sh
DOMAIN=$1
OUTPUT_DIR="${DOMAIN}_recon_$(date +%Y%m%d_%H%M%S)"
mkdir -p "$OUTPUT_DIR"
echo "[*] Starting subdomain enumeration for $DOMAIN"
# Phase 1: Passive
echo "[*] Phase 1: Passive reconnaissance"
subfinder -d "$DOMAIN" -all -silent -o "$OUTPUT_DIR/subfinder.txt"
assetfinder --subs-only "$DOMAIN" > "$OUTPUT_DIR/assetfinder.txt"
curl -s "https://crt.sh/?q=%25.$DOMAIN&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u > "$OUTPUT_DIR/crtsh.txt"
# Combine and deduplicate
cat "$OUTPUT_DIR"/{subfinder,assetfinder,crtsh}.txt | sort -u > "$OUTPUT_DIR/passive_all.txt"
echo "[+] Found $(wc -l < "$OUTPUT_DIR/passive_all.txt") unique subdomains (passive)"
# Phase 2: Active (optional, comment out if too noisy)
# echo "[*] Phase 2: Active enumeration"
# puredns bruteforce /path/to/wordlist.txt "$DOMAIN" -r /path/to/resolvers.txt -w "$OUTPUT_DIR/bruteforce.txt"
# Phase 3: Validation
echo "[*] Phase 3: Validating and probing subdomains"
cat "$OUTPUT_DIR/passive_all.txt" | dnsx -silent -o "$OUTPUT_DIR/validated.txt"
httpx -l "$OUTPUT_DIR/validated.txt" -title -status-code -tech-detect -silent -o "$OUTPUT_DIR/live_hosts.txt"
echo "[+] Found $(wc -l < "$OUTPUT_DIR/live_hosts.txt") live hosts"
echo "[*] Results saved to $OUTPUT_DIR/"
CRITICAL: Always follow these rules:
Get Written Authorization
Respect Rate Limits
Handle Data Responsibly
Document Everything
| Mistake | Impact | Solution |
|---|---|---|
| Only using one data source | Miss many subdomains | Combine multiple techniques |
| Skipping validation | False positives waste time | Always verify with DNS queries |
| Too aggressive active scanning | Detection, blocking, legal issues | Start passive, escalate carefully |
| Not categorizing results | Inefficient analysis | Organize findings by priority |
| Ignoring out-of-scope domains | Legal/ethical violations | Strictly adhere to authorized scope |
This skill works with:
A successful subdomain enumeration should: