Gobuster

The Gobuster cheat sheet covers directory/file brute-forcing, DNS subdomain enumeration, vhost discovery, and S3 bucket enumeration.

#Quick Reference

#Five Most-Used One-Liners

# 1. Dir scan with extensions, skip 404, output to file
gobuster dir -u http://target.com -w /usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt \
  -x php,html,txt,bak -b 404 -t 50 -o results.txt

# 2. DNS subdomain bruteforce, show IPs, custom resolver
gobuster dns -d target.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt \
  -i -r 8.8.8.8 -t 50

# 3. VHost enumeration with response-size filter (drop default page)
gobuster vhost -u http://10.10.10.10 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
  --append-domain -d target.htb --exclude-length 4242 -t 40

# 4. Fuzz GET parameter value through Burp proxy
gobuster fuzz -u "http://target.com/api?id=FUZZ" -w /usr/share/seclists/Fuzzing/1-4_all_letters_a-z.txt \
  -b 400,404 --proxy http://127.0.0.1:8080

# 5. Dir scan over HTTPS with client cert bypass + pattern file
gobuster dir -u https://target.com -w common.txt -k \
  -p patterns.txt -x php -t 30

#Modes Overview

Mode Target Primary Use Required Flags
dir HTTP/S URL Directory & file enumeration -u, -w
dns Domain name Subdomain discovery via DNS resolution -d, -w
vhost HTTP/S URL Virtual host / subdomain on same IP -u, -w
fuzz HTTP/S URL Generic fuzzing with FUZZ placeholder -u, -w
s3 AWS S3 Amazon S3 public bucket enumeration -w
gcs Google Cloud Google Cloud Storage bucket discovery -w
tftp TFTP server File enumeration over TFTP -s, -w

#Quick Command Reference

#Copy-Paste Commands

# Directory brute-force (most common)
gobuster dir -u http://TARGET -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -t 50

# With extensions
gobuster dir -u http://TARGET -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt -x php,txt,bak,conf,log -t 50

# DNS subdomain enumeration
gobuster dns -d TARGET.COM -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 50

# VHost discovery
gobuster vhost -u http://TARGET -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain -t 50

# S3 bucket enumeration
gobuster s3 -w /usr/share/seclists/Discovery/Web-Content/bucket-names.txt

# Fuzz mode (custom parameter fuzzing)
gobuster fuzz -u "http://TARGET/api?id=FUZZ" -w /usr/share/seclists/Fuzzing/fuzz-Bo0oM.txt -t 30

#Global Options

#Common Flags (All Modes)

Flag Long Form Default Description
-t --threads 10 Concurrent goroutines
-o --output - Write results to file
-q --quiet false Suppress banner
-z --no-progress false Hide progress bar
-v --verbose false Verbose output
--debug false Debug mode
--delay 0 Delay between requests (e.g. 500ms, 1s)
--no-error false Suppress error messages
--wordlist-offset 0 Skip first N wordlist entries

#HTTP / Proxy Flags

