GoBuster Cheat Sheet: Directory, DNS, and Virtual Host Enumeration

Modern enterprise attack surfaces are fluid and continually expanding. As organizations accelerate cloud migration, adopt containerized microservices, and deploy continuous integration pipelines, unlinked assets inevitably emerge. Orphaned administrative interfaces, exposed development endpoints, forgotten staging subdomains, and unprotected cloud storage containers represent primary avenues of entry for opportunistic adversaries. According to the MITRE ATT&CK framework, active scanning and wordlist-driven reconnaissance (Techniques T1595.002 and T1595.003) form the initial probing phase that precedes credential spraying and vulnerability exploitation.

+---------------------------------------------------------------------------------+
|                       ATTACK SURFACE ENUMERATION SPECTRUM                       |
|                                                                                 |
|   Target Domain        DNS Brute-Forcing (`dns`)      Virtual Hosts (`vhost`)   |
|   example.com   ===>  api.example.com          ===>   internal-admin.local      |
|                       dev.example.com                 staging-api.corp          |
|                              │                                │                 |
|                              ▼                                ▼                 |
|                     HTTP Route Discovery             Cloud Object Audit         |
|                     (`dir` / `fuzz`)                 (`s3` / `gcs`)             |
|                     /v1/api/keys                     s3://example-corp-backups  |
|                     /.env, /.git/HEAD                gs://example-data-exports  |
+---------------------------------------------------------------------------------+

GoBuster is an industry-standard, high-performance command-line enumeration utility written in Go. Unlike legacy Python- or Perl-based web scanners that execute synchronous or thread-bound HTTP requests, GoBuster leverages Go goroutines to deliver asynchronous, low-overhead network concurrency. This architectural advantage allows security practitioners and penetration testers to execute tens of thousands of targeted dictionary probes per minute.

However, high-throughput reconnaissance creates distinct operational trade-offs. Aggressive fuzzing can overwhelm un-cached application runtimes, saturate database connection pools, degrade production availability, and trigger automated intrusion prevention systems. This guide provides an authoritative reference and operational cheat sheet for GoBuster across directory, DNS, virtual host, and cloud storage enumeration modes, accompanied by architectural defensive countermeasures.


Architecture, Modes, and Global Flags

GoBuster separates discrete discovery workflows into dedicated subcommands. Each mode targets a specific layer of the network or application architecture while sharing a standardized core engine. The engine manages worker pools, custom HTTP transport pipelines, TLS renegotiation, and output formatters.

GoBuster Execution Modes

SubcommandLayer / ProtocolPrimary ObjectiveKey Flags
dirApplication (HTTP/S)Discovers hidden directories, unlinked API routes, and sensitive files.-u, -w, -x, -s, -b
dnsTransport (DNS 53)Enumerates valid subdomains and unlinked network records.-d, -w, -r, -c, -i
vhostApplication (HTTP/S)Discovers virtual hosts co-located on a shared reverse proxy or IP address.-u, -w, --append-domain
s3Cloud Storage (AWS)Probes public and unauthenticated Amazon S3 storage buckets.-w, --max-time
gcsCloud Storage (GCP)Probes Google Cloud Storage buckets for unauthenticated object listing.-w
tftpNetwork (UDP 69)Brute-forces TFTP server files across legacy networking infrastructure.-s, -w
fuzzApplication (HTTP/S)Replaces a custom keyword placeholder across URLs, headers, or request bodies.-u, -w, -m

Global Flags Reference

Global flags configure runtime concurrency, TLS behavior, and output formatting across all GoBuster execution modes:

OptionFlag AliasArgument TypeDefault ValueFunctional Description
--threads-tInteger10Specifies the number of concurrent worker goroutines.
--wordlist-wStringMandatorySets the absolute or relative filesystem path to the dictionary file.
--output-oStringStandard OutRedirects discovered items to an output file.
--no-tls-validation-kBooleanfalseSkips TLS/SSL certificate verification for self-signed endpoints.
--delayNoneDuration0msEnforces a deterministic sleep duration between requests per worker thread.
--timeoutNoneDuration10sMaximum allowable HTTP connection and read timeout.
--no-progress-zBooleanfalseSuppresses real-time console progress bars to conserve terminal buffer.
--quiet-qBooleanfalseSilences ASCII banners and diagnostic text, outputting findings only.
--verbose-vBooleanfalsePrints all probed candidates, including failed attempts and errors.

