Module 1: Foundations

Information Gathering & Reconnaissance

30 menit
Intermediate

Passive vs Active Reconnaissance

Passive recon: Mengumpulkan informasi tanpa berinteraksi langsung dengan target — menggunakan data yang sudah tersedia publik. Lebih aman dan tidak meninggalkan trace di log target.

Active recon: Berinteraksi langsung dengan target — port scanning, directory brute-force. Akan muncul di log server.

Untuk pentest formal, keduanya dilakukan. Untuk bug bounty, selalu mulai dengan passive.

Passive Reconnaissance

Google Dorking

Gunakan operator Google khusus untuk menemukan informasi sensitif yang terekspos:

# File konfigurasi yang terekspos
site:target.com filetype:env
site:target.com filetype:config
site:target.com filetype:xml inurl:config

# Halaman login admin
site:target.com inurl:admin
site:target.com inurl:login intitle:admin

# File backup
site:target.com filetype:bak
site:target.com filetype:sql
site:target.com filetype:log

# Informasi sensitif dalam cache
cache:target.com

# Subdomain discovery
site:*.target.com -site:www.target.com

Certificate Transparency Logs

# Temukan subdomain dari certificate transparency logs
curl "https://crt.sh/?q=%.target.com&output=json" | jq '.[].name_value' | sort -u

# Atau gunakan subfinder
subfinder -d target.com -o subdomains.txt

Shodan untuk Passive Recon

# Di Shodan search:
hostname:target.com
ssl.cert.subject.CN:target.com

# Temukan semua IP milik target
org:"Target Organization"

Active Reconnaissance

Subdomain Enumeration

# Menggunakan amass (paling comprehensive)
amass enum -d target.com -o subdomains_amass.txt

# Menggunakan subfinder (cepat)
subfinder -d target.com -silent -o subdomains_sf.txt

# DNS brute-force dengan ffuf
ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
     -u https://FUZZ.target.com \
     -mc 200,301,302 \
     -o subdomains_ffuf.txt

# Gabungkan dan deduplicate hasilnya
cat subdomains_*.txt | sort -u > all_subdomains.txt

Technology Fingerprinting

# Whatweb — deteksi CMS, framework, server
whatweb -v https://target.com

# Wappalyzer (browser extension atau CLI)
wappalyzer https://target.com

# Curl untuk melihat headers
curl -s -I https://target.com | grep -i "server\|x-powered-by\|set-cookie\|x-aspnet"

Directory & File Discovery

# Gobuster untuk directory brute-force
gobuster dir \
  -u https://target.com \
  -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt \
  -x php,html,txt,bak,zip \
  -t 50 \
  -o gobuster_results.txt

# FFUF — lebih fleksibel dan cepat
ffuf -u https://target.com/FUZZ \
     -w /usr/share/seclists/Discovery/Web-Content/raft-large-files.txt \
     -mc 200,201,204,301,302,307,401,403 \
     -fs 0 \
     -t 50 \
     -o ffuf_results.json \
     -of json

# Filter false positives berdasarkan ukuran response
ffuf -u https://target.com/FUZZ \
     -w wordlist.txt \
     -fs 1234  # filter response dengan size 1234 bytes

Nikto — Web Server Scanner

# Scan dasar
nikto -h https://target.com -o nikto_output.txt

# Scan dengan tuning untuk mengurangi false positives
nikto -h https://target.com -Tuning 4 -o nikto_results.txt
# Tuning 4 = injection tests saja

Hasil yang Ingin Dicapai

Setelah reconnaissance, kamu harus memiliki:

  • Daftar subdomain aktif target
  • Teknologi stack (CMS, framework, server, bahasa)
  • Endpoints penting (login, upload, API, admin panel)
  • File sensitif yang terekspos (config, backup, log)
  • Port dan service yang berjalan
Tips
Investasikan waktu lebih banyak di recon. Semakin banyak informasi yang kamu kumpulkan, semakin besar kemungkinan kamu menemukan kerentanan yang orang lain lewatkan.