Gobuster: Directory, DNS and Virtual Host Bruteforcing for Web Enumeration

Gobuster is a fast tool for brute-forcing directories, DNS, and virtual hosts. A practical guide to using it for web enumeration during a penetration test.
- Posted on 2026-02-09
- Reading time: 7 min
Finding hidden directories, exposed configuration files, and undocumented virtual hosts is the first step in compromising a web application. Gobuster does exactly that: it launches massive HTTP requests against a target using wordlists, identifying paths and resources that don't appear in the site's visible links.
Written in Go, Gobuster is fast and can handle hundreds of parallel requests without performance issues. It supports three main modes: dir for bruteforce directories/files, dns for subdomain enumeration and vhost for virtual host discovery. Unlike older tools like DirBuster, Gobuster is command-line, scriptable, and easily integrated into automated pipelines.
It occurs in the Reconnaissance phase of the kill chain (MITRE ATT&CK T1595.003). The article covers all modalities, including wordlist selection, status codes to interpret, and operational integration with scanners and exploits.
Setup and Installation #
Kali Linux (pre-installed):
gobuster versionOutput:
gobuster v3.6Manual installation:
sudo apt install gobusterFrom source (latest version):
go install github.com/OJ/gobuster/v3@latestThe track is located in ~/go/bin/gobuster.
Necessary wordlists:
Gobuster doesn't include wordlists. The best ones for web enumeration come from SecLists:
sudo apt install seclistsTypical paths:
/usr/share/seclists/Discovery/Web-Content/common.txt→ 4.727 entries, fast scan/usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt→ 220.560 entries, deep scan/usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt→ for subdomain enum
Basic Use #
Dir mode — Bruteforce directory #
gobuster dir -u http://10.10.10.50 -w /usr/share/seclists/Discovery/Web-Content/common.txtOutput:
===============================================================
Gobuster v3.6
===============================================================
[+] Url: http://10.10.10.50
[+] Threads: 10
[+] Wordlist: common.txt
===============================================================
/.htaccess (Status: 403) [Size: 277]
/admin (Status: 301) [Size: 313]
/api (Status: 200) [Size: 0]
/backup (Status: 301) [Size: 315]
/config (Status: 403) [Size: 277]
/login (Status: 200) [Size: 1523]
/uploads (Status: 301) [Size: 316]
/server-status (Status: 403) [Size: 277]
===============================================================Reading output:
200→ Accessible page, ready to explore301→ Redirect (existing directory)403→ Forbidden (exists but not accessible — potential misconfiguration)404→ Not found (Gobuster filters them by default)
DNS mode — Subdomain enumeration #
gobuster dns -d target.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txtOutput:
Found: mail.target.com
Found: vpn.target.com
Found: dev.target.com
Found: staging.target.com
Found: api.target.comvhost mode — Virtual host discovery #
gobuster vhost -u http://10.10.10.50 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domainUseful when multiple applications are hosted on the same IP with virtual hosting.
Operating Techniques #
Search for files with specific extensions #
Don't just search directories. Search for configuration files, backups, and scripts:
gobuster dir -u http://10.10.10.50 -w /usr/share/seclists/Discovery/Web-Content/common.txt -x php,txt,bak,old,conf,sql,zipOutput:
/config.php.bak (Status: 200) [Size: 482]
/database.sql (Status: 200) [Size: 15728]
/backup.zip (Status: 200) [Size: 3472890]
/.env (Status: 200) [Size: 312]Un .env exposed or a downloadable SQL backup are game over for many applications.
Filter by response size #
Many applications return 200s on everything with a custom error page. Filter by size:
gobuster dir -u http://10.10.10.50 -w wordlist.txt --exclude-length 1523If the custom 404 page has size 1523, all responses with that size are filtered.
HTTP Basic Authentication #
gobuster dir -u http://10.10.10.50/admin -w wordlist.txt -U admin -P password123Session cookies for authenticated areas #
gobuster dir -u http://10.10.10.50/dashboard -w wordlist.txt -c "PHPSESSID=abc123def456"Scan behind login — find features accessible only to authenticated users.
Custom User Agent #
WAFs and applications can block scanner user-agents:
gobuster dir -u http://target.com -w wordlist.txt -a "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"HTTPS with invalid certificates #
gobuster dir -u https://10.10.10.50 -w wordlist.txt -kThe flag -k ignore SSL certificate errors.
Advanced Techniques #
Recursive Bruteforce #
Gobuster doesn't support built-in recursion. It simulates this with a wrapper:
gobuster dir -u http://10.10.10.50 -w common.txt -o first_pass.txt
grep "Status: 301" first_pass.txt | awk '{print $1}' | while read dir; do
gobuster dir -u "http://10.10.10.50${dir}" -w common.txt -o "recursive_${dir//\//_}.txt"
doneFor native recursion, use Dirsearch which supports it out of the box.
Pattern-based brute force #
Search for endpoints with numeric or temporal patterns:
for i in $(seq 1 100); do echo "report_$i"; done > custom_wordlist.txt
gobuster dir -u http://10.10.10.50/documents/ -w custom_wordlist.txt -x pdfFind files as report_42.pdf that would not appear in generic wordlists.
Parallelization on multiple targets #
cat web_targets.txt | xargs -P 5 -I {} gobuster dir -u http://{} -w common.txt -o gobuster_{}.txt -q5 parallel instances of Gobuster, one per target. The flag -q suppresses header for clean output.
Fuzzing parameters with fuzz mode #
Gobuster v3.6 includes a fuzz mode for searching parameters:
gobuster fuzz -u http://10.10.10.50/api/FUZZ -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txtFUZZ is replaced with each entry in the wordlist.
Practical Pentest Scenarios #
Scenario 1: CTF/HTB Web Application — Finding the Admin Panel #
gobuster dir -u http://10.10.10.50 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html -t 50Expected output:
/index.php (Status: 200) [Size: 8421]
/login.php (Status: 200) [Size: 2103]
/admin (Status: 301) [Size: 313]
/backup (Status: 301) [Size: 315]
/secret (Status: 301) [Size: 315]What to do if it fails:
- All paths return 200 → The application has a custom 404 page. Identify the size of the 404:
curl -s http://target/nonexistent | wc -c. Then:--exclude-length SIZE. - Rate limiting active → Reduce thread:
-t 5. Add delay:--delay 200ms.
Timeline: Wordlist common (4.7K): 30 seconds. Medium (220K): 5-10 minutes at 50 threads.
Scenario 2: Enterprise Web App — Post-Authentication Enumeration #
gobuster dir -u https://portal.corp.local/app -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -c "session=eyJhbGciOiJIUzI1NiJ9..." -k -x json,xml -t 30Expected output:
/app/api/users (Status: 200) [Size: 4521]
/app/api/config (Status: 200) [Size: 891]
/app/admin/settings (Status: 200) [Size: 3210]
/app/debug (Status: 200) [Size: 156]What to do if it fails:
401 Unauthorizedon all → The session cookie has expired. Renew your session and update the cookie.- WAF blocks requests → Change User-Agent and reduce the rate. Try headers.
X-Forwarded-For: 127.0.0.1.
Timeline: 3-8 minutes with raft-medium wordlist.
Scenario 3: Subdomain enumeration on external target #
gobuster dns -d target.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-20000.txt -t 50Expected output:
Found: dev.target.com
Found: staging.target.com
Found: jenkins.target.com
Found: grafana.target.comWhat to do if it fails:
- Wildcard DNS active (all resolves) → Use
--wildcardfor automatic detection. If wildcard is confirmed, switch to tools likeffufwith response size filtering. - Few results → Change DNS resolver:
-r 8.8.8.8The default resolver may filter or cache.
Timeline: 20K subdomains at 50 threads: 1-2 minutes.
Toolchain Integration #
Gobuster is the link between web port discovery (Masscan/Nmap) and exploitation.
Operational flow:
Masscan (port scan) → Nmap (service ID) → Gobuster (content discovery) → Burp Suite / sqlmap / manual exploit
Data transfer:
# Da Nmap: estrai host con porta 80/443
grep "80/open\|443/open" nmap_scan.gnmap | awk '{print $2}' > web_hosts.txt
# Gobuster su ciascuno
while read host; do
gobuster dir -u "http://$host" -w common.txt -o "gobuster_$host.txt" -q
done < web_hosts.txt| Features | Gobuster | Dirsearch | fuf | DirBuster |
|---|---|---|---|---|
| Language | Go | Python | Go | Java |
| Swift | ★ ★ ★ ★ ★ | ★★★ ☆☆ | ★ ★ ★ ★ ★ | ★★☆☆☆ |
| Native recursion | No | Yes | No | Yes |
| DNS Mode | Yes | No | No | No |
| vhost mode | Yes | No | Yes | No |
| Advanced filtering | Base | Base | Advanced | Base |
| Machine maintenance | Attiva | Attiva | Attiva | Abandoned |
Attack Chain Complete #
Objective: Access a web server via an exposed backup file.
Phase 1 — Port Discovery (3 min)
sudo masscan 10.10.10.0/24 -p 80,443,8080,8443 --rate 1000You find 10.10.10.50 with port 80 and 8080 open.
Phase 2 — Content Discovery with Gobuster (8 min)
gobuster dir -u http://10.10.10.50 -w directory-list-2.3-medium.txt -x php,bak,zip,sql -t 50trovi /backup/site.zip (Status: 200).
Phase 3 — Backup Analysis (10 min)
Download the file. Inside you will find config.php with database credentials and a file .git/ with the history of the code.
Phase 4 — Exploitation (15 min)
The credentials in the backup grant access to the database. You find an SQL injection in the source code and exploit it to execute commands.
Phase 5 — Post-exploitation (20 min)
You install a Weevely3 web shell for persistence and start internal enumeration.
Total timeline: ~56 minutes.
Detection & Evasion #
What the Blue Team monitors #
- Abnormal HTTP request volume from a single IP (hundreds of 404s in a few seconds)
- WAF rules that match User-Agents of known scanners (Gobuster default:
gobuster/3.6) - Sequential pattern of requests to non-existent paths
Relevant logs #
- Apache/Nginx access log → hundreds of 404 entries from the same IP
- WAF log (ModSecurity, Cloudflare, AWS WAF) → directory traversal and file probing patterns
- SIEM → correlation between request volume and source IP
Evasion techniques #
- Legitimate User-Agent:
-a "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0". Removes the Gobuster fingerprint. - Voluntary rate limiting:
-t 5 --delay 500msKeep the volume below the detection threshold. - Source IP rotation: If possible, route traffic through multiple proxies to distribute requests across different IPs.
Cleanup #
Gobuster leaves no artifacts on the target. The only traces are entries in the web server logs.
Performance & Scaling #
Optimal threads: The default is 10. For robust targets, 50-100 threads work well. Above 100, you risk saturating the target or experiencing rate limiting.
Wordlist and times:
| Wordlist | Entry | Time (~50 threads) |
|---|---|---|
| common.txt | 4.727 | ~15 sec |
| directory-list-2.3-small.txt | 87.664 | ~ 3 min |
| directory-list-2.3-medium.txt | 220.560 | ~ 8 min |
| raft-large-directories.txt | 62.284 | ~ 2 min |
Extensions: Each extension added multiplies the number of requests. With -x php,txt,bak on common.txt: 4.727 × 4 = 18.908 requests.
Resource Consumption: Gobuster uses about 20-40MB of RAM and minimal CPU. The bottleneck is always the target's network or rate limiting.
Technical Tables #
Command Reference #
| Flag | Description |
|---|---|
dir | Bruteforce directory mode |
dns | Subdomain DNS mode |
vhost | Virtual host mode |
fuzz | Fuzzing mode |
-u URL | Target URL |
-w wordlist | Path to the wordlist |
-t N | Thread number |
-x ext1,ext2 | Extensions to look for |
-s codes | Status code to display |
-b codes | Status code to be excluded |
--exclude-length N | Exclude answers by size |
-c cookie | Session cookies |
-k | Ignore SSL errors |
-a agent | Custom User Agent |
-o file | Output to file |
-q | Quiet mode (no header) |
--delay duration | Delay between requests |
Recommended wordlists by scenario #
| Screenwriting | Wordlist | Entry | Note |
|---|---|---|---|
| quick scan | common.txt | 4.727 | First quick pass |
| In-depth scan | directory-list-2.3-medium.txt | 220.560 | Standards for CTF and pentests |
| API discovery | api-endpoints.txt | ~ 2.000 | Specific to REST API |
| Backup files | raft-large-files.txt | 37.042 | Search for residual files |
| Subdomain | subdomains-top1million-5000.txt | 5.000 | Quick subdomain enum |
Troubleshooting #
| Problem | Cause | Fix |
|---|---|---|
| All paths return 200 | custom 404 page | Usa --exclude-length with 404 page size |
| Too many false positives | Wildcard DNS or generic redirect | Identify the pattern and filter with -b o --exclude-length |
connection refused | Target unreachable or wrong port | Check connectivity: curl -I URL |
| Slow scan | Low threads or slow network | Increase thread: -t 50 |
Too many open files | Ulimit too low | ulimit -n 10000 before throwing |
| WAF blocks requests | Recognized User-Agent | Change with -a "Mozilla/..." |
FAQ #
Is Gobuster better than ffuf? It depends. Gobuster is simpler and includes native DNS/vhost modes. ffuf is more flexible for advanced fuzzing with fine-grained filtering. For basic brute-force directories, they are equivalent.
Which wordlist do I use for the first scan?
common.txt of SecLists. If you don't find anything, go down to directory-list-2.3-medium.txt.
Does Gobuster support recursion? No, it doesn't. Use Dirsearch if you need automatic recursion, or script the recursion with a bash wrapper.
Can I use Gobuster through a proxy?
Yup: gobuster dir -u URL -w wordlist --proxy socks5://127.0.0.1:1080Works with HTTP and SOCKS5 proxies.
How do I manage rate limiting?
Reduce thread (-t 5), add delay (--delay 500ms) and change the User-Agent. If the WAF is aggressive, use IP rotation via proxy chains.
Can Gobuster find GET parameters?
Not natively. Use the mode fuzz with FUZZ in the URL: gobuster fuzz -u http://target/page?FUZZ=test -w params.txt.
Cheat sheet #
| Action | Command |
|---|---|
| Quick scan dir | gobuster dir -u URL -w common.txt |
| Dir with extensions | gobuster dir -u URL -w wordlist -x php,txt,bak |
| Elevated Threads | gobuster dir -u URL -w wordlist -t 50 |
| With cookies | gobuster dir -u URL -w wordlist -c "session=..." |
| HTTPS no cert check | gobuster dir -u https://URL -w wordlist -k |
| Subdomain enum | gobuster dns -d domain.com -w subdomains.txt |
| Vhost discovery | gobuster vhost -u URL -w subdomains.txt --append-domain |
| Fuzzing | gobuster fuzz -u URL/FUZZ -w wordlist |
| Via proxy | gobuster dir -u URL -w wordlist --proxy socks5://127.0.0.1:1080 |
| Output to file | gobuster dir -u URL -w wordlist -o results.txt |
Disclaimer: Gobuster is an open-source security assessment tool. Using it on targets without authorization is illegal. Always obtain written permission before running scans. Repository: github.com/OJ/gobuster.
Want to support HackIta? Visit hackita.it/supporto to donate. For professional penetration testing and one-on-one training, check out hackita.it/servizi.