Curated Wordlist Strategies

Tool performance is inextricably linked to dictionary quality. Using generic, oversized wordlists wastes bandwidth and increases operational noise. Security teams should standardize on curated wordlist repositories such as Daniel Miessler's SecLists:

# Common web discovery wordlists (Debian / Kali SecLists package)
/usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
/usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt
/usr/share/seclists/Discovery/Web-Content/big.txt
/usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt
 
# Subdomain discovery wordlists
/usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt
/usr/share/seclists/Discovery/DNS/combined_subdomains.txt

Directory and File Discovery: The dir Mode

The dir subcommand is the most commonly employed GoBuster workflow. It performs path enumeration by combining a target base URL with dictionary entries, issuing HTTP GET or HEAD requests to observe returned status codes.

+---------------------------------------------------------------------------------+
|                       DIRECTORY DISCOVERY WORKFLOW (`dir`)                      |
|                                                                                 |
|   Target: https://api.corp.internal                                             |
|   Wordlist: [admin, backup, .env, v1]                                           |
|                                                                                 |
|   [Worker Pool (t=20)]  ───► GET /admin   ───► HTTP 403 Forbidden               |
|                         ───► GET /backup  ───► HTTP 301 Moved Permanently       |
|                         ───► GET /.env    ───► HTTP 200 OK  [High Risk Alert]   |
|                         ───► GET /v1      ───► HTTP 200 OK                      |
+---------------------------------------------------------------------------------+

Essential dir Flags

OptionFlag AliasValue ExampleDescription
--url-uhttps://target.corpThe base HTTP/HTTPS URL target for path appending.
--extensions-xphp,html,json,env,bakAppends extensions to every dictionary candidate.
--status-codes-s200,204,301,302,307,401Comma-separated HTTP response codes considered positive hits.
--status-codes-blacklist-b404,500Excludes specific HTTP status codes from terminal reporting.
--add-slash-fBooleanForces a trailing slash (/) at the end of each probed route.
--follow-redirect-rBooleanInstructs the HTTP client to follow 3xx redirect locations.
--headers-H"Authorization: Bearer <token>"Injects custom HTTP headers into each outgoing probe.
--user-agent-a"SecurityAudit/2.0"Overrides the default GoBuster User-Agent signature.
--cookies-c"session=dGhpczRpc2E..."Appends session cookies to simulate authenticated user tiers.
--exclude-lengthNone1204,2408Filters out responses whose HTTP body matches exact byte lengths.
--proxyNonehttp://127.0.0.1:8080Routes generated requests through an intercepting proxy.

Practical Directory Enumeration Recipes

1. Baseline Web Discovery

Executes a high-efficiency scan using 30 worker threads, capturing positive returns while skipping TLS verification:

gobuster dir \
  -u https://target.enterprise.local \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt \
  -t 30 \
  -k \
  -o gobuster_directories.txt

2. Sensitive Artifact and Backup File Hunting

Appends dangerous configuration and archive extensions to identify exposed environment variables, database dumps, and source archives:

gobuster dir \
  -u https://target.enterprise.local \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-files.txt \
  -x php,env,bak,old,zip,tar.gz,sql,json,txt \
  -s "200,204,301,302,307,401,403" \
  -b "404" \
  -t 25 \
  -k \
  -o sensitive_files_found.txt

3. Authenticated API Route Enumeration

Simulates an authenticated tenant by passing an authorization bearer token and custom API versioning headers:

gobuster dir \
  -u https://api.enterprise.local/v2 \
  -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5c..." \
  -H "X-Client-Version: 2.14.0" \
  -a "InternalSecurityAssessment-AuditTeam" \
  -t 20 \
  -o authenticated_api_routes.txt

4. Bypassing Custom Soft-404 Pages with Length Exclusion

Many modern single-page applications (SPAs) return an HTTP 200 OK containing an empty shell or a JavaScript-rendered "Page Not Found" screen for invalid routes. To avoid flooding reports with hundreds of false positives, isolate the length of the generic template and filter it:

# Determine the static body length of a non-existent URL
curl -sk https://target.enterprise.local/nonexistent-route-random-test | wc -c
# Output: 4892
 
