How to Use Gobuster: Beginner's Guide to Directory, DNS & VHost Enumeration in Kali Linux
Learn how to use Gobuster in Kali Linux — dir, DNS and vhost modes, wordlists, and a worked DVWA example, with a cheat sheet and troubleshooting.
What Is Gobuster?
Gobuster is a fast, open-source command-line tool for brute-forcing hidden content on web servers and in DNS. Written in Go, it sends thousands of requests per second from a wordlist and reports the directories, files, subdomains, and virtual hosts that actually exist — the hidden parts of a target that no link points to.
You need to discover hidden directories, files, or subdomains on a web target — Gobuster brute-forces them faster than any alternative. Built in Go for maximum concurrency, it handles directory/file discovery, DNS subdomain enumeration, and virtual host brute-forcing in a single tool. Where older tools such as Dirb take minutes to work through a wordlist, Gobuster's concurrent requests finish the same scan in seconds, which is why it is the first enumeration tool most testers reach for after Nmap.
Prerequisites
Gobuster is an aggressive scanner: it sends a large volume of HTTP requests, which is clearly visible in server logs and will trigger IDS and WAF alerts on monitored systems. Only run it against systems you own, your own lab, or targets with explicit written authorization.
How Gobuster Works
Gobuster operates in several modes, each built for one enumeration job:
Directory/File Mode: Sends HTTP requests to a target server using paths from a wordlist and reports those that return specific status codes.
DNS Mode: Queries DNS servers for subdomains from a wordlist and reports those that resolve.
VHOST Mode: Sends requests with different Host headers to identify virtual hosts on the same IP address.
Fuzz Mode: Replaces a FUZZ placeholder anywhere in the URL, headers, or body — the flexible mode for anything the other three cannot express.
Gobuster works by taking a wordlist and sending one HTTP request (or DNS query) per word — appending each word to the target URL and recording which paths return a response that is not a 404. The wordlist is everything: Gobuster does not discover directories by magic, it tests the paths you give it. A good wordlist and the right mode matter more than any flag.
How to Use Gobuster in 5 Steps
gobuster --version and confirm it prints a version number./usr/share/wordlists/dirb/common.txt for directories or a subdomains list for DNS mode. Small first, bigger only if the small list finds something worth following up.gobuster dir -u http://192.168.56.101/dvwa/ -w /usr/share/wordlists/dirb/common.txt -x php,txt — one command, one mode, one wordlist./admin, run a new scan against /admin with the same wordlist and extensions.Installation
Gobuster comes pre-installed on Kali Linux. Verify it before you start:
# Check the installed version (current Kali ships Gobuster v3.6.0)
gobuster --version
# If it is missing, install it from the Kali repositories
sudo apt update && sudo apt install gobuster -y
# Install SecLists at the same time — the best free wordlist collection
sudo apt install seclists -y
If you want the latest release instead of the packaged version, build it from source. The project currently requires Go 1.24 or newer:
# From source (Go 1.24 or newer required)
sudo apt install golang-go
go install github.com/OJ/gobuster/v3@latest
# Confirm the new binary is on your PATH
gobuster --version
On Debian and Ubuntu the same apt install gobuster works. On macOS, brew install gobuster installs it. On Windows, download the release binary from the project's GitHub releases page and run gobuster.exe --help. The commands in this guide are identical on every platform once the binary is installed.
Understanding Gobuster Modes
Gobuster uses a mode-based command structure. The general syntax is gobuster [mode] [options], and you must always pick a mode first:
| Mode | What it does | Example |
|---|---|---|
dir | Directory and file enumeration | gobuster dir -u https://example.com -w wordlist.txt |
dns | DNS subdomain enumeration | gobuster dns -d example.com -w subdomains.txt |
vhost | Virtual host discovery | gobuster vhost -u https://example.com --append-domain -w subdomains.txt |
fuzz | Replace a FUZZ placeholder anywhere | gobuster fuzz -u https://example.com/FUZZ -w wordlist.txt |
s3 | Enumerate public Amazon S3 buckets | gobuster s3 -w wordlist.txt |
tftp | Enumerate files on a TFTP server | gobuster tftp -s 192.168.56.101 -w wordlist.txt |
dir is the mode you will use in almost every web assessment — it is the mode most beginners associate with Gobuster. dns and vhost cover the infrastructure around the website, fuzz covers everything else, and s3 and tftp cover their specific services. Run gobuster help for the full list, and gobuster help dir for the flags of one mode.
Choosing the Right Wordlist
The wordlist determines what Gobuster looks for. A small list finishes in seconds and finds the obvious paths; a large list takes minutes and finds the obscure ones. Start small and escalate only when the small list earns it.
| Wordlist | Words | Time | When to use it |
|---|---|---|---|
/usr/share/wordlists/dirb/common.txt | 4,614 | ~5 seconds | Start here on every engagement |
/usr/share/wordlists/dirbuster/directory-list-2.3-small.txt | ~87,000 | ~1 minute | When common.txt found something interesting |
/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt | ~220,000 | ~5 minutes | Thorough scan after the small list |
SecLists Discovery/Web-Content/common.txt | ~4,700 | ~5 seconds | Alternative starter list |
SecLists Discovery/DNS/subdomains-top1million-5000.txt | 5,000 | ~1 minute | DNS mode starter list |
SecLists Discovery/DNS/subdomains-top1million-20000.txt | 20,000 | ~3 minutes | Thorough DNS enumeration |
Two rules. First, use a directory list for dir mode and a subdomains list for dns mode — the lists are built for different jobs and mixing them wastes requests. Second, match the list to the target technology: a PHP application wants -x php, a Java application wants -x jsp, and a static site wants -x html,txt.
Basic Usage
Directory Busting Mode
gobuster dir -u https://example.com -w /usr/share/wordlists/dirb/common.txt
Key Options
| Option | Description |
|---|---|
-u URL | Target URL |
-d DOMAIN | Target domain (DNS mode) |
-w WORDLIST | Path to wordlist |
-x EXTENSIONS | File extensions to check |
-t THREADS | Concurrent threads (default 10) |
-s STATUS_CODES | Status codes to include |
-k | Skip TLS verification |
-o FILE | Output file |
-q | Quiet mode (no banner or progress) |
-c COOKIES | Cookies to use in requests |
-H HEADER | Custom HTTP header |
-U USERNAME / -P PASSWORD | HTTP basic authentication |
-r | Follow redirects |
--append-domain | Append the domain to vhost words |
--exclude-length | Exclude responses of a given length |
--no-error | Do not display errors |
--delay | Delay between requests (for rate-limited targets) |
DNS Subdomain Mode
gobuster dns -d example.com -w /usr/share/wordlists/dirb/common.txt
DNS mode queries the target's DNS server for each word in the wordlist and reports the subdomains that resolve. Use a subdomains wordlist, not a directory list, and add -r 8.8.8.8 to use a specific resolver when the target's own resolver is slow or filtered.
VHOST Mode
gobuster vhost -u https://example.com -w /usr/share/wordlists/dirb/common.txt
VHOST mode sends requests with different Host headers to the same IP address and reports which hostnames the server answers for. Add --append-domain so each word is tried as word.example.com instead of a bare hostname.
Directory Busting Examples
# Basic scan
gobuster dir -u http://192.168.56.101 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
# With file extensions
gobuster dir -u http://192.168.56.101 -w /usr/share/wordlists/dirb/common.txt -x php,html,txt,asp
# Custom status codes
gobuster dir -u http://192.168.56.101 -w wordlist.txt -s "200,204,301,302,307,401,403"
# Save the output and run quietly
gobuster dir -u http://192.168.56.101 -w /usr/share/wordlists/dirb/common.txt -x php -o directories.txt -q
# Authenticated scan with a session cookie
gobuster dir -u http://192.168.56.101/dvwa/ -w /usr/share/wordlists/dirb/common.txt -x php -c "PHPSESSID=abc123; security=low"
DNS Subdomain Examples
gobuster dns -d example.com -w /usr/share/wordlists/dirb/common.txt
gobuster dns -d example.com -w subdomains.txt -r 8.8.8.8
gobuster dns -d example.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 50 -o subdomains.txt
Worked Example: Enumerating a DVWA Lab with Gobuster
This example runs entirely in a lab: DVWA (Damn Vulnerable Web Application) running at http://192.168.56.101/dvwa/ on a local virtual machine. Every output below is illustrative — real output varies by DVWA version and wordlist.
Step 1 — Scan the application root for directories and PHP files:
gobuster dir -u http://192.168.56.101/dvwa/ -w /usr/share/wordlists/dirb/common.txt -x php,txt
===============================================================
Gobuster v3.6.0
===============================================================
[+] Url: http://192.168.56.101/dvwa/
[+] Method: GET
[+] Threads: 10
[+] Wordlist: /usr/share/wordlists/dirb/common.txt
[+] Status codes: 200,204,301,302,307,401,403
===============================================================
/login.php (Status: 200) [Size: 2341]
/config (Status: 403) [Size: 291]
/docs (Status: 200) [Size: 1877]
/setup.php (Status: 200) [Size: 3102]
===============================================================
Read the output in priority order. /login.php (200) is the application's login page — the front door. /config (403) is the interesting one: the server refuses to show it, which means something exists there, and configuration directories are exactly where credentials hide. /setup.php (200) is the DVWA setup page, useful for confirming the application version.
Step 2 — Re-scan the interesting directory. Gobuster does not recurse, so the /config finding needs its own scan:
gobuster dir -u http://192.168.56.101/dvwa/config/ -w /usr/share/wordlists/dirb/common.txt -x php,inc,txt
/config.inc.php (Status: 200) [Size: 1588]
A configuration file is reachable. In a real assessment this is a finding to report: configuration files should never be web-accessible, and this one contains the database credentials DVWA uses.
Step 3 — Enumerate subdomains for the same target:
gobuster dns -d example.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 50
Found: dev.example.com [192.168.56.101]
Found: staging.example.com [192.168.56.101]
Development and staging subdomains often run older, weaker code than production — they are worth the same directory scan you just ran against the main application. That is the full workflow: scan, read, re-scan, expand to subdomains, and feed every finding into the next tool.
How to Read Gobuster Output
Every Gobuster result line has three parts: the path, the HTTP status code, and the response size. The status code tells you what to do next:
| Status code | Meaning | What to do |
|---|---|---|
| 200 | OK — the path exists and is readable | Open it and read it |
| 301 / 302 | Redirect — the path exists elsewhere | Follow the redirect; the target may be more interesting |
| 403 | Forbidden — the path exists but access is denied | Note it: 403 proves something exists; try different extensions or authentication |
| 401 | Unauthorized — the path needs credentials | Try authenticated scanning with -c or -U |
| 500 | Server error — the path triggered an error | Note it: errors can reveal software versions and paths |
| 404 | Not found | Gobuster hides these by default — they are not findings |
The Size column is your filter for false positives: when every path returns the same size, the server is returning a custom 404 page with a 200 status, and you should use --exclude-length to hide it. When one path returns a much larger size than the rest, that path has real content.
Saving and Filtering Output
# Save results to a file for the report
gobuster dir -u https://example.com -w common.txt -o results.txt
# Quiet mode — no banner, no progress bar, just results
gobuster dir -u https://example.com -w common.txt -q
# Only show 200 and 403 responses
gobuster dir -u https://example.com -w common.txt -s "200,403"
# Hide the custom 404 page (all responses of 1234 bytes)
gobuster dir -u https://example.com -w common.txt --exclude-length 1234
# Slow down for a rate-limited target
gobuster dir -u https://example.com -w common.txt --delay 200ms
# Skip TLS errors on a lab with a self-signed certificate
gobuster dir -u https://192.168.56.101 -w common.txt -k
Always save output with -o: the scan takes minutes, the report takes hours, and re-running a scan because you lost the results is the most avoidable waste in an assessment.
Real-World Example: Full Web Reconnaissance
# Step 1: Scan for directories
gobuster dir -u http://192.168.56.101 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x php,html,txt -t 50 -o directories.txt
# Step 2: Discover subdomains
gobuster dns -d example.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 30 -o subdomains.txt
# Step 3: Check for virtual hosts
gobuster vhost -u http://192.168.56.101 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 30 -o vhosts.txt
Run the three modes in order — directories first, then subdomains, then virtual hosts — and feed every finding into the next phase of the test: login pages go to the credential-testing phase, subdomains get their own directory scans, and virtual hosts get checked for forgotten applications.
Gobuster vs Dirb vs FFUF
The three directory brute-forcers overlap, but they are not interchangeable. Pick by the job, not by habit:
| Gobuster | Dirb | FFUF | |
|---|---|---|---|
| Language | Go | C | Go |
| Speed | Very fast (concurrent requests) | Slow (single-threaded style) | Very fast (concurrent requests) |
| Modes | dir, dns, vhost, fuzz, s3, tftp | Directory only | General fuzzing (URL, headers, parameters, POST data) |
| Recursion | No — re-scan found directories manually | Yes, built in | No |
| Wordlist flexibility | One wordlist per run | One wordlist per run | FUZZ placeholder anywhere in the request |
| Best use case | Quick first sweep for directories, DNS, and vhosts | Slow, thorough directory scan | Fuzzing parameters, headers, and APIs |
| Learning curve | Easy — one command per mode | Easy | Medium — the FUZZ syntax takes practice |
Use Gobuster for a quick first sweep — it is faster to type and great for the most common use case, directory busting. Switch to FFUF when you need to fuzz parameters, headers, POST data, or anything that requires a placeholder somewhere other than the end of a URL. Use Dirb when you want recursion without thinking about it, or when you are on a machine that has nothing else installed.
Gobuster Commands Cheat Sheet
| Task | Command |
|---|---|
| Directory scan | gobuster dir -u https://example.com -w common.txt |
| Directory scan with extensions | gobuster dir -u https://example.com -w common.txt -x php,html,js,txt |
| DNS subdomain scan | gobuster dns -d example.com -w subdomains.txt |
| VHOST scan | gobuster vhost -u https://example.com --append-domain -w subdomains.txt |
| Fuzz a URL parameter | gobuster fuzz -u "https://example.com/?id=FUZZ" -w numbers.txt |
| Show all modes | gobuster help |
| Show flags for one mode | gobuster help dir |
| Check the version | gobuster --version |
| More threads | gobuster dir -u https://example.com -w common.txt -t 50 |
| Custom status codes | gobuster dir -u https://example.com -w common.txt -s "200,204,301,302,307,401,403" |
| Save output | gobuster dir -u https://example.com -w common.txt -o results.txt |
| Quiet mode | gobuster dir -u https://example.com -w common.txt -q |
| Skip TLS verification | gobuster dir -u https://192.168.56.101 -w common.txt -k |
| Scan with a cookie | gobuster dir -u https://example.com -w common.txt -c "PHPSESSID=abc123" |
| Scan with basic auth | gobuster dir -u https://example.com -w common.txt -U admin -P password |
| Hide the custom 404 page | gobuster dir -u https://example.com -w common.txt --exclude-length 1234 |
| Slow down for rate limiting | gobuster dir -u https://example.com -w common.txt --delay 200ms |
| Follow redirects | gobuster dir -u https://example.com -w common.txt -r |
| Use a proxy | gobuster dir -u https://example.com -w common.txt -p http://127.0.0.1:8080 |
| Custom user agent | gobuster dir -u https://example.com -w common.txt -a "Mozilla/5.0" |
Troubleshooting Gobuster Problems
| Problem | Likely cause | What to do |
|---|---|---|
| Gobuster finds nothing | Wrong wordlist, or the target has nothing to find | Try a bigger wordlist; add -x extensions; check the target loads in a browser first |
| Every path returns 200 | The server returns a custom 404 page with a 200 status | Find the 404 page size and hide it with --exclude-length |
| Connection refused | The target is down, or the port is wrong | Check the URL and port; confirm the target with curl or a browser |
| Scan is very slow | Too few threads, or the target rate-limits you | Raise -t to 30–50 on a lab; add --delay on a rate-limited target |
| 429 Too Many Requests | The target or WAF is rate-limiting you | Slow down with --delay 500ms and fewer threads; pause and resume later |
| Wordlist not found | The path is wrong, or SecLists is not installed | Check the path with ls; install with sudo apt install seclists |
| gobuster: command not found | Gobuster is not installed or not on PATH | Install with sudo apt install gobuster; if built from source, check go/bin is on PATH |
| HTTPS certificate errors | Self-signed certificate on a lab target | Add -k to skip TLS verification |
| VHOST mode finds nothing | The server ignores Host headers, or the wordlist is wrong | Use --append-domain; try a subdomains wordlist instead of a directory list |
| DNS mode finds nothing | The resolver is filtered, or the wordlist is wrong | Try -r 8.8.8.8 to use a public resolver; use a subdomains wordlist |
Common Mistakes
Using Wrong Wordlist
Small wordlists miss many valid paths. Use medium or large wordlists — but start small and escalate, so you do not spend five minutes learning that the target has nothing at all.
Not Specifying Extensions
Always specify likely extensions with -x. A scan without -x finds directories but misses files: /login.php never appears in a scan that only tests bare paths.
Too Many Threads
Start with the default 10 threads and raise to 30–50 on a lab target. Too many threads against a small target causes timeouts, dropped connections, and missed results — and against a real target it looks like a denial-of-service attack.
Forgetting -k on Self-Signed Labs
Lab targets use self-signed certificates. Without -k, Gobuster fails every HTTPS request with a certificate error and finds nothing.
Scanning Without Permission
Gobuster sends thousands of requests. Against a system you do not own or have authorization to test, that traffic is evidence of an attack. Labs, CTFs, and authorized assessments only.
Trusting a Single Wordlist
One wordlist is one opinion about what paths exist. If the first list finds nothing, try a second list — SecLists has technology-specific lists for a reason.
Ignoring 403s
A 403 means something exists. New testers dismiss 403s as failures and miss the configuration directories, backup files, and admin panels hiding behind them.
Best Practices
Use targeted wordlists: Choose based on target technology — PHP lists for PHP applications, API lists for APIs, subdomains lists for DNS mode.
Check robots.txt first: Always check /robots.txt before scanning. It lists paths the site owner considers interesting, and it is free reconnaissance.
Combine with other tools: Use Nmap for discovery, then Gobuster for content enumeration, then FFUF for parameter fuzzing. Each tool answers a different question.
Save every scan: Use -o on every run. The scan takes minutes and the report takes hours — never re-run a scan because you lost the output.
Start small, escalate deliberately: common.txt first, medium only when the small list earns it. Speed matters more than completeness on the first pass.
Verify findings manually: A Gobuster result is a lead, not a vulnerability. Open the path in a browser before you write it in a report.
Summary
Gobuster is a fast, efficient tool for web content discovery through directory, DNS, and virtual host brute-forcing. Its Go-based architecture delivers excellent performance with concurrent requests, and its mode-based design covers the whole enumeration job — directories with dir, subdomains with dns, virtual hosts with vhost, and everything else with fuzz. The skill is not the command, which is one line, but the workflow around it: pick the right wordlist, read the status codes, re-scan what you find, and save everything.
Knowledge Check
-x flag do in directory mode?Answers: 1. Directory/file (dir), DNS subdomain (dns), and virtual host (vhost) — plus fuzz, s3, and tftp modes; 2. It is written in Go and sends many requests concurrently, where older tools work through the wordlist mostly one request at a time; 3. It tells Gobuster which file extensions to test, such as php, html, and txt, so files are found as well as directories; 4. DNS mode queries the DNS server for subdomains that resolve, while VHOST mode sends requests with different Host headers to find virtual hosts on the same IP; 5. robots.txt lists paths the site considers interesting and is free reconnaissance; 6. Gobuster does not recurse — a found directory needs its own scan to discover what is inside it; 7. A 403 means the path exists but access is denied, which proves something is there; 8. Find the 404 page's response size and hide it with --exclude-length.
Keep Learning
Frequently Asked Questions
Continue Learning
How to Use FFUF: Beginner's Guide to Fast Web Fuzzing in Kali Linux
Learn how to use FFUF in Kali Linux — directory, subdomain and vhost fuzzing, parameter testing, filters and a worked DVWA example, with a cheat sheet.
Tools · BeginnerHow to Use Dirb: Beginner's Guide to Directory Brute-Forcing in Kali Linux
Learn how to use Dirb in Kali Linux: run your first directory scan, pick the right wordlist, and read the results — with a worked example and cheat sheet.
Tools · IntermediateSQLMap Commands: Cheat Sheet & How to Use SQLMap in Kali Linux
Every SQLMap command you need - target, enumeration, tamper scripts, WAF bypass, OS shell - with a worked DVWA example, troubleshooting and the developer fix.
Tools · BeginnerHow to Use Tcpdump: Beginner's Guide to Packet Capture in Kali Linux
Learn how to use tcpdump in Kali Linux — capture packets, filter with BPF, save pcap files and read output, with a worked example and cheat sheet.
Related Security Tools
Gobuster
Learn how to use Gobuster, the fast Go-based directory and subdomain brute-forcer, with install steps, your first dir scan, wordlist picks, and result filtering — a beginner tutorial for Kali Linux.
Web ApplicationFFUF
Learn how to use FFUF (Fuzz Faster U Fool), the extremely fast open-source web fuzzer written in Go: place the FUZZ keyword where a wordlist entry should go, run your first scan, filter the noise, and discover hidden directories, files, parameters, virtual hosts and API endpoints on targets you have permission to test.
Web ApplicationDIRB
DIRB is a web content scanner that finds hidden directories, backup files, and other sensitive content on web servers by launching dictionary-based attacks against a target URL. This beginner tutorial shows how to use DIRB in Kali Linux: install it, run your first scan, read the output, switch wordlists, and hand verified findings to the next tool.
Wireless AttacksWifite
Learn how to use Wifite in Kali Linux with this beginner tutorial: check your WiFi adapter, install Wifite, run your first authorized WiFi audit, capture WPA handshakes and PMKIDs, and crack them with a wordlist. Includes Wifite commands, a worked example, troubleshooting for common errors, and how Wifite compares with Aircrack-ng.