# API Fuzzing
version
- `-mc` 유효한 응답만 필터링
```bash
ffuf -u http://target.com/api/v1/FUZZ \
-w /usr/share/seclists/Discovery/Web-Content/common.txt \
-mc 200, 403
```
basic endpoint
```bash
ffuf -u http://target.com/FUZZ \
-w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \
-mc 200,301,302
```
method
```bash
ffuf -u http://target.com/api/resource -X FUZZ \
-w /usr/share/seclists/Fuzzing/http-methods.txt \
-mc all
```
parameter
```bash
ffuf -u "http://target.com/api/search?FUZZ=value" \
-w /usr/share/seclists/Discovery/Web-Content/api/params.txt \
--hc 404
```
SSRF port scanning
```bash
# -ssrf.request 파일 준비
ffuf -u http://target.com/upload-cover -request ssrf.request -w <(seq 0 65535) -ac
```
# Directory / File Busting
```bash
ffuf -u http://target/FUZZ -w <wordlist_path>
ffuf -u http://10.10.10.10/FUZZ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
```
# Subdomain Enumeration
```bash
ffuf -u http://FUZZ.target.com -w <wordlist_path> -H "Host: FUZZ.target.com"
ffuf -u http://FUZZ.example.com -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H "Host: FUZZ.example.com" -fs 1234
```
# Vhost Enumeration
```bash
ffuf -u http://target.com -w <wordlist_path> -H "Host: FUZZ.target.com"
ffuf -u http://example.com -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt -H "Host: FUZZ.example.com" -fs 1234
```
# Options
| 옵션 | 설명 | 예시 |
| ------------ | ----------------------- | ----------------------------------- |
| `-u` | Fuzzing할 URL 지정 | `-u http://target/FUZZ` |
| `-w` | 사용할 워드리스트 경로 | `-w wordlist.txt` |
| `-t` | 동시 요청 수 (스레드 수) | `-t 100` |
| `-fc` | 제외할 HTTP 상태 코드 (Filter) | `-fc 404` |
| `-fs` | 제외할 응답 사이즈 (byte) | `-fs 1234` |
| `-fw` | 제외할 응답 단어 수 | `-fw 20` |
| `-mc` | 보고 싶은 상태 코드만 표시 (Match) | `-mc 200` |
| `-o` | 결과 저장 (파일) | `-o result.txt` |
| `-of` | 결과 파일 포맷 지정 | `-of json` |
| `-e` | 파일 확장자 추가 | `-e .php,.txt,.bak` |
| `-recursion` | 디렉토리 하위 탐색 | `-recursion -recursion-depth 2` |
| `-c` | 컬러 출력 | `-c` |
| `-H` | 요청 헤더 추가 | `-H "Host: FUZZ.example.com"` |
| `-X` | HTTP Method 지정 (POST 등) | `-X POST` |
| `-d` | POST 데이터에 FUZZ 사용 | `-d "username=admin&password=FUZZ"` |