ASN Recon (Detaylı Anlatım ve Uygulama Teknikleri)

ASN Recon (Autonomous System Number Reconnaissance) , bir hedef organizasyonun sahip olduğu IP bloklarını, ağ altyapısını ve bağlı olduğu internet servis sağlayıcılarını (ISP) tespit etme sürecidir. Bug bounty ve pentest'lerde, hedefin saldırı yüzeyini genişletmek, cloud altyapısını keşfetmek ve unutulmuş veya zayıf korunan sunucuları bulmak için kullanılır.

ASN Nedir?
ASN (Autonomous System Number) , bir kuruluşun veya ISP'nin internet üzerindeki ağını tanımlayan benzersiz bir numaradır. Her ASN, belirli bir IP bloğuna sahiptir ve bu IP blokları BGP (Border Gateway Protocol) ile internet üzerinde duyurulur.

Örnek:

Google: AS15169

Cloudflare: AS13335

Amazon AWS: AS16509

Microsoft Azure: AS8075

ASN Recon Neden Önemlidir?
IP Bloklarını Bulma: Hedefin sahip olduğu tüm IP aralıklarını tespit etme

Cloud Altyapısı Keşfi: AWS, Azure, GCP gibi cloud servislerinde barındırılan kaynaklar

Unutulmuş Sunucular: Zayıf korunan veya güncellenmemiş sunucular

Ağ Yapısı Anlama: Hedefin ağ altyapısını haritalama

Saldırı Yüzeyini Genişletme: Ana domain dışındaki IP bloklarını keşfetme

Co-location/Data Center Tespiti: Fiziksel barındırma lokasyonları

ASN Recon Yöntemleri ve Araçları:
1. ASN Tespiti
a. WHOIS Sorgusu:

bash
whois -h whois.arin.net AS15169
whois AS15169
b. BGP Tools:

bash
# bgp.tools
curl -s https://bgp.tools/asn/15169 | grep -oP '(?<=<pre>)[^<]+'
c. Python (ipwhois):

python
from ipwhois import IPWhois

obj = IPWhois('8.8.8.8')
result = obj.lookup()
print(result['asn']) # AS15169
print(result['asn_description']) # GOOGLE
2. ASN'den IP Bloklarını Bulma
Araçlar: asn, amass, masscan, nmap

bash
# asn (go)
go install github.com/nitefood/asn@latest
asn -a AS15169

# Amass (ASN ile)
amass intel -asn 15169 -o ip_list.txt

# Masscan ile IP listesine dönüştürme
asn -a AS15169 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' > cidr.txt
3. IP Bloklarını Tarama
Araçlar: masscan, nmap, httpx, nuclei

bash
# Masscan ile port tarama (hızlı)
masscan -p1-65535 --rate=10000 -iL cidr.txt -oJ masscan_output.json

# Nmap ile servis tespiti
nmap -sV -p 80,443,8080 -iL cidr.txt -oN nmap_output.txt

# httpx ile web servislerini tespit et
cat cidr.txt | httpx -silent -o live_hosts.txt

# Nuclei ile vulnerability tarama
nuclei -l live_hosts.txt -t cves/ -t exposures/
4. ASN'den Subdomain Bulma
Araçlar: amass, subfinder, shuffledns

bash
# Amass ile ASN'den subdomain bulma
amass enum -asn 15169 -o subdomains.txt

# Shuffledns ile DNS brute force
shuffledns -d hedef.com -w wordlist.txt -o subdomains.txt
ASN Recon Araçları (Detaylı):
1. ASN (Nitefood)
Açıklama: ASN'den IP bloğu bulma aracı.

Kurulum:

bash
go install github.com/nitefood/asn@latest
Kullanım:

bash
# ASN'den IP bloklarını bul
asn -a AS15169

# IP bloklarını CIDR formatında
asn -a AS15169 | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+'

# Çıktıyı dosyaya yaz
asn -a AS15169 -o ip_cidr.txt
2. Amass
Açıklama: OWASP Amass, ASN intel toplama ve subdomain enumeration.

Kurulum:

bash
go install -v github.com/OWASP/Amass/v3/...@master
Kullanım:

bash
# ASN'den IP bloklarını bul
amass intel -asn 15169 -o cidr.txt

# ASN'den subdomain bul
amass enum -asn 15169 -o subdomains.txt

# ASN ve domain kombine
amass intel -org "Google" -o google_ip.txt
3. Shodan ASN Query
Açıklama: Shodan API ile ASN'deki tüm cihazları bulma.

bash
# Shodan CLI
shodan search "asn:AS15169"

# API ile
curl -s "https://api.shodan.io/shodan/host/search?key=YOUR_API_KEY&query=asn:AS15169" | jq '.matches[].ip_str'
4. Censys ASN Query
Açıklama: Censys API ile ASN'deki tüm cihazları bulma.

bash
# Censys API
curl -s "https://search.censys.io/api/v2/hosts/search?q=autonomous_system.asn:15169&per_page=100" \
-H "Accept: application/json" \
-u "YOUR_API_ID:YOUR_API_SECRET"
5. BGPRanking / BGPView
Açıklama: BGP veritabanından ASN bilgileri.

bash
# BGPView API
curl -s "https://api.bgpview.io/asn/15169"

# BGP Ranking
curl -s "https://bgpranking.circl.lu/asn/15169"
6. IPinfo
Açıklama: IP'den ASN ve organizasyon bilgisi.

bash
# IPinfo CLI
ipinfo 8.8.8.8

# API ile
curl -s "https://ipinfo.io/8.8.8.8/json" | jq '.asn, .org'
ASN Recon Pipeline (Full Automation):
bash
#!/bin/bash
# Full ASN Recon Pipeline

DOMAIN=$1
OUTPUT_DIR="asn_recon_$DOMAIN"
mkdir -p $OUTPUT_DIR

echo "[1] Find ASN for $DOMAIN"

# IP'den ASN bul
IP=$(dig +short $DOMAIN | head -1)
ASN=$(whois -h whois.arin.net $IP | grep -i 'originas' | awk '{print $2}' | sed 's/AS//')

if [ -z "$ASN" ]; then
echo "ASN not found for $DOMAIN"
exit 1
fi

echo "ASN: $ASN"

echo "[2] Get IP Blocks for ASN $ASN"
asn -a AS$ASN | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+' > $OUTPUT_DIR/cidr.txt
echo "IP Blocks: $(cat $OUTPUT_DIR/cidr.txt | wc -l)"

echo "[3] Expand CIDR to IP List"
while read cidr; do
nmap -sL -n $cidr | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' >> $OUTPUT_DIR/ip_list.txt
done < $OUTPUT_DIR/cidr.txt

echo "[4] Check Live Hosts"
httpx -l $OUTPUT_DIR/ip_list.txt -silent -o $OUTPUT_DIR/live_hosts.txt -title -status-code -tech-detect

echo "[5] Port Scanning"
masscan -p80,443,8080,8443,3000,5000,8000,9000 --rate=5000 -iL $OUTPUT_DIR/cidr.txt -oG $OUTPUT_DIR/masscan_output.txt

echo "[6] Vulnerability Scanning"
nuclei -l $OUTPUT_DIR/live_hosts.txt -t cves/ -t exposures/ -t misconfiguration/ -severity critical,high -o $OUTPUT_DIR/nuclei_results.txt

echo "[7] Result"
echo "ASN: $ASN"
echo "IP Blocks: $(cat $OUTPUT_DIR/cidr.txt | wc -l)"
echo "Live Hosts: $(cat $OUTPUT_DIR/live_hosts.txt | wc -l)"
echo "Vulnerabilities Found: $(cat $OUTPUT_DIR/nuclei_results.txt | wc -l)"
ASN Recon ile Bulunabilecek Bilgiler:
Bilgi Türü Örnek
IP Blokları 8.8.8.0/24
Subdomain'ler mail.google.com
Web Servisleri Apache, Nginx
Cloud Servisleri AWS, Azure, GCP
IoT Cihazları Kamera, Router
Veritabanları MySQL, PostgreSQL, MongoDB
VPN/SSH OpenVPN, SSH
Zafiyetler CVE'ler, Misconfiguration
ASN Recon'da Dikkat Edilecek Noktalar:
1. Out-of-Scope Kontrolü
Tespit edilen IP bloklarının hedefin out-of-scope aralığında olup olmadığını kontrol edin.

bash
# Scope listesini kontrol et
comm -12 <(sort scope.txt) <(sort cidr.txt)
2. Rate Limiting
Tarama yaparken rate limiting'e dikkat edin. Çok hızlı tarama, IP ban'ına neden olabilir.

bash
# masscan ile rate kontrolü
masscan --rate=5000 -p80,443 cidr.txt
3. Cloud IP'leri
ASN'den çıkan IP'ler cloud servislerine ait olabilir (AWS, Azure, GCP).

bash
# AWS IP kontrolü
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[].ip_prefix' | grep -i $IP
ASN Recon Kontrol Listesi:
A. ASN Tespiti:
Domain'den ASN bulundu mu?

IP'den ASN bulundu mu?

ASN numarası doğrulandı mı?

B. IP Blokları:
ASN'den tüm IP blokları toplandı mı?

CIDR formatına dönüştürüldü mü?

IP listesine genişletildi mi?

C. Tarama:
Port taraması yapıldı mı?

Canlı host'lar tespit edildi mi?

Web servisleri tespit edildi mi?

Zafiyet taraması yapıldı mı?

D. Subdomain Keşfi:
IP'lerden reverse DNS yapıldı mı?

Subdomain enumeration yapıldı mı?

ASN Recon Best Practices:
Birden fazla ASN kaynağı kullanın (BGP, WHOIS, Shodan)

IP bloklarını doğrulayın (gerçekten hedefe mi ait?)

Rate limiting'e dikkat edin (tarama hızını ayarlayın)

Out-of-scope kontrolü yapın (yasalara uyun)

Sonuçları belgelendirin (IP'ler, portlar, servisler)

🔒 Bu içeriği görmek için giriş yapın

 
Yanıt yazmak için giriş yapmalısınız
Forum özelliklerini kullanmak ve Level 2 üyelik satın almak için hesabınıza giriş yapın.
133,661Konular
3,288,229Mesajlar
324,331Kullanıcılar
Üst Alt