# Run GoBuster while excluding the baseline soft-404 byte length
gobuster dir \
  -u https://target.enterprise.local \
  -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt \
  -b "404" \
  --exclude-length 4892 \
  -t 20 \
  -o clean_routes.txt

5. Stealth Throttling and Proxy Interception

When scanning rate-limited endpoints or routing traffic through Burp Suite for live inspection, enforce thread limits and per-request pacing:

gobuster dir \
  -u https://target.enterprise.local \
  -w /usr/share/seclists/Discovery/Web-Content/common.txt \
  --proxy http://127.0.0.1:8080 \
  --delay 250ms \
  -t 2 \
  -k

DNS and Subdomain Enumeration: The dns Mode

Active DNS enumeration identifies hostnames and infrastructure components that are not directly hyperlinked from a primary web page. While passive OSINT tools rely on Certificate Transparency logs and historical web archives, active DNS brute-forcing queries resolvers directly to discover pre-production clusters, internal portals, and unindexed services.

+---------------------------------------------------------------------------------+
|                         DNS ENUMERATION MECHANICS (`dns`)                       |
|                                                                                 |
|   Target Domain: enterprise.local                                               |
|   Resolver Pool: [1.1.1.1, 8.8.8.8, 9.9.9.9]                                    |
|                                                                                 |
|   [Query Engine] ───► A? mail.enterprise.local      ───► 198.51.100.10         |
|                  ───► A? vpn.enterprise.local       ───► 198.51.100.25         |
|                  ───► A? staging.enterprise.local   ───► CNAME app.azure.net    |
|                  ───► A? random-xyz-9821.local      ───► NXDOMAIN (Baseline)    |
+---------------------------------------------------------------------------------+

Essential dns Flags

OptionFlag AliasValue ExampleDescription
--domain-denterprise.localThe apex domain under targeted assessment.
--wordlist-wsubdomains-top1mil.txtDictionary of candidate subdomain prefixes.
--resolver-r1.1.1.1:53Custom DNS resolver IP address and port specification.
--show-cname-cBooleanDisplays Canonical Name (CNAME) target records alongside IP returns.
--show-ips-iBooleanPrints resolved IPv4/IPv6 address mappings for positive discoveries.
--wildcardNoneBooleanForces brute-forcing execution even if wildcard DNS is flagged.

Practical DNS Enumeration Recipes

1. Authoritative DNS Subdomain Scan

Queries public enterprise domains using explicit trusted recursive resolvers to bypass local ISP caching and query throttling:

gobuster dns \
  -d enterprise.local \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt \
  -r 1.1.1.1:53 \
  -i \
  -c \
  -t 50 \
  -o discovered_subdomains.txt

2. Investigating Subdomain Takeover Vectors

Displaying CNAME records is essential for identifying subdomain takeover risks. When an orphaned subdomain points to a decommissioned AWS S3 bucket, GitHub Pages endpoint, or Azure App Service, an adversary can register the downstream resource to hijack the domain:

gobuster dns \
  -d enterprise.local \
  -w /usr/share/seclists/Discovery/DNS/combined_subdomains.txt \
  -r 8.8.8.8:53 \
  -c \
  -t 40 \
  -o cname_audit.txt

3. Handling Wildcard DNS Configurations

Many enterprises deploy wildcard DNS entries (e.g., *.enterprise.local IN A 198.51.100.50). Under standard operation, a wildcard configuration causes every dictionary query to return a valid IP, rendering brute force useless. GoBuster detects wildcards by sending a randomly generated string (e.g., 3f7a8b19-wildcard-check.enterprise.local) before scanning. If the test resolves, GoBuster halts and alerts the user.

To proceed on wildcard-enabled domains, use --wildcard combined with strict output parsing:

gobuster dns \
  -d enterprise.local \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt \
  --wildcard \
  -r 1.1.1.1:53 \
  -i \
  -o wildcard_candidates.txt

Virtual Host and Fuzzing Operations: vhost and fuzz Modes

Modern web infrastructures rely heavily on shared IP architectures. Cloud load balancers, reverse proxies (Nginx, Traefik, Envoy), and ingress controllers host dozens of distinct microservices behind a single public IPv4 address. The edge proxy determines which backend service serves a request by examining the HTTP Host header.

