Skip to content

Gobuster: Directory, DNS and Vhost Brute-Forcing

Gobuster explained: the dir, dns, vhost, s3 and gcs modes, the hidden directories and subdomains it finds, and how defenders detect and reduce it.

Mark KissBy , Founder & CEOUpdated 11 min read

External Network Penetration TestingFrom $4,200Fixed scope, free retest, no hourly billing.

Get my fixed price

Gobuster is a brute-forcing tool that finds things a website does not link to: hidden directories, forgotten files, live subdomains, and virtual hosts. It is one of the first tools a tester runs against a web target, because the fastest route to a breach is often a page the owner forgot was public.

We run it on most external and web engagements. Here is what it does, and, more usefully if you are the one being tested, what it means when it finds something.

The core idea

A website shows you what it links to. It does not show you what it forgot to remove. Gobuster takes a wordlist of common names, admin, backup, .git, config.php, staging, and requests each one, reporting which exist based on the server’s response. In minutes it maps the parts of your site no navigation menu points to. It is one of the standard penetration testing tools for that reason.

That gap (between what a site links and what it serves) is where a large share of real findings live.

Flow diagram of a Gobuster scan in six steps. The tool takes a wordlist of common names, requests each one and reports which exist from the server's response, which turns up admin panels, backup files, an exposed .git directory and forgotten subdomains. Defenders see a spike in 404s from one source in a short window, and rate-based WAF rules and rate limiting slow the scan and flag the source. The real fix is to remove what should not be public and keep an accurate asset inventory.

Gobuster is open source, written in Go, and actively maintained. As of November 2026 the latest release is v3.8.2 (published September 4, 2025), and the project’s README lists seven modes, covered below. On Kali Linux it installs with sudo apt install gobuster; anywhere else with Go 1.24 or later, go install github.com/OJ/gobuster/v3@latest.

The modes that matter

Gobuster works in several modes, each answering a different question:

  • dir: directory and file discovery. Requests paths from a wordlist against a target and reports what returns. This is where admin panels, backup files, exposed .git directories, and forgotten upload folders are found.
  • dns: subdomain discovery. Brute-forces hostnames against a domain (dev., staging., vpn., mail.) to map subdomains that are not published anywhere. Each live subdomain is more attack surface.
  • vhost: virtual host discovery. Finds sites served from the same IP under different Host headers, often an internal or staging application sharing infrastructure with the public site.
  • fuzz: general-purpose fuzzing of any part of a request, for parameters and values.
  • s3: Amazon S3 bucket enumeration, finding storage buckets that may be public.
  • gcs: Google Cloud Storage bucket enumeration, the same idea on GCP.
  • tftp: file enumeration against TFTP servers.

The two cloud storage modes are why the same tool shows up in cloud engagements, not only web tests: a public bucket named after the company is as much exposed attack surface as a forgotten directory. What an attacker can do once inside the account behind that bucket is the subject of cloud penetration testing.

A quick flag reference

The flags that turn up most often in real use map directly to the questions people search for:

Flag Mode What it does
-u dir, vhost, fuzz Target URL
-w all Wordlist file
-x dir File extensions to append (php, bak, zip)
-s dir Status codes to treat as a hit (for example 200,301,302)
-b dir Status codes to ignore; the default is 404
--exclude-length dir Ignore responses of a given body length
-t all Number of concurrent threads
--delay all Wait between requests, to stay under rate limits
--domain (-do) dns Target domain (-d in older releases)
--append-domain vhost Add the base domain to each wordlist entry

Gobuster commands: examples for dir, dns and vhost

These are the basic forms from the project’s README, with example.com standing in for a host you own or are authorized to test:

