Gobuster
Gobuster – Directory & File Brute-Forcing Tool
Gobuster is a fast tool used for brute-forcing directories, files, subdomains, and virtual hosts. It helps in discovering hidden endpoints in web applications and is widely used during the reconnaissance phase of penetration testing.
Installation / Check
Check if Gobuster is installed:
which gobuster
Install Gobuster:
sudo apt install gobuster
Basic Syntax
gobuster dir -u <URL> -w <wordlist>
Common Commands
Directory scanning:
gobuster dir -u http://192.168.1.1 -w /usr/share/wordlists/dirb/common.txt
Find specific file extensions:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -x php,html,txt
Subdomain enumeration:
gobuster dns -d target.com -w subdomains.txt
Save output to file:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -o results.txt
Increase speed (threads):
gobuster dir -u http://192.168.1.1 -w wordlist.txt -t 50
Filter by status codes:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -s "200,204,301,302,307,401"
Exclude status codes:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -b "403,404"
Follow redirects:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -r
Ignore SSL certificate errors:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -k
Use cookies (authenticated scan):
gobuster dir -u http://192.168.1.1 -w wordlist.txt -c "PHPSES
Custom headers:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -H "Authorization: Bearer token"
Custom User-Agent:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -a "Mozilla/5.0"
Use proxy:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -p http://127.0.0.1:8080
Virtual host enumeration:
gobuster vhost -u http://192.168.1.1 -w vhosts.txt
DNS enumeration with IP:
gobuster dns -d target.com -w subdomains.txt -i
Handle wildcard DNS:
gobuster dns -d target.com -w subdomains.txt --wildcard
Fuzzing mode:
gobuster fuzz -u http://192.168.1.1/FUZZ -w wordlist.txt
Suppress errors:
gobuster dir -u http://192.168.1.1 -w wordlist.txt --no-error
Expanded output:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -e
HTTP authentication:
gobuster dir -u http://192.168.1.1 -w wordlist.txt -U admin -P password
Step-by-Step Guide
- Identify target URL
- Choose a wordlist (e.g., common.txt)
- Run directory scan:
gobuster dir -u <url> -w <wordlist>
- Look for interesting responses
- Test discovered paths manually
- Use extensions (-x) to find specific files
- Save results:
-o output.txt
Understanding the Output
- /path (Status: 200) → Resource exists
- 301/302 → Redirected resource
- 403 → Exists but access denied
- 404 → Not found
Also shows response size and path details.
⚠️ Legal Warning
Use enumeration tools only on systems you own or have explicit permission to test. Unauthorized scanning is illegal.