Virtual Host Brute-Forcing (vhost)

If a developer provisions an internal administration panel or testing environment on a shared server without registering a public DNS entry, standard DNS enumeration will never discover it. The vhost mode addresses this visibility gap by sending HTTP requests directly to the server's IP address while dynamically swapping the Host header through a dictionary.

+---------------------------------------------------------------------------------+
|                        VIRTUAL HOST DISCOVERY (`vhost`)                         |
|                                                                                 |
|   Target IP: 198.51.100.80  (Reverse Proxy / Load Balancer)                    |
|                                                                                 |
|   GET / HTTP/1.1                                                                |
|   Host: public.corp.com      ───► HTTP 200 OK  [Public Landing Page]            |
|                                                                                 |
|   GET / HTTP/1.1                                                                |
|   Host: internal-git.corp.com ──► HTTP 200 OK  [Private GitLab Portal Found]   |
|                                                                                 |
|   GET / HTTP/1.1                                                                |
|   Host: non-existent.corp.com ──► HTTP 404 / Default Catch-All Page             |
+---------------------------------------------------------------------------------+

VHost Execution Command

gobuster vhost \
  -u https://198.51.100.80 \
  --domain enterprise.local \
  --append-domain \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt \
  --exclude-length 3120 \
  -k \
  -t 25 \
  -o discovered_vhosts.txt

In this command:

  • -u https://198.51.100.80 specifies the physical or virtual IP hosting the edge proxy.
  • --domain enterprise.local establishes the base root domain.
  • --append-domain dynamically combines dictionary words with the base domain (e.g., candidate dev becomes Host: dev.enterprise.local).
  • --exclude-length 3120 filters out default catch-all virtual host pages served when no hostname match is found.

Arbitrary Parameter and Route Fuzzing (fuzz)

The fuzz subcommand allows arbitrary substitution of the FUZZ placeholder across the request URI, query string parameters, or HTTP headers:

# API parameter fuzzing to uncover unlinked administrative functions
gobuster fuzz \
  -u "https://api.enterprise.local/v1/users?FUZZ=true" \
  -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt \
  -b "404,400" \
  -t 20 \
  -o discovered_parameters.txt
 
# REST route identifier fuzzing
gobuster fuzz \
  -u "https://api.enterprise.local/v2/tenants/1042/FUZZ" \
  -w /usr/share/seclists/Discovery/Web-Content/api/api-endpoints.txt \
  -s "200,201,403" \
  -t 15 \
  -o api_routes.txt

Cloud Object Storage Enumeration (s3)

Cloud infrastructure teams frequently create Amazon S3 buckets following predictable naming schemes. The s3 mode tests candidate bucket names against the public AWS S3 REST API to check bucket existence and identify open access permissions:

gobuster s3 \
  -w /usr/share/seclists/Discovery/Web-Content/common-bucket-prefixes.txt \
  -t 30 \
  -o open_s3_buckets.txt

Actionable Governance & Defensive Countermeasures

While GoBuster is an essential reconnaissance tool for security engineers, organizations must fortify internal assets to ensure automated brute forcing cannot discover critical infrastructure or exploit latent vulnerabilities. Defending against enumeration requires establishing architectural controls across web servers, reverse proxies, DNS configurations, and monitoring pipelines.

1. Reverse Proxy and Web Server Hardening

Web servers must be configured to prohibit information leakage, disable directory listings, and block direct requests for hidden files.

Nginx Hardening Baseline

# Enforce strict blocking of hidden files (.env, .git, .dockerignore)
location ~ /\.(?!well-known) {
    deny all;
    access_log off;
    log_not_found off;
    return 404;
}
 
# Prohibit access to backup, temporary, and configuration artifacts
location ~* \.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist|old)$ {
    deny all;
    access_log off;
    log_not_found off;
    return 404;
}
 
# Disable directory indexing globally
autoindex off;
 
# Rate-limit high-throughput directory enumeration bursts
limit_req_zone $binary_remote_addr zone=anti_fuzz:10m rate=10r/s;
location / {
    limit_req zone=anti_fuzz burst=20 nodelay;
    try_files $uri $uri/ /index.html;
}

Apache Web Server Baseline (.htaccess / httpd.conf)

