Gobuster Guide: Directory and DNS Busting Tool
Learn how to use Gobuster for directory and file discovery on web servers, DNS subdomain enumeration, and virtual host discovery.
Why You Need Gobuster
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.
Prerequisites
How Gobuster Works
Gobuster operates in three primary modes:
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.
Installation
Gobuster comes pre-installed on Kali Linux:
# Debian/Ubuntu
sudo apt install gobuster
# From source
sudo apt install golang-go
go install github.com/OJ/gobuster/v3@latest
Basic Usage
Directory Busting Mode
gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt
Key Options
| Option | Description |
|--------|-------------|
| -u URL | Target URL |
| -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 |
DNS Subdomain Mode
gobuster dns -d target.com -w /usr/share/wordlists/dirb/common.txt
VHOST Mode
gobuster vhost -u http://target.com -w /usr/share/wordlists/dirb/common.txt
Directory Busting Examples
# Basic scan
gobuster dir -u http://192.168.1.100 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
# With file extensions
gobuster dir -u http://192.168.1.100 -w /usr/share/wordlists/dirb/common.txt -x php,html,txt,asp
# Custom status codes
gobuster dir -u http://192.168.1.100 -w wordlist.txt -s "200,204,301,302,307,401,403"
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
Real-World Example: Full Web Reconnaissance
# Step 1: Scan for directories
gobuster dir -u http://target.com -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 target.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://target.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 30 -o vhosts.txt
Common Mistakes
Using Wrong Wordlist
Small wordlists miss many valid paths. Use medium or large wordlists.
Not Specifying Extensions
Always specify likely extensions with -x.
Too Many Threads
Start with 50 threads and adjust based on target response.
Best Practices
Use targeted wordlists: Choose based on target technology.
Check robots.txt first: Always check /robots.txt before scanning.
Combine with other tools: Use Nmap for discovery, then Gobuster.
Related Tools
Related Articles
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.