What is Gobuster?
Gobuster is a command-line tool written in Go that allows penetration testers and ethical hackers to brute-force:
- Directories and files on web servers (via HTTP/S)
- DNS subdomains
- Virtual hostnames
- S3 buckets and more
Unlike tools like DirBuster or Dirsearch, Gobuster is optimized for speed and flexibility, making it ideal for both recon and exploitation phases.
🚀 Installation
# Install Gobuster on Linux/macOS
sudo apt install gobuster
# Or install via Go (recommended latest)
go install github.com/OJ/gobuster/v3@latest
📂 Main Modes of Gobuster
- dir: Brute-force directories and files
- dns: Enumerate DNS subdomains
- vhost: Detect virtual hosts via Host headers
- s3: Scan Amazon S3 buckets (less common)
📘 Usage Examples
1. Directory Brute-Forcing
gobuster dir -u https://target.com -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,txt
This command scans for directories and files with the extensions `.php`, `.html`, and `.txt` on the given target.
2. DNS Subdomain Enumeration
gobuster dns -d target.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt
Scans for valid subdomains of target.com
using a wordlist.
3. Virtual Host Discovery
gobuster vhost -u http://target.com -w /usr/share/seclists/Discovery/DNS/namelist.txt
Tries to detect different virtual hosts on the same IP by sending requests with varying Host:
headers.
🔬 Advanced Tips & Flags
-t 50
→ Increase threads for faster scans-s 200,204,301,302
→ Only show specific status codes--random-agent
→ Use a random user-agent string-o results.txt
→ Output results to a file--exclude-length
→ Exclude responses with same size (e.g. 404s)
🌐 Real-World Scenario
You find a login panel at https://app.targetcorp.com/login
. You suspect hidden admin pages. Try:
gobuster dir -u https://app.targetcorp.com -w /usr/share/wordlists/dirb/common.txt -x php,html -t 40
Gobuster reveals:
/admin (Status: 200)
/backup (Status: 403)
/hidden/login (Status: 302)
Now you can prioritize further testing on /admin
and /hidden/login
.
💡 Pro Tips
- Start with small wordlists and increase as needed to reduce noise
- Use status code filters to avoid clutter
- Watch out for WAFs that may rate-limit Gobuster aggressively
- Use a proxy (e.g., Burp Suite) with
--proxy http://127.0.0.1:8080
- Always check for 403 Forbidden — it may still lead to interesting paths