gobuster dir -u https://example.com -w /path/to/wordlist.txt
gobuster dir -u https://example.com -w /path/to/wordlist.txt -x php,bak
gobuster dns -do example.com -w /path/to/wordlist.txt
gobuster vhost -u https://example.com --append-domain -w wordlist.txt
  • gobuster dir -u is the mode that discovers directories and files, not subdomains. -u is the target URL and -w the wordlist. Each hit prints the path, the HTTP status and the response size, in the form /admin (Status: 301) [Size: 178].
  • -x php,bak repeats every word with each extension, so config is also tried as config.php and config.bak. Two extensions triple the number of requests.
  • gobuster dns -do resolves each word as a subdomain of the domain and prints the names that exist.
  • gobuster vhost sends each word in the Host header to one server. --append-domain turns staging into staging.example.com.

A 301 usually means a directory exists and the server is redirecting to the version with a trailing slash. A 403 means the path exists and access is refused, which is still worth a look: forbidden is not the same as absent.

Choosing a wordlist for Gobuster

Gobuster only finds names that are in its wordlist, so the list decides the result more than any flag. The project’s README points to SecLists, a public collection of lists for security testing that includes sets for web content and for DNS names. A short list of common names finishes in seconds and catches the obvious: admin, backup, .git. A list of hundreds of thousands of words finds more and sends that many more requests, which costs time and makes more noise in your logs. Good testers also build a small custom list from the target itself: product names, project code names and words from the site’s own pages.

Filtering results: status codes, length and wildcards

Raw output is often full of false hits, and three behaviors explain most of them:

  • Status codes. By default dir mode ignores 404 and reports everything else. Use -s to report only chosen codes, or -b to ignore more of them.
  • Response length. Some sites answer every unknown path with a 200 and a friendly “not found” page. Those pages are usually the same size, so --exclude-length with that size removes them.
  • Wildcards. A server that answers every path the same way, or a DNS zone with a wildcard record that resolves every name, makes every word look like a hit. Gobuster checks for this before it starts and stops with a warning. In dns mode, --wildcard forces it to continue.

For defenders the lesson runs the other way: a site that returns a clean 404 for unknown paths is easy to map, and a catch-all page does not hide anything from a tester who filters by length.

Gobuster vs ffuf vs feroxbuster

Gobuster is not the only content-discovery tool, and testers pick by the job:

Gobuster ffuf feroxbuster
Written in Go Go Rust
Strength Fast, simple, DNS and cloud modes Flexible FUZZ placement anywhere in a request Automatic recursion into found directories
Best for Directory, subdomain and bucket sweeps Parameter and header fuzzing Deep recursive directory discovery

They overlap heavily. The choice rarely changes what gets found; it changes how quickly, which is why many testers keep more than one (our ffuf explainer covers ffuf’s filtering and how to spot a run in your logs).

What its findings actually mean

When a report says “discovered via Gobuster,” the finding is one of a familiar set, and each maps to a concrete fix:

  • An exposed .git directory: the entire source code of the application, often including credentials in commit history, downloadable by anyone. This is a critical finding and more common than it should be.
  • Backup files: config.php.bak, database.sql, site.zip, source and data sitting in the web root.
  • An admin panel or staging environment reachable from the internet, frequently with weaker authentication than production.
  • Forgotten subdomains: an abandoned old. or test. host running unpatched software, providing an easier way in than the hardened main site.
  • Directory listing enabled, exposing files never meant to be browsed.

The theme is consistent: none of these are exotic vulnerabilities. They are things that exist, are reachable, and were never meant to be public. Attackers find them with exactly this tool, which is why testers do too.

Why subdomain discovery matters more than it looks

Your security effort concentrates on the main application. But an attacker targets the weakest reachable asset, and that is rarely the main site. It is the forgotten staging. box, the marketing microsite on an unpatched CMS, the old vpn. endpoint. Subdomain enumeration is how that weakest asset is found, and why external network penetration testing always begins with mapping the full footprint rather than only the assets you volunteered. Keeping that footprint mapped over time is the job of external attack surface management.

How defenders detect and reduce it