Flag Long Form Description
-k --no-tls-validation Skip TLS cert verification (self-signed)
--proxy Proxy URL (e.g. http://127.0.0.1:8080)
-a --useragent Custom User-Agent string
-H --headers Add HTTP header (repeatable)
-c --cookies Cookie string
-U --username Basic auth username
-P --password Basic auth password
--timeout HTTP timeout (default: 10s)
--retry Retry on timeout
--retry-attempts Number of retries
--client-cert-p12 Client TLS cert (PKCS12)
--client-cert-p12-password Password for PKCS12 cert

#Directory Mode (dir)

#dir Options

Flag Long Form Default Description
-u --url - Target URL (required)
-w --wordlist - Wordlist path or - for stdin
-x --extensions - Extensions: php,html,txt,bak
--extensions-file - Load extensions from file
-s --status-codes 200,204,301,302,307,401,403 Allowlisted HTTP codes
-b --status-codes-blacklist 404 Blocklisted HTTP codes
--exclude-length - Exclude by body length (bytes)
-l --show-length false Print response body length
-e --expanded false Show full URL in output
--no-status false Hide status codes
--hide-length false Hide length column
-r --follow-redirect false Follow HTTP redirects
--add-slash false Append / to each word
--discover-backup false Auto-add backup extensions (.bak, .bak2, .old, .1, ~, .swp)
-p --pattern - Pattern file (see below)
-m --method GET HTTP method to use
--force false Continue despite precheck errors

#Extension Fuzzing

# Web application extensions
gobuster dir -u http://target.com -w common.txt -x php,php3,php5,phtml

# Backup file discovery (manual)
gobuster dir -u http://target.com -w common.txt -x bak,old,orig,backup,copy,tmp

# Auto-discover backup variants with --discover-backup flag
gobuster dir -u http://target.com -w common.txt -x php --discover-backup

# Config / data files
gobuster dir -u http://target.com -w common.txt -x conf,config,cfg,ini,env,xml,yaml,yml,json

# Java / .NET stack
gobuster dir -u http://target.com -w common.txt -x jsp,jspx,do,action,aspx,asp,ashx

# Multiple purposes in one pass
gobuster dir -u http://target.com -w /usr/share/seclists/Discovery/Web-Content/raft-large-words.txt \
  -x php,html,js,txt,xml,json,bak,old,zip -t 50 -b 404,429

#Status Code Handling

# Default - show common positive codes
gobuster dir -u http://target.com -w common.txt
# Shows: 200,204,301,302,307,401,403

# Only 200 OK (strict)
gobuster dir -u http://target.com -w common.txt -s "200"

# Exclude 404 and rate-limit responses
gobuster dir -u http://target.com -w common.txt -b "404,429"

# Exclude by response body length (e.g. default error page is always 1337 bytes)
gobuster dir -u http://target.com -w common.txt --exclude-length 1337

# Exclude multiple lengths
gobuster dir -u http://target.com -w common.txt --exclude-length 1337,0,2048

# Show length to identify baseline noise
gobuster dir -u http://target.com -w common.txt -l

#Pattern Files

Pattern files let gobuster append strings to each discovered word. The placeholder {GOBUSTER} is replaced with each word from the wordlist, enabling compound path discovery.

# patterns.txt
{GOBUSTER}/admin
{GOBUSTER}/login
{GOBUSTER}/api/v1
{GOBUSTER}.php.bak
{GOBUSTER}~
_{GOBUSTER}
.{GOBUSTER}
# Use pattern file
gobuster dir -u http://target.com -w common.txt -p patterns.txt

# Practical: discover backup files alongside normal discovery
gobuster dir -u http://target.com -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -p patterns.txt -t 40

#Complete dir Examples

# Aggressive authenticated scan through Burp
gobuster dir -u http://target.com -w raft-large-directories.txt \
  -x php,html,txt -b 404 -t 50 -r \
  -H "Authorization: Bearer eyJ..." \
  -H "X-Forwarded-For: 127.0.0.1" \
  --proxy http://127.0.0.1:8080 \
  -o dir-results.txt

# HTTPS with self-signed cert
gobuster dir -u https://192.168.1.1 -w common.txt -k -x php,html

# Slow evasion mode (IDS bypass attempt)
gobuster dir -u http://target.com -w common.txt --delay 200ms -t 5

# Pivot through SOCKS proxy
gobuster dir -u http://internal.corp -w common.txt \
  --proxy socks5://127.0.0.1:1080

#DNS Mode (dns)

#dns Options

Flag Long Form Description
-d --domain Target domain (required)
-w --wordlist Subdomain wordlist
-i --show-ips Show resolved IP addresses
-r --resolver Custom DNS server (1.1.1.1 or 1.1.1.1:53)
--wildcard Force continue on wildcard DNS
--timeout DNS query timeout

#Subdomain Enumeration Examples

# Basic - quiet with IP resolution
gobuster dns -d target.com -w subdomains-top1million-5000.txt -i -q

# Large list, custom resolver, high threads
gobuster dns -d target.com \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt \
  -r 1.1.1.1:53 -t 100 -i -o dns-results.txt

# Force past wildcard DNS (target returns * for all)
gobuster dns -d target.com -w subdomains.txt --wildcard -i

# Internal domain via internal resolver
gobuster dns -d corp.internal -w subdomains.txt -r 192.168.1.53 -t 30

# With timeout for slow DNS
gobuster dns -d target.com -w subdomains.txt --timeout 5s

#Wildcard Detection

# Gobuster auto-detects wildcard DNS at startup
# If wildcard found without --wildcard flag, scan aborts
# Output when wildcard detected:
# [-] Wildcard DNS found. IP address(es): 1.2.3.4
# [!] To force processing of Wildcard DNS, specify the '--wildcard' switch.

# Force scan anyway - compare with known wildcard IPs in post-processing
gobuster dns -d target.com -w subdomains.txt --wildcard -i | \
  grep -v "1.2.3.4"

#VHost Mode (vhost)

#vhost Options

Flag Long Form Description
-u --url Target base URL (required)
-w --wordlist Vhost names wordlist
--append-domain Append base domain to each word
-d --domain Domain to append (with --append-domain)
-r --follow-redirect Follow redirects
-s --status-codes Allowlisted status codes
-b --status-codes-blacklist Blocklisted status codes
--exclude-length Exclude responses of N bytes
-m --method HTTP method (default: GET)

#Virtual Host Enumeration Examples

# Basic vhost discovery (wordlist contains full vhost names)
gobuster vhost -u http://10.10.10.10 -w vhosts-full.txt

# Auto-append domain: wordlist has "dev", "staging", result is "dev.target.htb"
gobuster vhost -u http://10.10.10.10 \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
  --append-domain -d target.htb -t 50

# Filter noise: identify default page length first, then exclude it
# Step 1: note the length of the default response
curl -s http://10.10.10.10 | wc -c  # e.g. 4242 bytes

# Step 2: exclude that length to reveal real vhosts
gobuster vhost -u http://10.10.10.10 \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
  --append-domain -d target.htb \
  --exclude-length 4242 -t 40

# HTTPS vhost (internal lab)
gobuster vhost -u https://192.168.56.10 -k \
  -w subdomains.txt --append-domain -d lab.local \
  --exclude-length 0,612

#VHost vs DNS - Key Difference

DNS mode:   Bruteforces DNS resolution. A subdomain is "found" if DNS resolves it.
            Result: host.target.com → 1.2.3.4

VHost mode: Bruteforces the HTTP Host header. A vhost is "found" if the server
            returns a different response than the default.
            Result: Host: dev.target.com → HTTP 200 (not 404)

Use DNS when:   subdomains have real DNS records
Use VHost when: multiple apps share one IP (CTF boxes, internal apps)

#Fuzz Mode (fuzz)

#fuzz Options

Flag Long Form Description
-u --url URL with FUZZ keyword (required)
-w --wordlist Payload wordlist
-d --data POST body containing FUZZ
-H --headers Header string containing FUZZ
-b --status-codes-blacklist Exclude status codes from output
-s --status-codes Allowlist status codes
--exclude-length Exclude responses of N bytes
-m --method HTTP method (default: GET)
-r --follow-redirect Follow redirects

#FUZZ Keyword Placement

# Fuzz URL path segment
gobuster fuzz -u "http://target.com/FUZZ" -w common.txt -b 404

# Fuzz GET parameter value
gobuster fuzz -u "http://target.com/api?user=FUZZ" -w usernames.txt -b 404,400

# Fuzz GET parameter key (discover hidden params)
gobuster fuzz -u "http://target.com/api?FUZZ=test" \
  -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt -b 404

# Fuzz POST body
gobuster fuzz -u "http://target.com/login" -m POST \
  -d "username=admin&password=FUZZ" \
  -w /usr/share/seclists/Passwords/Leaked-Databases/rockyou-75.txt \
  -b 401,403 -H "Content-Type: application/x-www-form-urlencoded"

# Fuzz JSON POST body
gobuster fuzz -u "http://target.com/api/auth" -m POST \
  -d '{"username":"admin","password":"FUZZ"}' \
  -w passwords.txt \
  -H "Content-Type: application/json" -b 401

# Fuzz HTTP header value (e.g. Host-based bypass)
gobuster fuzz -u "http://target.com/admin" \
  -H "X-Forwarded-For: FUZZ" \
  -w /usr/share/seclists/Fuzzing/Integers/Integers-onlythree.txt -b 403

# Fuzz in URL fragment / scheme
gobuster fuzz -u "http://target.com/FUZZ.php" \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-words-lowercase.txt \
  -b 404 -t 40 --exclude-length 0

#Cloud Storage Modes

#S3 Mode (Amazon)

# Basic S3 bucket discovery
gobuster s3 -w /usr/share/seclists/Discovery/Web-Content/s3-buckets.txt

# Verbose output (shows ACL status for found buckets)
gobuster s3 -w bucket-names.txt -v

# Higher threads
gobuster s3 -w bucket-names.txt -t 50

#GCS & TFTP Modes

# Google Cloud Storage bucket enumeration
gobuster gcs -w /usr/share/seclists/Discovery/Web-Content/s3-buckets.txt -t 50

# TFTP file discovery (requires -s for server)
gobuster tftp -s 10.10.10.1 -w /usr/share/seclists/Discovery/Web-Content/raft-small-files.txt

# TFTP with custom timeout
gobuster tftp -s 192.168.1.1 -w filenames.txt --timeout 3s -t 20

#Cloud Mode Options

Flag Applies To Description
-w s3, gcs, tftp Bucket/filename wordlist
-s tftp TFTP server address
-v s3, gcs Verbose (show ACL / permission info)
--debug s3, gcs Debug output
-t all Threads

#Mode Advisor

#Interactive Mode Selector

Select what you're looking for and the advisor builds the right gobuster command with wordlist recommendations.

Gobuster Mode Advisor

Answer each question to build the right gobuster command for your scenario.

#Mode Reference

#Mode Decision Table

Goal Mode Command When to use
Find files and directories dir gobuster dir -u http://target -w wordlist.txt Web server content discovery, CTF recon
Find subdomains via DNS dns gobuster dns -d target.com -w subdomains.txt Subdomain enumeration when DNS resolves
Find virtual hosts on same IP vhost gobuster vhost -u http://IP -w wordlist.txt --append-domain Multiple apps on same server, no DNS records
Fuzz parameters or paths fuzz gobuster fuzz -u "http://target?id=FUZZ" -w payloads.txt Custom fuzzing with FUZZ keyword
Find AWS S3 buckets s3 gobuster s3 -w bucket-names.txt Cloud recon, public bucket discovery
Find GCS buckets gcs gobuster gcs -w bucket-names.txt Google Cloud Storage enumeration
Enumerate TFTP files tftp gobuster tftp -s 10.10.10.1 -w filenames.txt TFTP server file discovery

#Performance & Stealth

#Performance Tuning

# Fast: high thread count (beware WAF/rate limits)
gobuster dir -u http://target.com -w wordlist.txt -t 100

# Throttled: delay between requests (IDS evasion)
gobuster dir -u http://target.com -w wordlist.txt -t 5 --delay 300ms

# Skip first N words (resume aborted scan)
gobuster dir -u http://target.com -w wordlist.txt --wordlist-offset 50000

# Retry on flaky targets
gobuster dir -u http://target.com -w wordlist.txt --retry --retry-attempts 3

# DNS: increase threads for large wordlists
gobuster dns -d target.com -w top1million.txt -t 150

# Bind to specific interface (multi-homed host)
gobuster dir -u http://target.com -w wordlist.txt --interface eth1

#Timeout Reference

Scenario Recommended Timeout
Fast local network 3s
Standard internet 10s (default)
Slow / unstable target 30s
TFTP 3s
DNS 5s

#HTTPS & Proxy

#HTTPS Examples

# Skip TLS validation (self-signed cert, lab environment)
gobuster dir -u https://target.com -w wordlist.txt -k

# Use client certificate (mutual TLS)
gobuster dir -u https://target.com -w wordlist.txt \
  --client-cert-p12 client.p12 --client-cert-p12-password "secret"

# Custom CA / pinned cert environment - bypass with -k
gobuster vhost -u https://10.10.10.10 -k -w subdomains.txt \
  --append-domain -d target.htb --exclude-length 0

#Proxy Examples

# Route through Burp Suite (inspect & replay)
gobuster dir -u http://target.com -w wordlist.txt \
  --proxy http://127.0.0.1:8080

# SOCKS5 proxy (pivoting through SSH tunnel)
gobuster dir -u http://internal.corp -w wordlist.txt \
  --proxy socks5://127.0.0.1:1080

# DNS over custom resolver (via internal resolver when pivoting)
gobuster dns -d corp.internal -w subdomains.txt -r 10.10.10.1:53

#Output

#Output Options

# Write results to file
gobuster dir -u http://target.com -w wordlist.txt -o results.txt

# Quiet mode - output only results (pipeable)
gobuster dir -u http://target.com -w wordlist.txt -q -o results.txt

# Expanded URLs (full path in output)
gobuster dir -u http://target.com -w wordlist.txt -e

# Show response lengths (useful for baseline identification)
gobuster dir -u http://target.com -w wordlist.txt -l

# Suppress noisy error lines
gobuster dir -u http://target.com -w wordlist.txt --no-error

#Parsing Output

# Filter gobuster dir output for 200 OK only
grep "\(Status: 200\)" results.txt

# Extract just URLs
grep "\(Status: 200\)" results.txt | awk '{print $1}'

# Pipe quiet output to other tools
gobuster dir -u http://target.com -w wordlist.txt -q | tee results.txt | \
  grep "(Status: 200)"

# Feed discovered dirs back for recursive enumeration (manual recursion)
gobuster dir -u http://target.com -w wordlist.txt -q | \
  awk '{print $1}' | while read path; do
    gobuster dir -u "$path" -w wordlist.txt -q -b 404 >> deep-results.txt
  done

#Wordlists

Use Case Wordlist Path Size
Quick dir scan /usr/share/wordlists/dirb/common.txt ~4k
Medium dir scan /usr/share/dirbuster/wordlists/directory-list-2.3-medium.txt ~220k
General files (raft) /usr/share/seclists/Discovery/Web-Content/raft-large-files.txt ~37k
General dirs (raft) /usr/share/seclists/Discovery/Web-Content/raft-large-directories.txt ~73k
Large words (raft) /usr/share/seclists/Discovery/Web-Content/raft-large-words.txt ~119k
API endpoints /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt ~1k
Backup / sensitive /usr/share/seclists/Discovery/Web-Content/quickhits.txt ~2.5k
Subdomains 5k /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt 5k
Subdomains 20k /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt 20k
Subdomains 110k /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt 110k
DNS deep /usr/share/seclists/Discovery/DNS/dns-Jhaddix.txt ~1.9M
Bitquark subdomains /usr/share/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt 100k
VHosts /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt 5k
S3 / GCS buckets /usr/share/seclists/Discovery/Web-Content/s3-buckets.txt ~8k
CGI scripts /usr/share/seclists/Discovery/Web-Content/CGIs.txt ~3.5k
HTTP params /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt ~6k

#Practical Workflows

#CTF Recon Flow

  1. Identify open ports with nmap - note HTTP/S ports
  2. Run quick dir scan: gobuster dir -u http://box.htb -w common.txt -x php,txt,html -b 404
  3. Add box IP to /etc/hosts, note the hostname
  4. DNS/VHost sweep: gobuster vhost -u http://box.htb -w subdomains-5k.txt --append-domain --exclude-length <default>
  5. For each discovered vhost, repeat dir scan with appropriate extensions
  6. Fuzz interesting endpoints: gobuster fuzz -u "http://box.htb/api?id=FUZZ" -w numbers.txt -b 404
  7. Check discovered dirs for backup files using --discover-backup
  8. Collect all 200/301 paths, spider manually in Burp

#Web App Pentest Flow

  1. Scope confirmation - identify all in-scope hostnames and IP ranges
  2. DNS sweep all domains: gobuster dns -d client.com -w subdomains-110k.txt -i -r 8.8.8.8 -t 100
  3. For each host, run dir scan: gobuster dir -u https://host -w raft-large-words.txt -x php,aspx,jsp -k -b 404
  4. For shared IPs, run vhost scan to find hidden apps
  5. Fuzz all parameter inputs discovered during manual review
  6. Check cloud exposure: gobuster s3 -w company-name-variants.txt
  7. Parse all output files, deduplicate, feed into vulnerability scanner
  8. Document findings with full gobuster command used for reproducibility

#Tool Comparison

#Gobuster vs ffuf vs Feroxbuster

Feature Gobuster ffuf Feroxbuster
Language Go Go Rust
Recursive scanning No (manual) Limited (-recursion) Yes (auto, depth control)
Multiple wordlists No Yes (clusterbomb, pitchfork) No
FUZZ in URL/header/body fuzz mode only Yes (all modes) No
Filter by size --exclude-length -fs -S
Filter by words/lines No -fw, -fl No
Filter by regex No -fr No
Interactive pause/adjust No Yes (press ENTER) Yes
Auto-tune / auto-bail No No Yes
Rate limiting detection No No Yes
DNS enumeration Yes No No
VHost enumeration Yes Headers only No
S3 / GCS / TFTP modes Yes No No
Output formats txt json, html, csv, md txt, json
Config file No Yes Yes (ferox-config.toml)
Best for DNS, vhost, S3, clean dir scans Complex fuzzing, multi-param Recursive web enumeration

#When to Use Each

Situation Best Tool
Quick dir/file brute-force Gobuster
DNS subdomain enumeration Gobuster
VHost / virtual host discovery Gobuster
S3 / GCS bucket discovery Gobuster
Deep recursive crawl (many dirs) Feroxbuster
Fuzz multiple parameters simultaneously ffuf
Filter by response word/line count ffuf
Auto-tune against WAF / rate-limiting Feroxbuster
Need JSON/HTML/CSV output ffuf
Simple, fast, scriptable output Gobuster

#Installation

#Install Methods

# Go install (recommended, latest)
go install github.com/OJ/gobuster/v3@latest

# Kali / Debian
apt install gobuster

# Docker
docker pull ghcr.io/oj/gobuster:latest
docker run --rm ghcr.io/oj/gobuster:latest dir --help

# Build from source
git clone https://github.com/OJ/gobuster.git
cd gobuster && go build .

#Verify & Help

# Check version
gobuster version

# List all modes
gobuster --help

# Mode-specific help
gobuster dir --help
gobuster dns --help
gobuster vhost --help
gobuster fuzz --help
gobuster s3 --help
gobuster gcs --help
gobuster tftp --help

#Also See

#Cyber Aurelien Guidi