**Ethical Use & Legal Disclaimer: Only use Gobuster on systems you own or have explicit, written permission to test.** Unauthorized scanning of websites, servers, or networks is illegal in most countries and can result in severe legal consequences, including criminal charges. It is also a violation of ethical hacking principles. Always operate within a legal framework, such as a documented penetration test or a bug bounty program with a clear scope. For guidelines on ethical practices, consult responsible disclosure policies from platforms like [HackerOne](https://www.hackerone.com/policies/responsible-disclosure) or [Bugcrowd](https://www.bugcrowd.com/resource/vulnerability-disclosure-policy/).

Gobuster Tool

1. Introduction

1.1. What is Gobuster?

Gobuster is a command-line tool written in the Go programming language, designed for security reconnaissance. Reconnaissance is the initial phase of a security audit or penetration test, focused on gathering information about a target system. Gobuster automates the discovery of hidden or non-obvious resources on web servers and related infrastructure.

1.2. What Problem Does It Solve?

Web applications often consist of more than just the pages visible to a user. Servers can contain a wide range of resources that are not linked from the main website but are accessible if you know their exact name and location. These can include:

  • Administrative control panels (e.g., /admin, /dashboard).
  • Leftover backup files or source code (e.g., /backup.zip, /index.php.old).
  • API endpoints (e.g., /api/v2/users).
  • Configuration files (/web.config).
  • Hidden directories used for file uploads or temporary storage.

Manually guessing the names of these resources is impractical. Gobuster solves this problem by performing brute-force enumeration: it systematically tries a list of potential names to see if the server responds positively, thereby uncovering hidden content and potential attack surfaces.

1.3. High-Level Overview of its Primary Modes of Operation

Gobuster’s functionality is separated into distinct modules, or “modes,” each tailored for a specific type of enumeration:

  • dir: The most frequently used mode. It enumerates Uniform Resource Identifiers (URIs), which includes directories and files on a web server.
  • dns: Enumerates subdomains for a given domain by querying Domain Name System (DNS) servers.
  • vhost: Enumerates virtual hostnames on a target web server. This is used to find different websites hosted on the same IP address.
  • s3: Enumerates publicly accessible Amazon Web Services (AWS) S3 buckets.
  • gcs: Enumerates publicly accessible Google Cloud Storage (GCS) buckets.
  • tftp: Enumerates files on a Trivial File Transfer Protocol (TFTP) server.

2. Installation

Gobuster is included by default in recent versions of Kali Linux. These steps show how to verify its installation and install it if it is missing.

2.1. Verify the Installation

First, check if the tool is already installed and accessible in your system’s PATH.

# The '--help' flag is a standard argument for command-line tools that requests
# the program to print a summary of its usage, modes, and options. If Gobuster
# is installed, this command will display its help text. If not, the shell
# will return an error, typically "command not found".
$ gobuster --help

2.2. Install Gobuster on Kali Linux

If the previous command resulted in an error, you must install Gobuster using the apt package manager.

# Update the package database
$ sudo apt update

# Install Gobuster
$ sudo apt install -y gobuster

After installation, run gobuster --help again to confirm it is working correctly.

3. Key Concepts & Terminology

Understanding these technical concepts is crucial for using Gobuster effectively.

3.1. Brute-Force Enumeration

This is an automated, systematic process of discovering valid resources by attempting a large number of possibilities. In the context of Gobuster’s dir mode, it involves taking a list of potential directory or file names, prepending the target URL to each, sending an HTTP request for each constructed URL, and analyzing the server’s HTTP response code to determine if the resource exists.

3.2. Wordlists: Installation and Location

A wordlist is a plain text file where each line contains a potential name (e.g., admin, login, test) to be used in the brute-force process. The effectiveness of an enumeration attack is directly proportional to the quality and relevance of the wordlist used. Kali Linux provides numerous wordlists in /usr/share/wordlists/. The seclists collection is particularly comprehensive.

On a fresh Kali Linux installation, the /usr/share/wordlists/ directory might be typically empty or not present. To populate it with the necessary wordlists, you need to install specific packages that provide these lists.

Step 1: Update Your Package Index (Best Practice)

Before installing any new software, it’s a good practice to synchronize your local package database with the Kali repositories. This ensures you are installing the correct and most recent versions of the packages.

# 'sudo' grants administrative privileges for the command.
# 'apt update' refreshes the list of available packages and their versions.
$ sudo apt update

Step 2: Install the Essential Wordlist Packages

Below are the commands to install the most commonly used and recommended wordlists for security testing. Kindly note that below commands are installing the tools that come with their own wordlists, which are then linked to the central /usr/share/wordlists/ directory via symbolic links. You may install the wordlists packages only from github or other sources.

2.1. The Modern Standard: SecLists

SecLists is the most comprehensive and widely used collection of wordlists. It includes thousands of specialized lists for tasks such as directory enumeration, fuzzing, password cracking, and more. If you install only one wordlist package, make it this one.

# This command installs the SecLists collection.
$ sudo apt install -y seclists

Location: The wordlists are installed in /usr/share/seclists/. For directory enumeration with tools like Gobuster, the most relevant lists are found in /usr/share/seclists/Discovery/.

2.2. The Classic Tool-Specific Wordlists

Some classic tools, such as Dirb, Dirbuster, and Dnsmap, come with their own wordlists. Installing these tools will also install their respective wordlists, which are then linked to the central /usr/share/wordlists/ directory via symbolic links.

# This command installs Dirb, Dirbuster, and Dnsmap along with their wordlists.
$ sudo apt install -y dirb dirbuster dnsmap

How Symbolic Links Work:

  • After installation, symbolic links (shortcuts) are created in /usr/share/wordlists/ that point to the actual wordlist files located in the tools’ installation directories.
  • For example, the symbolic link /usr/share/wordlists/dirb points to /usr/share/dirb/wordlists, where the actual wordlists for Dirb are stored.
  • This setup allows you to easily access all wordlists from a central location.
2.3. The Famous Password List: rockyou.txt

The rockyou.txt wordlist is one of the most famous password lists, containing millions of real-world passwords. It is widely used for password cracking and is included in the wordlists package. The file is compressed (.gz) to save space and must be decompressed before use.

# The 'wordlists' package provides the rockyou.txt wordlist.
$ sudo apt install -y wordlists

Location: The compressed file is installed at /usr/share/wordlists/rockyou.txt.gz.

How to Decompress rockyou.txt.gz:

  • Use the gunzip command to decompress the file.
  • After decompression, the file will be available as /usr/share/wordlists/rockyou.txt.
# 'gunzip' decompresses the .gz file.
# 'sudo' is used because the file is in a system directory.
$ sudo gunzip /usr/share/wordlists/rockyou.txt.gz

Step 3: Install All Essential Wordlists in One Go

To streamline the process, you can install all the recommended wordlist packages and decompress rockyou.txt with the following commands:

# First, update the package list.
$ sudo apt update

# Install all essential wordlist packages.
$ sudo apt install -y seclists dirb dirbuster dnsmap wordlists

# Decompress the rockyou.txt wordlist.
$ sudo gunzip /usr/share/wordlists/rockyou.txt.gz

Step 4: Verify the Installation

After installation, you can verify that the wordlists are correctly installed and linked by listing the contents of the central wordlist directory.

# The '-l' flag provides a detailed listing, showing symbolic links.
$ ls -l /usr/share/wordlists/
  • The output will display symbolic links for wordlists from tools like Dirb, Dirbuster, and Dnsmap, confirming that they are accessible from the central directory.
  • Additionally, the decompressed rockyou.txt should be present in /usr/share/wordlists/.

Summary of Wordlist Packages and Locations

WordlistInstallation CommandPrimary Location of Files or Links
SecLists Collection (Recommended)sudo apt install -y seclists/usr/share/seclists/
Dirb wordlistssudo apt install -y dirbLink at /usr/share/wordlists/dirb
Dirbuster wordlistssudo apt install -y dirbusterLink at /usr/share/wordlists/dirbuster
Dnsmap wordlistsudo apt install -y dnsmapLink at /usr/share/wordlists/dnsmap.txt
rockyou.txt password listsudo apt install -y wordlists/usr/share/wordlists/rockyou.txt (after decompression)

With these steps, you now have the essential wordlists installed and ready for use in your security testing workflows on Kali Linux.

3.3. HTTP Protocol, Requests, and Responses

The Hypertext Transfer Protocol (HTTP) is the foundation of data communication on the World Wide Web. It is a client-server protocol where a client (like your browser or Gobuster) sends a request to a server, and the server sends back a response.

  • HTTP Request: A request constructed by Gobuster typically includes a method (e.g., GET) and a Request-URI (e.g., /admin.php).
  • HTTP Response: The server’s reply contains a Status Code, which is a three-digit number indicating the outcome of the request.

3.4. HTTP Status Codes

These codes are critical for interpreting Gobuster’s results.

  • 200 OK: The request succeeded, and the resource (e.g., a file’s content) was found and returned.
  • 301 Moved Permanently / 302 Found: The resource has been moved. This is a common response for a directory URI that is missing its trailing slash (e.g., requesting /admin when the server expects /admin/). This is a positive finding.
  • 401 Unauthorized: The resource exists but requires authentication credentials. This is a significant discovery, as it confirms a protected area.
  • 403 Forbidden: The resource exists, but the server is explicitly denying access. This is still a valuable find, as it confirms the resource’s existence.
  • 404 Not Found: The requested resource does not exist on the server. This is the expected response for an incorrect guess.

3.5. Subdomain

Within the Domain Name System (DNS), a subdomain is a domain that is part of a larger primary domain. For example, in mail.google.com, mail is the subdomain of the google.com domain. Organizations use subdomains to segment services, environments (e.g., dev.example.com), or geographic locations.

3.6. Virtual Host (VHost)

A virtual host is a configuration on a web server that allows it to host multiple distinct websites on a single IP address. When a request arrives, the server inspects the Host header in the HTTP request to determine which website’s content to serve. Gobuster’s vhost mode brute-forces this Host header value to discover other sites co-located on the same server.

3.7. Concurrency and Threads

A thread is the smallest sequence of programmed instructions that can be managed independently by an operating system’s scheduler. Gobuster leverages concurrency by using multiple threads (or, more accurately, Go’s lightweight equivalents called “goroutines”) to send many HTTP requests simultaneously. This parallel execution dramatically reduces the time required to complete a scan compared to a sequential approach (one request at a time).

4. Basic Usage & Syntax

4.1. General Syntax

The fundamental structure of a Gobuster command is modular and follows a simple pattern:

$ gobuster <mode> [options]
  • gobuster: The executable name of the tool.
  • <mode>: Required. This is the first argument and defines the primary function you want to perform. You must choose one from dir, dns, vhost, fuzz, s3, gcs, or tftp.
  • [options]: These are the flags that configure the behavior of the chosen mode. While they vary between modes, nearly all modes require a target (e.g., -u for a URL) and a wordlist (-w).

4.2. Getting Help

Gobuster’s built-in help is your best friend. Before trying to memorize every flag, learn how to ask the tool for guidance.

To see all available modes:

$ gobuster help

To see all options for a specific mode (e.g., dir):

$ gobuster help dir

5. How It Works Under the Hood

Understanding Gobuster’s internal mechanics is key to using it effectively and troubleshooting problems. At its core, it operates on a highly efficient, concurrent model.

  • Initialization and Configuration: When you execute a command, Gobuster first parses all the flags and arguments. It validates the inputs (e.g., Does the wordlist file exist? Is the URL format correct?) and builds an internal configuration object for the scan.
  • The Producer-Consumer Model: To achieve high speed, Gobuster doesn’t process one guess at a time. It uses a classic “producer-consumer” design pattern, implemented with Go’s lightweight concurrency primitives called goroutines and channels.
    • The Producer: A single goroutine (the producer) is responsible for one job: reading your wordlist (-w) line by line. It takes each word and places it into a channel, which is a thread-safe queue.
    • The Consumers (Workers): Gobuster creates a pool of worker goroutines. The number of workers is set by the -t (threads) flag. These workers all watch the same channel. As soon as a word is placed in the channel, a free worker grabs it.
  • Request Generation and Dispatch: Once a worker has a word from the wordlist, it constructs the full request based on the mode:
    • dir mode: It concatenates the base URL with the word (e.g., http://target.com/ + admin). If extensions (-x) are specified, it generates additional requests for each (e.g., http://target.com/admin.php).
    • dns mode: It prepends the word to the domain (e.g., api + .target.com) and creates a DNS query for that FQDN (Fully Qualified Domain Name).
    • vhost mode: It creates an HTTP request to the target IP/URL but sets the Host header to the word from the wordlist.
  • Response Handling and Analysis: The worker sends the request and waits for a response.
    • Timeout Management: If the server doesn’t respond within the specified --timeout duration, the request is marked as timed out. If --retry is enabled, the worker will re-queue the request up to --retry-attempts times.
    • Filtering: When a response is received, the worker analyzes it against the rules you provided. In dir mode, this means checking the HTTP status code against the -s (allowed codes) and -b (blacklisted codes) lists. It also checks against other filters like --exclude-length.
  • Output and Loop: If the response is deemed “interesting” (i.e., it passes all filters), the worker formats the result and prints it to your console or the file specified with -o. The worker is now free and immediately returns to the channel to grab the next word. This entire process continues at high speed until the producer has read the entire wordlist and the workers have processed every item in the channel.

6. Gobuster Modes: An In-Depth Guide

This section explores multiples modes in details and providing practical, real-world examples.

6.1. dir Mode: Directory & File Enumeration

This is the quintessential Gobuster mode, used to find hidden content on web servers.

6.1.1. dir Mode Options Explained

FlagIn-Depth Explanation
-u, --url stringRequired. The full target URL, including the protocol (http:// or https://). If you are targeting a subdirectory, include it (e.g., http://example.com/api/).
-w, --wordlist stringRequired. The path to your wordlist. Each line in this file will be tested as a path against the target URL.
-x, --extensions stringAppends extensions to each word. For a word admin and -x php,js, it tests /admin, /admin.php, and /admin.js. This is critical for finding executable files, backups, and includes.
-t, --threads intThe number of concurrent workers (default: 10). A higher number (e.g., 50, 100) increases speed but also load on the target server and can lead to IP blocking or timeouts.
-s, --status-codes stringComma-separated list of HTTP status codes to show as positive results. The default (200,204,301,302,307,401,403,405) is excellent, as it includes OK, Redirects, Forbidden, and Unauthorized.
-b, --status-codes-blacklist stringComma-separated list of status codes to hide, even if they are in the positive list. This is useful for noisy servers. For example, if a server returns 401 Unauthorized for everything, you might use -b 401.
--exclude-length intsExcludes responses with specific content lengths. This is the primary weapon against “soft 404s” where a server returns 200 OK for a “Not Found” page. Find the size of the fake page and exclude it.
-o, --output stringSaves the output to a file. Essential for long scans so you don’t lose results if your terminal closes.
-c, --cookies stringSends a cookie with every request. Used to maintain an authenticated session. Get this from your browser’s developer tools after logging into the target site. (e.g., -c 'session=abcdef123').
-H, --headers stringArraySends custom HTTP headers. Can be supplied multiple times. Useful for setting Authorization: Bearer ... tokens, custom User-Agent strings, or X-Forwarded-For headers to bypass IP blocks.
-a, --useragent stringA shortcut to set the User-Agent header. Some servers block default tool user agents.
--random-agentUses a random User-Agent from a pre-compiled list for each request to avoid simple blocking rules.
-k, --no-tls-validationSkips SSL/TLS certificate validation. Essential for testing servers with self-signed or expired certificates, common in internal development environments.
-r, --follow-redirectIf a found resource is a redirect (e.g., 301, 302), this flag tells Gobuster to follow it and report the final destination’s status code and URL.
--proxy stringRoutes all traffic through a proxy like Burp Suite or ZAP (http://127.0.0.1:8080). This allows you to see all of Gobuster’s requests and responses for deeper analysis.
-U, --username string / -P, --password stringCredentials for HTTP Basic Authentication.
-f, --add-slashForces a / to be appended to each request. This can sometimes bypass access controls that are poorly configured to only look for directory names without a trailing slash.
-e, --expandedPrints the full URL for each find, not just the path. Useful for creating clickable links or for scripting.

6.1.2. dir Mode Scenarios and Examples

Scenario 1: Basic Recon on a New Target

You want a quick overview of a web server’s structure.

# Use a small, common wordlist with a moderate number of threads.
# Look for common file types like php, html, and txt.
$ gobuster dir -u http://10.10.11.123 -w /usr/share/seclists/Discovery/Web-Content/common.txt -t 30 -x php,html,txt

Scenario 2: Authenticated Scan of a Web Application

You are testing a portal that requires a login.

# 1. Log in with your browser.
# 2. Open Developer Tools (F12) -> Application -> Cookies.
# 3. Copy the value of the session cookie (e.g., 'sessionID').
# 4. Run Gobuster with the cookie.
$ gobuster dir -u https://portal.corp.com/dashboard -w /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt -c 'sessionID=a1b2c3d4e5f6' -k -t 25

Scenario 3: Dealing with a “Soft 404”

The server returns 200 OK for every request, but the “Not Found” pages all have a size of 1450 bytes.

# Use --exclude-length to filter out the noise and reveal the true findings.
$ gobuster dir -u http://noisy-server.com -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -x aspx --exclude-length 1450

6.2. dns Mode: Subdomain Enumeration

6.2.1. dns Mode Options Explained

FlagIn-Depth Explanation
-d, --domain stringRequired. The target root domain you want to find subdomains for (e.g., example.com).
-w, --wordlist stringRequired. A wordlist containing potential subdomain prefixes (e.g., api, dev, www, test).
-i, --show-ipsFor each found subdomain, also show its resolved IP address(es) (both IPv4 and IPv6). This is useful for mapping the target’s infrastructure.
-c, --show-cnameShows the Canonical Name (CNAME) record if one exists. A CNAME is an alias for another domain. This can reveal if a subdomain points to a third-party service (e.g., store.example.com might have a CNAME of shops.shopify.com). Cannot be used with -i.
-r, --resolver stringSpecifies a custom DNS server to send queries to. Useful for bypassing local DNS filters or for testing a specific internal DNS server. Can be an IP (8.8.8.8) or IP with port (8.8.8.8:53).
--wildcardA wildcard DNS record (*.example.com) makes every possible subdomain resolve to an IP. Gobuster detects this and stops. This flag forces it to continue, which is useful only if you suspect some real subdomains might respond differently.

6.2.2. dns Mode Scenarios and Examples

Scenario 1: Standard Subdomain Discovery

# Find subdomains for a target and show their IP addresses to map out their servers.
# Use a high-quality, large subdomain wordlist.
$ gobuster dns -d megacorp.com -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -t 50 -i -o megacorp_subdomains.txt

Scenario 2: Testing an Internal DNS Server

You are on an internal network and want to see what hostnames the company’s own DNS server (192.168.1.5) knows about.

$ gobuster dns -d internal.corp -w /usr/share/seclists/Discovery/DNS/namelist.txt -r 192.168.1.5 -i

6.3. vhost Mode: Virtual Host Enumeration

6.3.1. vhost Mode Options Explained

FlagIn-Depth Explanation
-u, --url stringRequired. The target URL. This should be the IP address of the server or a known domain that resolves to it. Gobuster sends all requests here.
-w, --wordlist stringRequired. A wordlist of potential hostnames. These are the values that will be placed in the Host header of each request.
--append-domainA convenience flag. If your wordlist contains prefixes like dev and test, and your URL is -u http://example.com, this flag will automatically test dev.example.com and test.example.com without you having to generate a full wordlist.
…plus many dir mode flagsvhost mode shares many options with dir mode, such as -c (cookies), -H (headers), -k (no-tls-validation), and --proxy.

6.3.2. vhost Mode Scenarios and Examples

Scenario: Finding Hidden Sites on a Shared Host

You are testing http://10.20.30.40, which shows a default Apache page. You suspect other websites are hosted on this IP.

# Use a wordlist containing potential hostnames.
# The request goes to 10.20.30.40, but the Host header will be changed for each word.
$ gobuster vhost -u http://10.20.30.40 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -t 40

Output Interpretation: Gobuster establishes a baseline by making a request with a random Host header. It then reports any hostname that returns a different status code or content length, indicating a distinct virtual host.

6.4. fuzz Mode: Flexible Fuzzing

The fuzz mode in Gobuster offers unparalleled flexibility for brute-forcing various parts of an HTTP request. Unlike dir mode, which focuses solely on URL paths, fuzz mode allows you to place the keyword “FUZZ” anywhere in the URL, headers, or POST data. Gobuster then replaces “FUZZ” with each entry from your wordlist, enabling you to test API endpoints, parameters, headers, or any other request component. This makes it ideal for scenarios where you need to explore beyond traditional directory enumeration, such as testing for valid user IDs, hidden API keys, or header-based vulnerabilities.

6.4.1. fuzz Mode Options Explained

FlagIn-Depth Explanation
-u, --url stringRequired. The target URL, where you can insert the “FUZZ” keyword in any part (e.g., path, query parameters, or hostname). For example, http://example.com/users/FUZZ or http://example.com?id=FUZZ.
-w, --wordlist stringRequired. The path to your wordlist, containing the values that will replace “FUZZ” in each request.
-H, --headers stringArraySpecifies custom headers, and you can place “FUZZ” within the header values (e.g., -H "X-API-Key: FUZZ"). Multiple headers can be specified.
-m, --method stringSets the HTTP method (e.g., GET, POST, PUT). When using POST, combine with -d to include “FUZZ” in the POST data.
-d, --data stringDefines the POST data for methods like POST, where “FUZZ” can be placed (e.g., -d "username=FUZZ&password=test").
…plus global optionsSupports options like -t (threads), -o (output), -v (verbose), --exclude-length (to filter responses by size), and more from the global pool.

6.4.2. fuzz Mode Scenarios and Examples

Scenario 1: Fuzzing a URL Parameter

You’re testing an API endpoint (http://api.example.com/v1/users?id=1) and want to brute-force the id parameter to discover valid user IDs.

$ gobuster fuzz -u "http://api.example.com/v1/users?id=FUZZ" -w /usr/share/seclists/Discovery/Web-Content/numbers.txt -t 20
  • Explanation: The “FUZZ” keyword is placed in the id query parameter. Gobuster replaces it with each entry from numbers.txt (e.g., 1, 2, 3), sending requests like http://api.example.com/v1/users?id=1. The -t 20 flag speeds up the scan with 20 threads.

Scenario 2: Fuzzing a Custom Header

You suspect a server checks a custom header (X-API-Key) for authentication and want to test possible values.

$ gobuster fuzz -u "http://target.com" -H "X-API-Key: FUZZ" -w /path/to/api-keys.txt
  • Explanation: “FUZZ” is placed in the header value. Gobuster sends requests with different X-API-Key values (e.g., X-API-Key: key1, X-API-Key: key2), helping you identify valid keys or detect header-based vulnerabilities.

Scenario 3: Fuzzing POST Data

You’re targeting a login form and want to brute-force usernames while keeping the password constant.

$ gobuster fuzz -u "http://target.com/login" -m POST -d "username=FUZZ&password=constant" -w /usr/share/seclists/Usernames/common-usernames.txt
  • Explanation: The -m POST sets the method to POST, and -d defines the data with “FUZZ” in the username field. Gobuster tests combinations like username=admin&password=constant, allowing you to pinpoint valid usernames.

Additional Tips:

  • Multiple FUZZ Keywords: You can use “FUZZ” multiple times (e.g., -u "http://target.com/FUZZ" -H "Key: FUZZ"), but this requires advanced wordlist handling (e.g., multiple wordlists with -w and --wordlist-second).
  • Filtering: Use --exclude-length to ignore uninteresting responses (e.g., generic error pages) and -v for verbose output to debug unexpected results.

6.5. s3 Mode: Amazon S3 Bucket Enumeration

The s3 mode is tailored for discovering Amazon S3 buckets. It constructs URLs in the format http://{word}.s3.amazonaws.com and checks their existence and public accessibility. This mode is invaluable for identifying misconfigured buckets that might leak sensitive data, such as backups, logs, or customer information.

6.5.1. s3 Mode Options Explained

FlagIn-Depth Explanation
-w, --wordlist stringRequired. A wordlist of potential S3 bucket names (e.g., company-backup, dev-files).
-v, --verboseDisplays extra details, such as whether a bucket is publicly listable and, if so, the first few files it contains.
…plus global optionsIncludes -t (threads), -o (output), and -k (no-tls-validation) for HTTPS buckets with invalid certificates.

6.5.2. s3 Mode Scenarios and Examples

Scenario: Enumerating Potential S3 Buckets

You’ve compiled a list of possible bucket names related to a target and want to check their status.

$ gobuster s3 -w /usr/share/seclists/Discovery/AWS/s3-buckets.txt -v
  • Explanation: Gobuster tests each word as a bucket name (e.g., http://backup.s3.amazonaws.com). The -v flag reveals if buckets are public and lists initial contents, helping you spot misconfigurations.

Additional Tips:

  • Wordlist Choice: Use targeted lists (e.g., company-specific names) to reduce noise, as generic lists can generate excessive requests.
  • Legal Caution: Unauthorized access to S3 buckets violates AWS terms and may be illegal. Ensure you have permission before proceeding.

6.6. gcs Mode: Google Cloud Storage Bucket Enumeration

The gcs mode mirrors s3 mode but targets Google Cloud Storage (GCS) buckets. It builds URLs like https://{word}.storage.googleapis.com and checks for existence and public access, making it useful for finding exposed GCS resources.

6.6.1. gcs Mode Options Explained

FlagIn-Depth Explanation
-w, --wordlist stringRequired. A wordlist of potential GCS bucket names (e.g., project-data, test-bucket).
-v, --verboseProvides additional bucket details, such as public accessibility and initial file listings.
…plus global optionsSupports -t (threads), -o (output), and other standard flags.

6.6.2. gcs Mode Scenarios and Examples

Scenario: Finding Public GCS Buckets

You’re investigating a target and want to identify accessible GCS buckets.

$ gobuster gcs -w /usr/share/seclists/Discovery/Google/gcp-buckets.txt -v
  • Explanation: Each wordlist entry is tested as a GCS bucket (e.g., https://data.storage.googleapis.com). Verbose mode (-v) highlights public buckets, aiding further exploration.

Additional Tips:

  • Efficiency: Start with a small, relevant wordlist to avoid overwhelming Google’s servers.
  • Ethics: Obtain explicit permission, as unauthorized scanning contravenes Google’s policies.

6.7. tftp Mode: TFTP File Enumeration

The tftp mode enumerates files on a Trivial File Transfer Protocol (TFTP) server, commonly used for network device booting and configuration storage. Misconfigured TFTP servers can expose critical files like router configs or firmware, making this mode a niche but powerful tool.

6.7.1. tftp Mode Options Explained

FlagIn-Depth Explanation
-s, --server stringRequired. The IP address or hostname of the TFTP server (e.g., 192.168.1.1).
-w, --wordlist stringRequired. A wordlist of potential filenames to test (e.g., config, firmware.bin).
…plus global optionsIncludes -t (threads) and -o (output) for managing the scan.

6.7.2. tftp Mode Scenarios and Examples

Scenario: Checking for Common Configuration Files

You’re auditing a network device and suspect its TFTP server holds accessible configuration files.

$ gobuster tftp -s 192.168.1.1 -w /usr/share/seclists/Discovery/Miscellaneous/common-tftp.txt
  • Explanation: Gobuster attempts to retrieve each file from the wordlist (e.g., config, startup-config) from the server at 192.168.1.1. Successful retrievals are reported, indicating exposed files.

Additional Tips:

  • File Guessing: TFTP lacks directory listing, so precise filenames are crucial. Use device-specific wordlists (e.g., Cisco’s running-config).
  • Speed: Increase -t cautiously, as TFTP servers may be resource-limited.

7. Advanced Techniques & Scenarios

7.1. Wordlists via STDIN

For dynamic wordlist generation, you can pipe the output of another program directly into Gobuster. This avoids creating temporary files and is highly efficient.

Scenario: You believe a hidden directory is a 4-letter word.

# 'crunch' is a tool that generates wordlists based on character sets.
# This command generates all 4-character lowercase words and pipes them to Gobuster.
$ crunch 4 4 abcdefghijklmnopqrstuvwxyz | gobuster dir -u http://target.com -w -

7.2. Pattern-Based Fuzzing

The -p, --pattern flag is a game-changer for targeted attacks where you suspect a specific naming convention.

Scenario: A developer tells you they name backup files by appending the date, like config.php-2023-10-28.bak.

Pattern File (date-patterns.txt):

{GOBUSTER}-2023-10-28.bak
{GOBUSTER}-2023-10-27.bak
{GOBUSTER}-2023-10-26.bak

Wordlist (filenames.txt):

config.php
users.db
web.config

Command:

# Gobuster will combine every word with every pattern.
# It will test for 'config.php-2023-10-28.bak', 'users.db-2023-10-28.bak', etc.
$ gobuster dir -u http://dev-server.local -w filenames.txt -p date-patterns.txt

8. Alternatives

ToolLanguageSpeedKey Differentiator & Use Case
GobusterGoVery FastThe best all-in-one tool. Its distinct modes (dir, dns, vhost, fuzz, s3, gcs, tftp) make it incredibly intuitive and fast for common enumeration tasks.
ffufGoVery FastThe Power User’s Choice. Unmatched flexibility in filtering, matching, and fuzzing. Use ffuf when you need to fuzz any part of an HTTP request (not just the path) or require complex result filtering based on regex, word count, or line count.
dirbPythonSlowThe classic. It’s simple and by default, it scans recursively, which can be useful. It’s largely superseded by Go-based tools.
wfuzzPythonModerateA highly versatile fuzzer. Its strength lies in its “payloads” and “encoders,” allowing for complex, chained attacks and obfuscation techniques that other tools can’t easily replicate.

9. FAQ

Q.1: What is the technical significance of a 403 Forbidden response?

Answer: A 403 Forbidden response is a valuable discovery. It is an explicit confirmation from the server that the requested resource exists, but the server’s access control rules are preventing you from viewing it. This is fundamentally different from a 404 Not Found. The next step in a penetration test would be to investigate if these access controls can be bypassed (e.g., by using different HTTP methods (-m POST), adding specific headers (-H 'X-Original-URL: /admin'), or accessing from a different user context).

Q.2: How can I optimize Gobuster’s performance without overwhelming the server?

Answer: Performance is a balance between thread count (-t) and server stability.

  • Increase Threads: Gradually increase the thread count (-t 30, -t 50, etc.) and monitor for errors.
  • Watch for Timeouts: If you see a large number of timed-out requests, your thread count is too high for the server or network to handle. Reduce it.
  • Use --delay: If you need to be stealthy or the server is very sensitive, use --delay (e.g., --delay 200ms) to introduce a fixed pause between each request per thread.

Q.3: Why is Gobuster not finding any results?

Answer: This is a common issue with several potential causes:

  • Wordlist Inadequacy: The most likely reason. The names of the hidden resources are not present in the wordlist you are using. Try a different, larger, or more application-specific wordlist.
  • Missing Extensions: The resources are files with extensions (e.g., .aspx, .jsp) that you have not specified with the -x flag.
  • Authentication Required: The resources are in a protected area. You must provide a valid session cookie using the -c flag.
  • Custom 404 Pages (“Soft 404s”): The server is returning 200 OK for everything. Use the --exclude-length flag to filter these false positives.
  • IP Blocking/Throttling: Aggressive scanning may have caused a Web Application Firewall (WAF) or intrusion prevention system to block your IP address. Try using a proxy or the --delay flag.

Q.4: What is the difference between dir mode and vhost mode?

Answer: They test different things.

  • dir mode brute-forces the URL path (e.g., http://example.com/[GUESS]). It is used to find files and directories on a specific website.
  • vhost mode brute-forces the HTTP Host header (e.g., Host: [GUESS].example.com). It is used to find different websites that are all running on the same IP address.

10. Troubleshooting & Tips

10.1 Error: x509: certificate signed by unknown authority

  • Cause: The target server is using an SSL/TLS certificate that is not trusted by your system’s root certificate store (e.g., a self-signed certificate).
  • Fix: Use the -k or --no-tls-validation flag to instruct Gobuster to proceed without validating the certificate.

10.2 Error: dial tcp: lookup [hostname]: no such host

  • Cause: Gobuster cannot resolve the hostname you provided. This could be due to a typo in the URL or DNS issues.
  • Fix: Double-check the URL for typos. Ensure your DNS is functioning correctly. You can also try using a different DNS server (e.g., Google DNS `

10.3 Error: dial tcp [::1]:80: connect: connection refused

  • Cause: A TCP connection could not be established with the target. This means the server is not listening on that IP and port, or a firewall is actively rejecting the connection.
  • Fix: Verify the target IP address and port are correct. Ensure the server is running and that no network firewall is blocking your access.

Tip: Use Verbosity for Debugging

If a scan is not behaving as you expect, add the global -v flag. This will print more detailed information, including errors for each failed request, which can help diagnose connection issues or server-side problems.

Tip: Start with Small Wordlists

Don’t immediately jump to a wordlist with millions of entries. Start with a smaller, common list (like dirb/common.txt) to get quick wins. If that yields nothing, escalate to larger lists like directory-list-2.3-medium.txt. This saves time.

11. Further Resources

  • Official Project Repository: Gobuster on GitHub - The source code, official releases, and issue tracker.
  • Community Wordlists: SecLists - The most comprehensive collection of wordlists for security testing, an essential companion to Gobuster.
  • Protocol Reference: MDN Web Docs: An overview of HTTP - A definitive resource for understanding the underlying protocol.

12. Command: Reference Table of Key Options

This table provides a quick reference for the most common and important options, updated to include new options from the expanded modes.

Option (Flag)Mode(s)Description
Global Options
-w, --wordlistAllRequired. Specifies the path to the wordlist file.
-o, --outputAllWrites the output to a specified file instead of the console.
-t, --threadsAllSets the number of concurrent execution threads (default: 10).
-v, --verboseAllEnables verbose output, showing more detailed error information.
-q, --quietAllSuppresses the banner and other non-essential output.
--delayAllAdds a specified delay between requests (e.g., 500ms, 2s).
dir & vhost Mode Options
-u, --urldir, vhost, fuzzRequired. The target URL.
-x, --extensionsdirComma-separated list of file extensions to append to each word.
-s, --status-codesdirComma-separated list of status codes to treat as a positive find.
-b, --status-codes-blacklistdirComma-separated list of status codes to ignore.
--exclude-lengthdir, vhost, fuzzExcludes responses with specified content lengths.
-k, --no-tls-validationdir, vhost, s3Skips SSL/TLS certificate validation.
-c, --cookiesdir, vhostSpecifies session cookie(s) for authenticated scanning.
-H, --headersdir, vhost, fuzzSpecify custom HTTP headers.
--proxydir, vhostRoutes traffic through an HTTP/HTTPS proxy.
dns Mode Options
-d, --domaindnsRequired. The target domain for subdomain enumeration.
-i, --show-ipsdnsDisplays the IP address(es) for each found subdomain.
--wildcarddnsForces the scan to continue even if a wildcard DNS record is detected.
fuzz Mode Options
-u, --urlfuzzRequired. The target URL with “FUZZ” keyword placement.
-H, --headersfuzzCustom headers with optional “FUZZ” placement.
-m, --methodfuzzSpecifies the HTTP method (e.g., GET, POST).
-d, --datafuzzPOST data with optional “FUZZ” placement.
s3 & gcs Mode Options
-w, --wordlists3, gcsRequired. Wordlist of potential bucket names.
-v, --verboses3, gcsShows additional bucket information.
tftp Mode Options
-s, --servertftpRequired. The target TFTP server address.
-w, --wordlisttftpRequired. Wordlist of potential filenames.