Gobuster is loud. A single source requesting thousands of non-existent paths in seconds is an obvious signature:

  • A spike in 404s from one source in a short window, the clearest indicator, visible in any web-server log or WAF.
  • Rate-based WAF rules and simple rate limiting slow it dramatically and flag the source.
  • The default user agent. Unless the operator changes it, Gobuster identifies itself as gobuster/ followed by its version, so a default run leaves access-log lines like "GET /backup.zip HTTP/1.1" 404 153 "-" "gobuster/3.8.2". The header is easy to change, so treat it as a quick win for spotting careless scans, not as a control.

But detection is the second line. The real fix is reducing what there is to find:

  1. Remove what should not be public: backup files, .git directories, and staging environments do not belong on internet-facing servers.
  2. Disable directory listing.
  3. Authenticate or firewall non-production subdomains so staging. and dev. are not reachable from the open internet.
  4. Maintain an accurate asset inventory: you cannot protect the subdomain you forgot exists.

How we use it in an engagement

Gobuster belongs to the reconnaissance phase of a penetration test, the mapping that happens before any exploitation. In a web application penetration test it finds the hidden application surface; in an external network test its DNS mode maps the full footprint of internet-facing assets. It finds nothing by itself. It tells the tester where to look, and where to look is usually the whole game.

We run discovery only against the hosts and domains in the signed scope, at a request rate agreed up front so production traffic is not disrupted. Our external tests always include discovery of unlisted subdomains and buckets that belong to the in-scope domains, so a forgotten staging host or public bucket is part of the result. We confirm anything newly found with you before testing it, and anything critical is raised with your contact during the test rather than held for the report, which then explains why it was reachable and how to remove it. The published starting prices for both tests are on the web application testing price page and the external testing price page.

Frequently asked questions

What is Gobuster used for? Finding content a website does not link to: hidden directories and files (dir), live subdomains (dns), virtual hosts (vhost), and public cloud storage buckets (s3, gcs). Testers use it to map attack surface; defenders should run it against their own estate to find the same things first.

Is Gobuster legal to use? Only against systems you own or have written authorization to test. Scanning someone else’s site without permission can breach computer misuse laws and the host’s terms. Every scan in a penetration test sits inside a signed scope and rules of engagement.

How do I tell it is being run against me? A spike in 404 responses from one source in a short window, visible in any web-server log or WAF. That signature is the clearest sign of directory brute-forcing.

Which Gobuster mode is used to find directories instead of subdomains? dir. The command starts gobuster dir -u followed by the URL and -w followed by the wordlist. Subdomains are the job of dns mode, and virtual hosts of vhost mode.

What does the -x flag do in Gobuster? In dir mode, -x adds file extensions to every word in the list. -x php,bak tries name, name.php and name.bak, which is how backup and source files are found.

What wordlist should I use with Gobuster? Start with a short common-names list from SecLists, then move to a larger one if the first pass is quiet. Add words taken from the target’s own site. A bigger list finds more and takes longer.

Can Gobuster be run online without installing it? There is no official hosted version. Gobuster is a command-line program you run yourself, installed from the Kali Linux package, with Go, or from the project’s Docker image, and only against systems you are authorized to test.

The short version

Gobuster discovers the directories, files, and subdomains your site does not advertise, which is precisely where forgotten and exposed things live. Its findings are rarely subtle: exposed source code, backup files, unauthenticated admin panels, abandoned subdomains. The defense is not detecting the scan but removing what the scan finds, and keeping an inventory accurate enough that nothing is forgotten in the first place.

Curious what a brute-force of your external footprint would turn up? That discovery is the opening move of every external penetration test we run. Scope one here.

Mark Kiss

Written by

Mark Kiss, Founder & CEO

15+ years in the field. Focus: Offensive security & strategy. Part of the team that scopes, tests, and reports for our clients. Full profile →

All articlesRed Teaming

Find out what an attacker sees.

Tell us what to test and see your fixed price.

Prefer the full scoping questionnaire? 
Start the conversation

Get a quick proposal

We are online