Ana içeriğe geç

Web Content Enumeration

0. Hedefi ve Wordlist'leri hazırla

# Aktif lab ve targets.sh; eski lab değişkenini körlemesine kullanma
LAB="$(oscp-current --lab)"
source "$HOME/OSCP/labs/$LAB/targets.sh"

T="$M1"                         # GERÇEK hedef IP; gerekirse M2/M3...
PORT=80                         # Nmap'te açık bulunan GERÇEK web portu

URL="http://$T:$PORT"          # Port 80; 8000 ise URL="http://$T:8000"
KALI_IP="$(ip -4 -o addr show tun0 | awk '{print $4}' | cut -d/ -f1)"
SCAN_DIR="$HOME/OSCP/labs/$LAB/scans/hosts"
WEB_DIR="$SCAN_DIR/${T}-web-${PORT}"
mkdir -p "$WEB_DIR"

QUICK_WL="$HOME/OSCP/tools/wordlists/cx_dicc.txt"
DIR_WL="$HOME/OSCP/tools/wordlists/raft-medium-directories.txt"
FILE_WL="$HOME/OSCP/tools/wordlists/raft-medium-files.txt"
SEC="/usr/share/seclists/Discovery/Web-Content"

printf 'LAB=%s | T=%s | PORT=%s | URL=%s | WEB_DIR=%s\n' \
  "$LAB" "$T" "$PORT" "$URL" "$WEB_DIR"
ip route get "$T"
ls -lh "$QUICK_WL" "$DIR_WL" "$FILE_WL"

Her komutu hedefin kendi scans/ klasöründe çalıştır; -o raporları karışmasın. targets.sh sonradan değiştiyse açık shell'de yeniden source et.

1. Hızlı karar: hangi araç, hangi wordlist?

İhtiyaç Başlangıç tercihi Sonraki adım
İlk 1–2 dakikalık web keşfi (cx_dicc.txt) Sonuç yetersizse FFUF + RAFT
Dizin/dosya taraması ve esnek filtre ffuf Uzantılar, özel yol veya vhost
Yeni bulunan dizinlerde otomatik derinleşme feroxbuster -d ile derinliği sınırla
Vhost / parametre fuzzing ffuf Yanıt boyutu/kelime sayısıyla ayıkla
Sonuç çok fazla, aynı 200 sayfası dönüyor Önce rastgele yol + curl Sonra -ac, doğrulanmış -fs veya Ferox filtreleri

2. Dirsearch — ilk tarama

Varsayılan liste + yaygın uzantılar

dirsearch -u "$URL" \
  -e php,asp,aspx,jsp,html,htm,txt,bak,zip \
  -t 25 \
  --output-formats plain --output-file dirsearch-m3.txt

Sadece CGI dizini ve rekürsiyon

dirsearch -u "$URL/cgi-bin/" -e php,asp,aspx,txt -t 20

dirsearch -u "$URL" \
  -e php,html,txt \
  -r --max-recursion-depth 2 \
  -t 20 --output-formats plain --output-file dirsearch-m3-recursive.txt

Özel wordlist ve JSON raporu

dirsearch -u "$URL" -w "$SEC/raft-medium-directories.txt" \
  -f -e php,html,txt -t 20 \
  --output-formats json --output-file dirsearch-m3.json

Dirsearch varsayılan db/dicc.txt listesini kullanır; %EXT% şablonlarını ve kendi wordlist/uzantı dönüşümlerini uygular. Başka bir araca aynı büyük listeyi vermek, birebir aynı istekleri üreteceği anlamına gelmez.

3. FFUF — dizin ve dosya keşfi

# 1) Hızlı içerik / PHP-ASPX-JSP ve temel dosyalar
ffuf -u "$URL/FUZZ" -w "$QUICK_WL" \
  -D -e .php,.asp,.aspx,.jsp,.html,.txt -ic -ac -t 20 -c \
  -of json -o "$WEB_DIR/ffuf-quick.json"

# 2) Dizin listesi (quick ile bulunamadıysa)
ffuf -u "$URL/FUZZ" -w "$DIR_WL" \
  -ic -ac -t 25 -c -of json -o "$WEB_DIR/ffuf-dirs.json"

# 3) Dosya ve backup uzantıları
ffuf -u "$URL/FUZZ" -w "$FILE_WL" \
  -e .php,.asp,.aspx,.jsp,.txt,.bak,.old,.zip \
  -ic -ac -t 20 -c -of json -o "$WEB_DIR/ffuf-files.json"

Belirli dizinin içini ara