# Disable directory listing
Options -Indexes
 
# Deny access to sensitive files and archives
<FilesMatch "(^#.*#|\.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op]|env)|~)$">
    Require all denied
</FilesMatch>

2. DNS Hygiene and Infrastructure Segregation

  1. Eliminate Non-Essential Wildcard DNS Records: Wildcards degrade external visibility, confuse defensive posture assessments, and create ambiguity across monitoring systems. Remove generic *.domain.com A/CNAME entries unless strictly necessitated by customer SaaS routing models.
  2. Implement Split-Horizon DNS: Internal development environments, testing APIs, and intranet resources must never exist in public authoritative DNS zones. Maintain separate private DNS zones (e.g., hosted within AWS Route 53 Private Zones or Azure Private DNS) accessible only over authenticated VPN or Zero Trust Network Access (ZTNA) overlays.
  3. Audit Dangling CNAMEs: Automate weekly scanning of all authoritative DNS records to confirm that cloud resources referenced in CNAME targets remain actively claimed and provisioned.

3. SIEM and SOC Detection Signatures

Security Operations Centers (SOCs) should deploy automated detection rules targeting brute-force reconnaissance patterns:

  1. User-Agent Fingerprinting: Default GoBuster executions transmit the User-Agent header gobuster/<version>. Flag or block this exact string immediately at the Web Application Firewall (WAF) perimeter.
  2. High-Frequency 404 Burst Detection: Alert when a single client IP generates more than 150 HTTP 404 responses within a rolling 60-second window.
  3. Randomized Hostname Probing: Monitor internal recursive resolvers for bursts of high-velocity NXDOMAIN responses, which signify active DNS dictionary scanning.

Governance Framework Alignment

FrameworkControl IdentifierControl RequirementOperational Implementation
ISO/IEC 27001:2022Control A.8.8Management of technical vulnerabilitiesExecute scheduled GoBuster directory and DNS discovery to identify exposed staging and backup files before adversaries exploit them.
ISO/IEC 27001:2022Control A.8.20Network securitySegregate internal and administrative portals from public network segments using split-horizon DNS and network access control.
ISO/IEC 27001:2022Control A.8.23Web filtering and segregationImplement web application firewalls and reverse proxy rules to filter out automated scanning tools.
NIST SP 800-53 Rev. 5CA-8Penetration TestingPerform automated and manual web fuzzing to validate access control boundaries on newly deployed endpoints.
NIST SP 800-53 Rev. 5SC-7Boundary ProtectionRestrict inbound external traffic to authorized public endpoints, denying unlinked administrative routes.
OWASP Top 10:2021A01:2021Broken Access ControlPrevent path traversal and administrative route bypasses through rigorous role-based access validation.
OWASP Top 10:2021A05:2021Security MisconfigurationDisable directory indexing, remove default files, and restrict configuration file access on production web servers.

Technical Remediation Checklist

  • Disable directory browsing (autoindex off) across all production and staging web servers.
  • Implement explicit web server deny rules for .env, .git, .bak, .sql, and temporary file extensions.
  • Deploy WAF rate limiting rules restricting single-IP request velocity across sensitive and authentication paths.
  • Restrict administration consoles and diagnostic endpoints to trusted private VPN/ZTNA IP ranges.
  • Clean up redundant wildcard DNS records across external authoritative name servers.
  • Audit external CNAME records for dangling third-party cloud resources to prevent subdomain takeovers.
  • Configure perimeter WAF alerts for default GoBuster User-Agent strings and anomalous 404 response spikes.
  • Schedule regular automated enumeration scans against organizational domains to detect shadow IT assets.

Strategic Summary

High-throughput reconnaissance tools like GoBuster demonstrate the speed and ease with which adversaries can map an enterprise attack surface. By harnessing Go's asynchronous concurrency model, security teams can evaluate their external perimeter with the same speed and rigor as motivated threat actors. Securing modern web applications requires treating surface discovery as a continuous engineering discipline rather than an annual audit exercise. By combining proactive path and DNS enumeration with hardened reverse proxy baselines, split-horizon DNS architecture, and automated behavioral monitoring, engineering teams can identify shadow IT assets and eliminate exposure before vulnerabilities are exploited.

Love it? Share this article: