DEV Community

kartavya
kartavya

Posted on

Directory Fuzzing at High Velocity: Mastering ffuf for Pentesting

Finding hidden endpoints, backup files, and administrative panels in minutes is an important part of web application security testing. Many websites expose routes that are not linked from their homepage or navigation menus. These endpoints may contain outdated files, forgotten development pages, configuration mistakes, or sensitive administrative interfaces.

Directory fuzzing helps security testers discover these resources systematically. One of the most popular tools for this job is ffuf (Fuzz Faster U Fool), a fast web fuzzer written in Go.

Unlike manually guessing URLs, ffuf automates requests using wordlists and identifies interesting server responses. With the right wordlists, response filtering, and controlled concurrency, it can make authorized security assessments significantly more efficient.

This guide explains how to use ffuf, tune wordlists, filter HTTP status codes, and perform recursive directory discovery in an authorized testing environment.

1. Understanding Directory Fuzzing and ffuf

Directory fuzzing is a technique used to discover hidden paths and files on a web server. It works by taking entries from a wordlist and inserting them into a URL.

For example, a website might contain:

  • /admin
  • /backup
  • /uploads
  • /api
  • /dashboard

These paths might not appear in the website's navigation but could still be accessible.

ffuf automates this process using the FUZZ keyword.

Install ffuf

On Windows:

winget install ffuf.ffuf
Enter fullscreen mode Exit fullscreen mode

On Linux, install it through the system package manager or Go:

go install github.com/ffuf/ffuf/v2@latest
Enter fullscreen mode Exit fullscreen mode

Check the installation:

ffuf -V
Enter fullscreen mode Exit fullscreen mode

A successful installation displays the installed version.

Basic directory fuzzing

For an authorized local lab:

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ
Enter fullscreen mode Exit fullscreen mode

Here:

  • -w specifies the wordlist.
  • -u specifies the target URL.
  • FUZZ represents the location where each word is inserted.

For example, if the wordlist contains admin, ffuf requests /admin.

2. Tuning Wordlists for Better Results

Wordlist selection has a major impact on fuzzing efficiency. A very large wordlist can generate unnecessary requests, while a small and relevant list can help identify useful endpoints faster.

A commonly used collection is SecLists.

Repository: https://github.com/danielmiessler/SecLists

For directory discovery, the following wordlist is a useful starting point:

Discovery/Web-Content/common.txt
Enter fullscreen mode Exit fullscreen mode

A more targeted list can contain:

admin
dashboard
api
uploads
assets
backup
robots.txt
sitemap.xml
Enter fullscreen mode Exit fullscreen mode

Testing file extensions

Some resources are available only with specific file extensions.

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-e .php,.html,.txt,.bak
Enter fullscreen mode Exit fullscreen mode

The -e option adds the specified extensions to each word.

For example, ffuf can check variations such as:

  • admin.php
  • admin.html
  • admin.txt
  • admin.bak

The goal is not to send as many requests as possible. It is to use relevant words that reflect the application's technology and structure.

3. Filtering HTTP Status Codes and Reducing False Positives

A web server can return different HTTP response codes during directory fuzzing.

Status code Meaning
200 Successful response
204 Successful response with no content
301 Permanent redirect
302 Temporary redirect
401 Authentication required
403 Access forbidden
404 Resource not found
500 Internal server error

A 403 response is worth investigating because it may indicate an existing restricted resource. However, a response code alone does not prove that a vulnerability exists.

Match selected status codes

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-mc 200,301,302,401,403
Enter fullscreen mode Exit fullscreen mode

The -mc option matches the selected response codes.

Filter unwanted responses

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-mc all \
-fc 404
Enter fullscreen mode Exit fullscreen mode

The -fc option filters out selected status codes.

Automatic calibration

Some applications return the same custom error page for every unknown URL. This creates false positives.

Use automatic calibration:

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-ac
Enter fullscreen mode Exit fullscreen mode

The -ac option helps ffuf identify common response patterns and adjust filtering.

Other useful filters include:

  • -fs: Filter by response size.
  • -fw: Filter by word count.
  • -fl: Filter by line count.
  • -fr: Filter by regular expression.

Combining these options helps separate interesting responses from repetitive error pages.

4. Multi-Threaded and Recursive Fuzzing

One of ffuf's useful features is concurrent request processing. It allows multiple requests to be handled at the same time.

The -t option controls the number of concurrent threads.

Controlled multi-threaded example

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-mc 200,301,302,403 \
-t 20 \
-ac
Enter fullscreen mode Exit fullscreen mode

Here, -t 20 configures 20 concurrent threads.

Higher concurrency does not always mean better results. Excessive requests can overload a server, trigger rate limits, or produce unreliable responses. Start conservatively and follow the agreed testing limits.

Recursive directory fuzzing

Sometimes, discovering a directory is only the beginning. A directory may contain additional subdirectories that need to be inspected.

ffuf supports recursive fuzzing:

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-recursion \
-recursion-depth 2 \
-mc 200,301,302,403 \
-t 20
Enter fullscreen mode Exit fullscreen mode

Important options:

  • -recursion: Enables recursive discovery.
  • -recursion-depth 2: Limits scanning to two directory levels.
  • -t 20: Controls concurrent requests.

The URL must end with FUZZ for recursive mode, and ffuf recursion supports only the FUZZ keyword.

The default recursion strategy follows directory-like redirects. The greedy strategy can recurse into every match, generating substantially more requests.

Save results

ffuf -w wordlist.txt \
-u http://127.0.0.1:8080/FUZZ \
-o results.json \
-of json
Enter fullscreen mode Exit fullscreen mode

Saving results in JSON makes it easier to review discovered paths and include findings in a security assessment.

5. Vulnerable vs. Remediated Configuration and Security Best Practices

Directory fuzzing is useful not only for finding endpoints but also for identifying configuration weaknesses.

Consider a web server that unintentionally exposes backup files and hidden configuration files.

Vulnerable Nginx configuration example

server {
    listen 80;
    server_name example.local;

    root /var/www/html;

    location / {
        try_files $uri $uri/ =404;
    }
}
Enter fullscreen mode Exit fullscreen mode

This simplified configuration does not explicitly deny access to sensitive dotfiles or backup-file extensions. Depending on the rest of the server configuration and file permissions, these resources may become publicly accessible.

Remediated Nginx configuration example

server {
    listen 80;
    server_name example.local;

    root /var/www/html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ /\.(?!well-known) {
        deny all;
    }

    location ~* \.(bak|old|backup|sql|env)$ {
        deny all;
    }
}
Enter fullscreen mode Exit fullscreen mode

The updated configuration blocks requests matching sensitive dotfiles and common backup extensions, while preserving the .well-known directory.

This is a defensive example, not a complete production configuration. Sensitive files should also be stored outside the public web root, and configuration changes should be tested before deployment.

Security testing best practices

  • Obtain written authorization before scanning.
  • Confirm the approved target and testing scope.
  • Use relevant, maintained wordlists.
  • Keep concurrency within approved limits.
  • Avoid destructive requests and unnecessary payloads.
  • Review 200, 301, 302, 401 and 403 responses carefully.
  • Verify findings manually before reporting vulnerabilities.
  • Retest after remediation.

A discovered directory is not automatically a security vulnerability. Its contents, access controls, business purpose, and exposure impact must be evaluated.

Final Thoughts

ffuf makes directory discovery more systematic by combining wordlists, HTTP response filtering, concurrent requests, and recursive scanning.

The real value comes from understanding the responses rather than simply generating thousands of requests. A well-tuned scan can help security teams identify forgotten routes, exposed resources, and configuration weaknesses before they become serious problems.

For developers and security teams looking to strengthen their web perimeter, combining directory fuzzing with regular security assessments provides a more complete approach to application security.

Want to assess website exposure?

Download Curated Fuzzing Wordlists and explore security testing resources from Hack My Website.

Only perform fuzzing on systems you own or have explicit permission to assess.

Top comments (0)