ffuf -u "$URL/cgi-bin/FUZZ" \
  -w "$DS" -D -e .php,.html,.txt \
  -ic -t 20 -c \
  -of json -o "$WEB_DIR/ffuf-cgi.json"

Rekürsif FFUF

ffuf -u "$URL/FUZZ" -w "$DIR_WL" \
  -ic -ac -recursion -recursion-depth 2 -t 20 -c \
  -of json -o "$WEB_DIR/ffuf-recursive.json"

4. FFUF — vhost ve parametre

Virtual host — domain ipucunu değiştir

DOMAIN="oscp.exam"     # Gerçekte keşfettiğin domain
DNS_WL="/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt"

ffuf -u "$URL/" -H "Host: FUZZ.$DOMAIN" \
  -w "$DNS_WL" -ac -t 20 -c \
  -of json -o "$WEB_DIR/ffuf-vhosts.json"

GET parametre isimlerini keşfet

# Önce /index.php yolunun gerçekten var olduğunu doğrula.
ffuf -u "$URL/index.php?FUZZ=test" \
  -w "$SEC/burp-parameter-names.txt" \
  -ac -ic -t 20 -c \
  -of json -o "$WEB_DIR/ffuf-params.json"

5. Feroxbuster — rekürsif web keşfi

Kontrollü dizin taraması (derinlik en fazla 2)

feroxbuster -u "$URL/" \
  -w "$SEC/raft-medium-directories.txt" \
  -t 20 -d 2 \
  -o "$WEB_DIR/ferox-dirs.txt"

Dosya ve uzantı taraması (rekürsiyonsuz)

feroxbuster -u "$URL/" \
  -w "$SEC/raft-medium-files.txt" \
  -x php,asp,aspx,html,txt,bak,zip \
  -n -t 20 -o "$WEB_DIR/ferox-files.txt"

Belirli dizini, rekürsiyon olmadan tara

feroxbuster -u "$URL/cgi-bin/" \
  -w "$SEC/raft-medium-files.txt" \
  -n -t 20 -o "$WEB_DIR/ferox-cgi.txt"

JSON çıktısı

feroxbuster -u "$URL/" \
  -w "$SEC/raft-medium-directories.txt" \
  -t 20 -d 2 --json -o "$WEB_DIR/ferox.json"

Feroxbuster'ın --json çıktısı FFUF'un -of json dosyasıyla aynı şema değildir. Auto-filter önemli yanıtları gizliyorsa tanılama amaçlı --dont-filter denenebilir; çok sayıda yanıltıcı sonuç üretebilir.

6. False positive ve eksik sonuç: hızlı tanılama

Doğru URL, port ve FUZZ?

echo "$URL"
curl -s -o /dev/null -w "%{http_code} %{size_download} %{url_effective}\n" "$URL/OLMAYAN_CX_DIZIN_12345"
curl -s -o /dev/null -w "%{http_code} %{size_download} %{url_effective}\n" "$URL/cgi-bin/test-cgi"

Aynı olmayan sayfa sürekli 200 46262 gibi cevap veriyorsa önce kontrol et; doğruladıktan sonra yalnız o hedefte -fs 46262 filtresi kullan. Sabit boyutu her labda ezbere kullanma.

ffuf -u "$URL/FUZZ" -w "$DS" \
  -D -e .php,.html -ic \
  -fs 46262 -c -of json -o "$WEB_DIR/ffuf-filtered.json"

Wordlist içinde aranan kelime var mı?

grep -niE '^cgi-bin/?$|^cgi-bin/test-cgi$' "$DS"
grep -niE '^cgi-bin/?$|^cgi-bin/test-cgi$' "$SEC/raft-medium-directories.txt"

FFUF çalışıyor mu? Üç adaylı kontrollü test

printf 'cgi-bin\ncgi-bin/\ncgi-bin/test-cgi\n' > /tmp/cgi-check.txt
ffuf -u "$URL/FUZZ" -w /tmp/cgi-check.txt -mc all -c

Bu testin sonucu başarılı ama büyük taramanın sonucu eksikse sırayla wordlist içeriği → tarama ilerlemesi → otomatik filtreler → soft-404 incele.

{% hint style="warning" %} OSCP notu: 200 her zaman gerçek dosya demek değildir. Durum kodu, yanıt boyutu, başlıklar, yönlendirme ve içerik birlikte değerlendirilmeli. Büyük wordlist ve yüksek thread sayısı süreyi uzatabilir veya hedefi zorlayabilir. Her port için ayrı URL ve çıktı dosyası kullan. {% endhint %}

7. Resmî dokümantasyon

İlgili: Web Initial Methodology · Lab İşlemleri.


V2 ana kaynak: Web Master.