Subdomain Enumeration Araçları (Detaylı Anlatım ve Uygulama Teknikleri)
Subdomain Enumeration, bir hedef domain'e ait alt domain'leri (subdomain) tespit etme sürecidir. Bug bounty ve pentest'lerin en kritik aşamalarından biridir. Çünkü ana domain güvenli olsa bile, unutulmuş, zayıf yapılandırılmış veya test amaçlı subdomain'ler zafiyet içerebilir.
Subdomain Enumeration Yöntemleri:
1. DNS Brute Force
DNS sorguları ile olası subdomain'leri dene
Wordlist bazlı çalışır
2. DNS Zone Transfer (Eski)
Zone transfer (AXFR) ile tüm DNS kayıtlarını alma
Modern sistemlerde genellikle devre dışı
3. Search Engine OSINT
Google, Bing, DuckDuckGo ile subdomain arama
site:*.hedef.com sorgusu
4. Certificate Transparency Logs
SSL/TLS sertifikalarından subdomain'leri çekme
crt.sh, CertSpotter
5. DNS Records (MX, NS, TXT)
MX, NS, TXT kayıtlarından subdomain'leri bulma
Google Workspace, Office365, Cloudflare vb.
6. Bruteforce via Public Resolvers
Public DNS resolver'lar (8.8.8.8, 1.1.1.1) ile brute force
Subdomain Enumeration Araçları:
1. Subfinder (En Hızlı ve Güvenilir)
Açıklama: Passive subdomain enumeration aracı. API tabanlı çalışır, hedefe doğrudan istek atmaz.
Kurulum:
bash
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
Kullanım:
bash
# Temel kullanım
subfinder -d hedef.com
# Sessiz mod (sadece subdomain'leri göster)
subfinder -d hedef.com -silent
# Çıktıyı dosyaya yaz
subfinder -d hedef.com -o subdomains.txt
# Birden fazla domain
subfinder -dL domains.txt -o all_subdomains.txt
# Tüm kaynakları kullan (hızlı değil)
subfinder -d hedef.com -all
Kaynaklar:
AlienVault OTX
SecurityTrails
Censys
Shodan
VirusTotal
PassiveDNS
ThreatCrowd
CertSpotter
DNSDB
BinaryEdge
2. Amass (OWASP - En Kapsamlı)
Açıklama: OWASP projesi, en kapsamlı subdomain enumeration aracı. Passive + Active + Brute Force.
Kurulum:
bash
go install -v github.com/OWASP/Amass/v3/...@master
Kullanım:
bash
# Passive mod (sadece OSINT)
amass enum -passive -d hedef.com -o subdomains.txt
# Active mod (DNS brute force + passive)
amass enum -d hedef.com -o subdomains.txt
# Tüm alt domain'leri ara
amass enum -d hedef.com -o subdomains.txt -active -brute
# Çıktı formatları
amass enum -d hedef.com -json output.json
amass enum -d hedef.com -csv output.csv
# DNS rezolvasyonu ile birlikte
amass enum -d hedef.com -o subdomains.txt -ip -whois
# Subdomain takeover kontrolü
amass enum -d hedef.com -config config.ini
Amass Config (config.ini):
ini
[resolvers]
resolvers = [
"1.1.1.1",
"8.8.8.8",
"9.9.9.9"
]
[bruteforce]
wordlist = /path/to/wordlist.txt
recursive = true
3. Assetfinder (Hızlı ve Basit)
Açıklama: Tom Hudson tarafından geliştirilmiş, hızlı ve basit passive subdomain aracı.
Kurulum:
bash
go install github.com/tomnomnom/assetfinder@latest
Kullanım:
bash
# Temel kullanım
assetfinder hedef.com
# Sadece subdomain'ler
assetfinder --subs-only hedef.com
# Çıktıyı dosyaya yaz
assetfinder --subs-only hedef.com > subdomains.txt
4. DNSx (ProjectDiscovery)
Açıklama: DNS sorgulama aracı, subdomain listesini doğrulamak ve DNS kayıtlarını almak için.
Kurulum:
bash
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
Kullanım:
bash
# DNS sorgusu
dnsx -d hedef.com -a -cname -txt -mx -ns
# Subdomain listesini doğrula
dnsx -l subdomains.txt -a -o resolved.txt
# Wildcard tespiti
dnsx -d hedef.com -wd
# JSON çıktı
dnsx -d hedef.com -a -cname -txt -json
5. Shuffledns (MassDNS + Subfinder)
Açıklama: Subfinder + MassDNS kombinasyonu, hızlı brute force için.
Kurulum:
bash
go install -v github.com/projectdiscovery/shuffledns/cmd/shuffledns@latest
Kullanım:
bash
# Subfinder + Shuffledns
subfinder -d hedef.com -silent | shuffledns -d hedef.com -r resolvers.txt -o subdomains.txt
# Brute force ile
shuffledns -d hedef.com -w wordlist.txt -r resolvers.txt
# Rate limiting
shuffledns -d hedef.com -w wordlist.txt -r resolvers.txt -t 100
6. Chaos (ProjectDiscovery API)
Açıklama: ProjectDiscovery'nin topladığı subdomain veritabanı.
Kurulum:
bash
go install -v github.com/projectdiscovery/chaos-client/cmd/chaos@latest
Kullanım:
bash
# API key ile
chaos -d hedef.com -key YOUR_API_KEY
# Sessiz mod
chaos -d hedef.com -key YOUR_API_KEY -silent
# Çıktı
chaos -d hedef.com -key YOUR_API_KEY -o subdomains.txt
7. Findomain (Rust ile Yazılmış)
Açıklama: Hızlı, cross-platform subdomain aracı.
Kurulum:
bash
# Linux/macOS
wget https://github.com/Edu4rdSHL/findomain/releases/latest/download/findomain-linux
chmod +x findomain-linux
sudo mv findomain-linux /usr/local/bin/findomain
# Windows
# findomain-windows.exe indir
Kullanım:
bash
# Temel
findomain -t hedef.com
# Çıktı
findomain -t hedef.com -o
# Birden fazla
findomain -f domains.txt -o
8. CRT.sh (Certificate Transparency)
Açıklama: Certificate Transparency log'larından subdomain'leri çeker.
Kullanım (API):
bash
curl -s "https://crt.sh/?q=%.hedef.com&output=json" | jq -r '.[].name_value' | sort -u
Python Script:
python
import requests
import json
def get_subdomains_crt(domain):
url = f"https://crt.sh/?q=%.{domain}&output=json"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
subdomains = set()
for entry in data:
name = entry.get('name_value', '')
if name:
subdomains.add(name.lower())
return subdomains
return set()
9. SecurityTrails API
Açıklama: SecurityTrails DNS veritabanı API.
Kullanım:
bash
curl -s "https://api.securitytrails.com/v1/domain/hedef.com/subdomains" \
-H "APIKEY: YOUR_API_KEY" \
| jq -r '.subdomains[]' | while read sub; do echo "$sub.hedef.com"; done
10. AlienVault OTX
Açıklama: AlienVault OTX API ile subdomain'leri çeker.
Kullanım:
bash
curl -s "https://otx.alienvault.com/api/v1/indicators/domain/hedef.com/url_list?limit=100" \
| jq -r '.url_list[].url' | unfurl domains | sort -u
Subdomain Enumeration Wordlist'ler:
Popüler Wordlist'ler:
bash
# SecLists
/usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-20000.txt
/usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt
# Assetnote
# Commonspeak
github.com
# JW
Kendi Wordlist'inizi oluşturma:
bash
# Common subdomain'ler
cat common.txt > custom.txt
# Teknoloji bazlı
echo "api" >> custom.txt
echo "dev" >> custom.txt
echo "test" >> custom.txt
echo "stage" >> custom.txt
echo "prod" >> custom.txt
echo "staging" >> custom.txt
echo "admin" >> custom.txt
echo "portal" >> custom.txt
echo "dashboard" >> custom.txt
echo "app" >> custom.txt
echo "mobile" >> custom.txt
echo "cdn" >> custom.txt
echo "static" >> custom.txt
echo "images" >> custom.txt
Subdomain Enumeration Pipeline (Full Automation):
bash
#!/bin/bash
# Full subdomain enumeration pipeline
DOMAIN=$1
OUTPUT_DIR="subdomain_enum_$DOMAIN"
mkdir -p $OUTPUT_DIR
echo "[1] Passive Subdomain Enumeration"
# Subfinder
subfinder -d $DOMAIN -silent -o $OUTPUT_DIR/subfinder.txt
# Assetfinder
assetfinder --subs-only $DOMAIN > $OUTPUT_DIR/assetfinder.txt
# Amass (passive)
amass enum -passive -d $DOMAIN -o $OUTPUT_DIR/amass_passive.txt
# CRT.sh
curl -s "https://crt.sh/?q=%.$DOMAIN&output=json" | jq -r '.[].name_value' | sort -u > $OUTPUT_DIR/crt.txt
# Chaos (if API key)
chaos -d $DOMAIN -silent -key YOUR_API_KEY > $OUTPUT_DIR/chaos.txt
echo "[2] Combine and Sort"
cat $OUTPUT_DIR/*.txt | sort -u > $OUTPUT_DIR/all_subdomains.txt
echo "[3] Resolve Subdomains"
dnsx -l $OUTPUT_DIR/all_subdomains.txt -a -silent -o $OUTPUT_DIR/resolved.txt
echo "[4] Filter Wildcard"
# Wildcard detection
WILDCARD=$(dnsx -d $DOMAIN -wd -silent)
grep -v "$WILDCARD" $OUTPUT_DIR/resolved.txt > $OUTPUT_DIR/filtered.txt
echo "[5] Live Host Detection"
httpx -l $OUTPUT_DIR/filtered.txt -silent -o $OUTPUT_DIR/live_hosts.txt -title -tech-detect -status-code
echo "[6] Screenshot"
gowitness file -f $OUTPUT_DIR/live_hosts.txt -P screenshots/
echo "[7] Result"
echo "Total Subdomains: $(cat $OUTPUT_DIR/all_subdomains.txt | wc -l)"
echo "Resolved: $(cat $OUTPUT_DIR/resolved.txt | wc -l)"
echo "Live Hosts: $(cat $OUTPUT_DIR/live_hosts.txt | wc -l)"
Subdomain Enumeration Kontrol Listesi:
A. Passive Enumeration:
Subfinder kullanıldı mı?
Assetfinder kullanıldı mı?
CRT.sh kontrol edildi mi?
SecurityTrails kontrol edildi mi?
AlienVault OTX kontrol edildi mi?
Shodan/Censys kontrol edildi mi?
B. Active Enumeration:
DNS brute force yapıldı mı?
Zone transfer denendi mi?
DNSSEC kontrolü yapıldı mı?
C. Doğrulama:
DNS rezolvasyonu yapıldı mı?
Wildcard subdomain filtrelemesi yapıldı mı?
Canlı host'lar tespit edildi mi?
Screenshot'lar alındı mı?
D. Teknoloji Tespiti:
Cloudflare tespiti yapıldı mı?
AWS/Azure/GCP tespiti yapıldı mı?
Web sunucu tespiti yapıldı mı?
Subdomain Enumeration Best Practices:
Birden fazla araç kullanın (tek araç tüm subdomain'leri bulamaz)
Passive + Active kombinasyonu yapın
Wildcard subdomain'leri filtreleyin
Rate limiting'e dikkat edin
Resolvers listesini güncel tutun
Wordlist'leri güncel tutun
Sonuçları doğrulayın (canlı host'lar)
Subdomain Enumeration, bir hedef domain'e ait alt domain'leri (subdomain) tespit etme sürecidir. Bug bounty ve pentest'lerin en kritik aşamalarından biridir. Çünkü ana domain güvenli olsa bile, unutulmuş, zayıf yapılandırılmış veya test amaçlı subdomain'ler zafiyet içerebilir.
Subdomain Enumeration Yöntemleri:
1. DNS Brute Force
DNS sorguları ile olası subdomain'leri dene
Wordlist bazlı çalışır
2. DNS Zone Transfer (Eski)
Zone transfer (AXFR) ile tüm DNS kayıtlarını alma
Modern sistemlerde genellikle devre dışı
3. Search Engine OSINT
Google, Bing, DuckDuckGo ile subdomain arama
site:*.hedef.com sorgusu
4. Certificate Transparency Logs
SSL/TLS sertifikalarından subdomain'leri çekme
crt.sh, CertSpotter
5. DNS Records (MX, NS, TXT)
MX, NS, TXT kayıtlarından subdomain'leri bulma
Google Workspace, Office365, Cloudflare vb.
6. Bruteforce via Public Resolvers
Public DNS resolver'lar (8.8.8.8, 1.1.1.1) ile brute force
Subdomain Enumeration Araçları:
1. Subfinder (En Hızlı ve Güvenilir)
Açıklama: Passive subdomain enumeration aracı. API tabanlı çalışır, hedefe doğrudan istek atmaz.
Kurulum:
bash
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
Kullanım:
bash
# Temel kullanım
subfinder -d hedef.com
# Sessiz mod (sadece subdomain'leri göster)
subfinder -d hedef.com -silent
# Çıktıyı dosyaya yaz
subfinder -d hedef.com -o subdomains.txt
# Birden fazla domain
subfinder -dL domains.txt -o all_subdomains.txt
# Tüm kaynakları kullan (hızlı değil)
subfinder -d hedef.com -all
Kaynaklar:
AlienVault OTX
SecurityTrails
Censys
Shodan
VirusTotal
PassiveDNS
ThreatCrowd
CertSpotter
DNSDB
BinaryEdge
2. Amass (OWASP - En Kapsamlı)
Açıklama: OWASP projesi, en kapsamlı subdomain enumeration aracı. Passive + Active + Brute Force.
Kurulum:
bash
go install -v github.com/OWASP/Amass/v3/...@master
Kullanım:
bash
# Passive mod (sadece OSINT)
amass enum -passive -d hedef.com -o subdomains.txt
# Active mod (DNS brute force + passive)
amass enum -d hedef.com -o subdomains.txt
# Tüm alt domain'leri ara
amass enum -d hedef.com -o subdomains.txt -active -brute
# Çıktı formatları
amass enum -d hedef.com -json output.json
amass enum -d hedef.com -csv output.csv
# DNS rezolvasyonu ile birlikte
amass enum -d hedef.com -o subdomains.txt -ip -whois
# Subdomain takeover kontrolü
amass enum -d hedef.com -config config.ini
Amass Config (config.ini):
ini
[resolvers]
resolvers = [
"1.1.1.1",
"8.8.8.8",
"9.9.9.9"
]
[bruteforce]
wordlist = /path/to/wordlist.txt
recursive = true
3. Assetfinder (Hızlı ve Basit)
Açıklama: Tom Hudson tarafından geliştirilmiş, hızlı ve basit passive subdomain aracı.
Kurulum:
bash
go install github.com/tomnomnom/assetfinder@latest
Kullanım:
bash
# Temel kullanım
assetfinder hedef.com
# Sadece subdomain'ler
assetfinder --subs-only hedef.com
# Çıktıyı dosyaya yaz
assetfinder --subs-only hedef.com > subdomains.txt
4. DNSx (ProjectDiscovery)
Açıklama: DNS sorgulama aracı, subdomain listesini doğrulamak ve DNS kayıtlarını almak için.
Kurulum:
bash
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
Kullanım:
bash
# DNS sorgusu
dnsx -d hedef.com -a -cname -txt -mx -ns
# Subdomain listesini doğrula
dnsx -l subdomains.txt -a -o resolved.txt
# Wildcard tespiti
dnsx -d hedef.com -wd
# JSON çıktı
dnsx -d hedef.com -a -cname -txt -json
5. Shuffledns (MassDNS + Subfinder)
Açıklama: Subfinder + MassDNS kombinasyonu, hızlı brute force için.
Kurulum:
bash
go install -v github.com/projectdiscovery/shuffledns/cmd/shuffledns@latest
Kullanım:
bash
# Subfinder + Shuffledns
subfinder -d hedef.com -silent | shuffledns -d hedef.com -r resolvers.txt -o subdomains.txt
# Brute force ile
shuffledns -d hedef.com -w wordlist.txt -r resolvers.txt
# Rate limiting
shuffledns -d hedef.com -w wordlist.txt -r resolvers.txt -t 100
6. Chaos (ProjectDiscovery API)
Açıklama: ProjectDiscovery'nin topladığı subdomain veritabanı.
Kurulum:
bash
go install -v github.com/projectdiscovery/chaos-client/cmd/chaos@latest
Kullanım:
bash
# API key ile
chaos -d hedef.com -key YOUR_API_KEY
# Sessiz mod
chaos -d hedef.com -key YOUR_API_KEY -silent
# Çıktı
chaos -d hedef.com -key YOUR_API_KEY -o subdomains.txt
7. Findomain (Rust ile Yazılmış)
Açıklama: Hızlı, cross-platform subdomain aracı.
Kurulum:
bash
# Linux/macOS
wget https://github.com/Edu4rdSHL/findomain/releases/latest/download/findomain-linux
chmod +x findomain-linux
sudo mv findomain-linux /usr/local/bin/findomain
# Windows
# findomain-windows.exe indir
Kullanım:
bash
# Temel
findomain -t hedef.com
# Çıktı
findomain -t hedef.com -o
# Birden fazla
findomain -f domains.txt -o
8. CRT.sh (Certificate Transparency)
Açıklama: Certificate Transparency log'larından subdomain'leri çeker.
Kullanım (API):
bash
curl -s "https://crt.sh/?q=%.hedef.com&output=json" | jq -r '.[].name_value' | sort -u
Python Script:
python
import requests
import json
def get_subdomains_crt(domain):
url = f"https://crt.sh/?q=%.{domain}&output=json"
response = requests.get(url)
if response.status_code == 200:
data = response.json()
subdomains = set()
for entry in data:
name = entry.get('name_value', '')
if name:
subdomains.add(name.lower())
return subdomains
return set()
9. SecurityTrails API
Açıklama: SecurityTrails DNS veritabanı API.
Kullanım:
bash
curl -s "https://api.securitytrails.com/v1/domain/hedef.com/subdomains" \
-H "APIKEY: YOUR_API_KEY" \
| jq -r '.subdomains[]' | while read sub; do echo "$sub.hedef.com"; done
10. AlienVault OTX
Açıklama: AlienVault OTX API ile subdomain'leri çeker.
Kullanım:
bash
curl -s "https://otx.alienvault.com/api/v1/indicators/domain/hedef.com/url_list?limit=100" \
| jq -r '.url_list[].url' | unfurl domains | sort -u
Subdomain Enumeration Wordlist'ler:
Popüler Wordlist'ler:
bash
# SecLists
/usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-20000.txt
/usr/share/wordlists/SecLists/Discovery/DNS/subdomains-top1million-5000.txt
# Assetnote
# Commonspeak
GitHub - assetnote/commonspeak2-wordlists: Wordlists that have been compiled using Commonspeak2. This repo is updated every time new wordlists are generated.
Wordlists that have been compiled using Commonspeak2. This repo is updated every time new wordlists are generated. - assetnote/commonspeak2-wordlists
# JW
Kendi Wordlist'inizi oluşturma:
bash
# Common subdomain'ler
cat common.txt > custom.txt
# Teknoloji bazlı
echo "api" >> custom.txt
echo "dev" >> custom.txt
echo "test" >> custom.txt
echo "stage" >> custom.txt
echo "prod" >> custom.txt
echo "staging" >> custom.txt
echo "admin" >> custom.txt
echo "portal" >> custom.txt
echo "dashboard" >> custom.txt
echo "app" >> custom.txt
echo "mobile" >> custom.txt
echo "cdn" >> custom.txt
echo "static" >> custom.txt
echo "images" >> custom.txt
Subdomain Enumeration Pipeline (Full Automation):
bash
#!/bin/bash
# Full subdomain enumeration pipeline
DOMAIN=$1
OUTPUT_DIR="subdomain_enum_$DOMAIN"
mkdir -p $OUTPUT_DIR
echo "[1] Passive Subdomain Enumeration"
# Subfinder
subfinder -d $DOMAIN -silent -o $OUTPUT_DIR/subfinder.txt
# Assetfinder
assetfinder --subs-only $DOMAIN > $OUTPUT_DIR/assetfinder.txt
# Amass (passive)
amass enum -passive -d $DOMAIN -o $OUTPUT_DIR/amass_passive.txt
# CRT.sh
curl -s "https://crt.sh/?q=%.$DOMAIN&output=json" | jq -r '.[].name_value' | sort -u > $OUTPUT_DIR/crt.txt
# Chaos (if API key)
chaos -d $DOMAIN -silent -key YOUR_API_KEY > $OUTPUT_DIR/chaos.txt
echo "[2] Combine and Sort"
cat $OUTPUT_DIR/*.txt | sort -u > $OUTPUT_DIR/all_subdomains.txt
echo "[3] Resolve Subdomains"
dnsx -l $OUTPUT_DIR/all_subdomains.txt -a -silent -o $OUTPUT_DIR/resolved.txt
echo "[4] Filter Wildcard"
# Wildcard detection
WILDCARD=$(dnsx -d $DOMAIN -wd -silent)
grep -v "$WILDCARD" $OUTPUT_DIR/resolved.txt > $OUTPUT_DIR/filtered.txt
echo "[5] Live Host Detection"
httpx -l $OUTPUT_DIR/filtered.txt -silent -o $OUTPUT_DIR/live_hosts.txt -title -tech-detect -status-code
echo "[6] Screenshot"
gowitness file -f $OUTPUT_DIR/live_hosts.txt -P screenshots/
echo "[7] Result"
echo "Total Subdomains: $(cat $OUTPUT_DIR/all_subdomains.txt | wc -l)"
echo "Resolved: $(cat $OUTPUT_DIR/resolved.txt | wc -l)"
echo "Live Hosts: $(cat $OUTPUT_DIR/live_hosts.txt | wc -l)"
Subdomain Enumeration Kontrol Listesi:
A. Passive Enumeration:
Subfinder kullanıldı mı?
Assetfinder kullanıldı mı?
CRT.sh kontrol edildi mi?
SecurityTrails kontrol edildi mi?
AlienVault OTX kontrol edildi mi?
Shodan/Censys kontrol edildi mi?
B. Active Enumeration:
DNS brute force yapıldı mı?
Zone transfer denendi mi?
DNSSEC kontrolü yapıldı mı?
C. Doğrulama:
DNS rezolvasyonu yapıldı mı?
Wildcard subdomain filtrelemesi yapıldı mı?
Canlı host'lar tespit edildi mi?
Screenshot'lar alındı mı?
D. Teknoloji Tespiti:
Cloudflare tespiti yapıldı mı?
AWS/Azure/GCP tespiti yapıldı mı?
Web sunucu tespiti yapıldı mı?
Subdomain Enumeration Best Practices:
Birden fazla araç kullanın (tek araç tüm subdomain'leri bulamaz)
Passive + Active kombinasyonu yapın
Wildcard subdomain'leri filtreleyin
Rate limiting'e dikkat edin
Resolvers listesini güncel tutun
Wordlist'leri güncel tutun
Sonuçları doğrulayın (canlı host'lar)
🔒 Bu içeriği görmek için giriş yapın