1. 정의
| 개념 | 정의 | 예시 |
|---|---|---|
| Subdomain | 메인 도메인 앞에 붙는 하위 도메인 | admin.example.com, dev.example.com |
| Directory | 웹 서버의 경로(URL Path) | example.com/admin, example.com/backup |
| vHost | 같은 IP에서 다른 도메인명으로 서비스하는 가상 호스트 | IP 10.10.10.10 → admin.htb, dev.htb |
2. 언제 찾아야 하는가
Subdomain 찾을 때
- DNS가 살아있고 퍼블릭 도메인일 때
*.example.com형태로 외부에 노출된 서비스 찾을 때
Directory 찾을 때
- 웹 서버 접근 가능할 때 항상
- 로그인 페이지, 관리자 패널, 백업 파일 찾을 때
- 첫 번째로 항상 해야 하는 기본 enumeration
vHost 찾을 때
- HTB처럼
/etc/hosts에 등록해서 쓰는 환경 - 같은 IP에서 여러 서비스가 돌아갈 것 같을 때
- Subdomain 찾았는데 DNS로는 안 열릴 때
3. 도구 및 명령어 예시
Directory
ffuf
bash
ffuf -u http://example.htb/FUZZ \
-w /usr/share/wordlists/dirb/common.txt \
-mc 200,301,302,403 \
-t 50gobuster
bash
gobuster dir \
-u http://example.htb \
-w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt \
-x php,html,txt,bak \
-t 50Subdomain
ffuf
bash
ffuf -u http://example.htb \
-H "Host: FUZZ.example.htb" \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
-mc 200,301,302 \
-fs 0gobuster
bash
gobuster dns \
-d example.htb \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
-t 50vHost
ffuf
bash
ffuf -u http://10.10.10.10 \
-H "Host: FUZZ.example.htb" \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
-mc 200,301,302 \
-fs [기본응답크기] # 먼저 기본 응답 크기 확인 후 필터gobuster
bash
gobuster vhost \
-u http://10.10.10.10 \
-w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
--append-domain \
-t 50vHost는 반드시 찾은 후
/etc/hosts에 등록해야 접근 가능합니다:bash
echo "10.10.10.10 admin.example.htb" >> /etc/hosts
4. 추천 Wordlist
| 용도 | 파일 경로 |
|---|---|
| Directory 빠른 스캔 | /usr/share/wordlists/dirb/common.txt |
| Directory 정밀 스캔 | /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt |
| Subdomain / vHost | /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt |
| Subdomain 정밀 | /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt |
| 파일 확장자 포함 | /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt |