Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Practice library / Web attacks

Lab · Easy · 1 hour

Web Fuzzing & Directory Brute Forcing

Find hidden paths, parameters and vhosts fast with ffuf, then filter signal from noise.

  • ffuf
  • fuzzing
  • directory-brute-force
  • vhost
  • seclists
On this page 14 sections
  1. ·Prerequisites
  2. ·Lab Setup
  3. ·Build the target
  4. 1Set a baseline before you fuzz
  5. 2Confirm ffuf and pick a wordlist
  6. 3Discover directories and files
  7. 4Filter the noise
  8. 5Recurse and add extensions
  9. 6Mine a hidden GET parameter
  10. 7Mine a hidden POST field
  11. 8Enumerate virtual hosts
  12. ·Defence and Detection
  13. ·Check Your Work
  14. ·Clean-up

Fuzzing finds attack surface that no link on the home page reveals. A hidden admin page, a backup file left on disk, a parameter the API accepts but never documents, or a second site behind the same IP all become visible once a wordlist meets the right ffuf flag. The hard part is filtering thousands of 404s so a real hit stands out. The reader runs ffuf against paths, parameters, POST fields and Host headers.

Lab Objectives

  • Choose a wordlist and ffuf flags that fit the fuzzing goal
  • Discover hidden directories and files, then filter out the noise
  • Recurse into findings and fuzz file extensions on a backup file
  • Mine a hidden GET parameter on a live API endpoint
  • Mine a hidden POST field that changes an application's behaviour
  • Enumerate virtual hosts that share one IP address

Prerequisites

This lab builds on Web Application Recon. Complete it first: you need curl, basic HTTP headers, and one ffuf command from that lab's Step 7. This lab goes deeper on the same tool. Burp Suite Basics is useful, not required: it lets you replay an interesting ffuf hit by hand and inspect it.

Fuzzing finds attack surface. It does not exploit it. Once you have hidden paths, parameters and vhosts from this lab, these labs teach what to do with each kind of finding:

Lab Setup

Tools:

  1. ffuf, version 2.x. ffuf ships as its own Kali package. Install it directly: sudo apt install ffuf. Run ffuf -h for the exact flags on your installed version.
  2. SecLists wordlists at /usr/share/seclists/. If the folder is empty, run sudo apt install seclists.

Build the target

KaliRange hosts no targets, no virtual machines and no lab files. You run this lab on your own machine, against a web server that you build. The address 10.0.20.15 and the names www.corp.local, admin.corp.local and api.corp.local below are the example address and names of this lab. Replace them with your own.

Your target must have these parts, on one IP that your Kali machine can reach:

  • A default site with a home page, an images folder and a login.php page, none of them secret.
  • A hidden folder admin/ with no link from the home page, holding login.php and a backup file config.php.bak (a few lines of fake configuration text).
  • A JSON endpoint /api/profile that, with no parameter, returns a 41-byte "missing parameter" error; with user_id=<n> as a GET parameter, returns a 612-byte profile; and, on POST with user_id=1, returns a 918-byte profile when the body also has admin=true.
  • The same IP answering three Host headers with different content and sizes: www.corp.local (the default site), admin.corp.local (a copy of the admin/ site), and api.corp.local (the /api/profile endpoint, a 42-byte response to a plain request).
  • A fixed 404 page, so that every non-existent path returns the same size (this lab's example is 1287 bytes).

Build such a server from free, legal parts. Write a small application with these flaws yourself, using any web framework, since the exact mix of a hidden vhost, a backup file and a mined parameter is specific to this lab. Run it on your own machine or on a network you control. Take a snapshot of the virtual machine, or note the state of the container, before Step 1.

Authorised targets only. Run every command in this lab only against a target that you own, or have written permission to test. Fuzzing a system without authorisation is unauthorised access in most jurisdictions.

Step 1: Set a baseline before you fuzz

1

Request a path that cannot exist

A fuzzer sends thousands of requests. Most hit nothing. Learn what "nothing" looks like first, so you can filter it out later instead of reading it thousands of times.

Run a request for a random path and record its status and size.

curl -s -o /dev/null -w 'status=%{http_code} size=%{size_download}\n' \
  http://10.0.20.15/this-path-does-not-exist-39xk2

Example output:

status=404 size=1287

Every non-existent path on this target returns status 404 and exactly 1287 bytes. That is your baseline. Some applications return status 200 for a "not found" page instead of 404 — a soft 404. When that happens, size is the only signal left, which is why Step 1 checks size, not just status.

Step 2: Confirm ffuf and pick a wordlist

2

Check ffuf, then choose a wordlist for the goal

A smaller wordlist finds common paths fast. A larger one finds more, slower. Match the wordlist to how much time you have, not habit.

ffuf -V
ls /usr/share/seclists/Discovery/Web-Content/ | grep raft

For directory discovery, SecLists ships a small, medium and large raft list (raft-small-directories.txt, raft-medium-directories.txt, raft-large-directories.txt). Start small. Move to the medium list only if the small one finds nothing and you still suspect hidden content.

FUZZ is the placeholder ffuf replaces with each wordlist line. It can go in the path, in a parameter value, or in a header value — you choose where.

Step 3: Discover directories and files

3

Run the first directory scan

-u sets the URL with FUZZ in it. -w sets the wordlist. Start here before adding any filter, so you see the raw noise once.

ffuf -u http://10.0.20.15/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-small-directories.txt \
  -t 50

Example output:

 :: Method           : GET
 :: URL              : http://10.0.20.15/FUZZ
 :: Wordlist         : FUZZ: raft-small-directories.txt
 :: Follow redirects : false
 :: Calibration      : false
 :: Timeout          : 10
 :: Threads          : 50
 :: Matcher          : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________

images                 [Status: 301, Size: 178, Words: 7, Lines: 8, Duration: 9ms]
admin                  [Status: 301, Size: 178, Words: 7, Lines: 8, Duration: 12ms]
login.php              [Status: 200, Size: 2451, Words: 320, Lines: 64, Duration: 15ms]
:: Progress: [20115/20115] :: Job [1/1] :: 480 req/sec :: Duration: [0:00:42] :: Errors: 0 ::

admin is not linked anywhere on the home page. This is the hidden path the lab's objectives point at.

Step 4: Filter the noise

4

Filter by status, size, or auto-calibration

A real target returns some 404s with different sizes — error pages, redirects, rate limits. Filter on what you measured in Step 1, not on status alone.

# Manual filter, using the Step 1 baseline
ffuf -u http://10.0.20.15/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-small-directories.txt \
  -fs 1287

# Or let ffuf find its own baseline with a few throwaway requests first
ffuf -u http://10.0.20.15/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-small-directories.txt \
  -ac

-fs 1287 drops every hit that is exactly 1287 bytes — the baseline from Step 1. -ac (auto-calibrate) does the same job automatically: it probes a few random, almost-certainly-missing paths first and derives its own filters from the responses. Prefer -ac once you trust it; use a manual -fs/-fc filter when you need to see exactly what is being dropped and why.

Step 5: Recurse and add extensions

5

Fuzz inside a found directory, and fuzz its file extensions

A hit is a new attack surface, not an end point. Recursion re-runs the same wordlist inside every directory ffuf finds, so a hidden file one level deep does not need a second manual command.

ffuf -u http://10.0.20.15/FUZZ \
  -w /usr/share/seclists/Discovery/Web-Content/raft-small-directories.txt \
  -e .php,.bak,.txt,.zip \
  -recursion -recursion-depth 2 \
  -ac

Example output:

admin                  [Status: 301, Size: 178, Words: 7, Lines: 8, Duration: 11ms]
  [INFO] Adding a new job to the queue: http://10.0.20.15/admin/FUZZ
admin/login.php        [Status: 200, Size: 2208, Words: 288, Lines: 52, Duration: 10ms]
admin/config.php.bak   [Status: 200, Size: 612, Words: 44, Lines: 18, Duration: 9ms]
:: Progress: [100575/100575] :: Job [2/2] :: 455 req/sec :: Duration: [0:03:41] :: Errors: 0 ::

config.php.bak only appeared because -e .bak fuzzed extensions on top of the wordlist, inside a directory recursion only found by fuzzing. A backup file like this often holds database credentials or an API key in plain text. That is exactly why HTTP Misconfiguration Abuse treats it as a finding to chase, not this lab.

Step 6: Mine a hidden GET parameter

6

Fuzz parameter names, not just paths

An endpoint can accept a parameter that no documentation mentions. Put FUZZ in the query string instead of the path to find one.

ffuf -u 'http://10.0.20.15/api/profile?FUZZ=1' \
  -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt \
  -fs 41

Example output:

user_id                [Status: 200, Size: 612, Words: 41, Lines: 1, Duration: 11ms]
:: Progress: [6453/6453] :: Job [1/1] :: 610 req/sec :: Duration: [0:00:11] :: Errors: 0 ::

Every parameter name the endpoint ignores returns the same 41-byte "missing parameter" error, filtered by -fs 41. user_id returns a full profile — the parameter exists and is not documented anywhere a normal user would read.

Step 7: Mine a hidden POST field

7

Fuzz the request body, not only the URL

-d sets the POST body with FUZZ inside it. The same filtering logic from Step 6 applies: most field names change nothing; one changes the response.

ffuf -u http://10.0.20.15/api/profile \
  -X POST \
  -d 'user_id=1&FUZZ=true' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt \
  -fs 612

Example output:

admin                   [Status: 200, Size: 918, Words: 77, Lines: 1, Duration: 12ms]
:: Progress: [6453/6453] :: Job [1/1] :: 590 req/sec :: Duration: [0:00:11] :: Errors: 0 ::

Sending admin=true in the body returns a larger response with extra fields. This is the shape of a mass-assignment bug: a field the client was never meant to set, accepted anyway. FUZZ can go inside a header value the same way, for example -H 'FUZZ: true' with a short list of custom header names. Use this if you suspect a hidden debug header rather than a hidden body field.

Step 8: Enumerate virtual hosts

8

Fuzz the Host header, not the path

One IP can serve several sites. -H 'Host: FUZZ.corp.local' asks the same IP for a different site each request. Size, not status, usually tells them apart.

ffuf -u http://10.0.20.15/ \
  -H 'Host: FUZZ.corp.local' \
  -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt \
  -fs 5312

Example output:

www                     [Status: 200, Size: 5312, Words: 812, Lines: 94, Duration: 10ms]
admin                   [Status: 200, Size: 2144, Words: 190, Lines: 41, Duration: 9ms]
api                     [Status: 200, Size: 42, Words: 1, Lines: 1, Duration: 8ms]
:: Progress: [5000/5000] :: Job [1/1] :: 470 req/sec :: Duration: [0:00:11] :: Errors: 0 ::

-fs 5312 is the size of the default site, so www should have been filtered; it appears here only to show the baseline. admin.corp.local and api.corp.local are the real find — two sites with no DNS record and no link from www.corp.local. Add them to /etc/hosts now, pointing at 10.0.20.15, so your browser and curl can reach them by name.

Defence and Detection

A tester's fuzzing run is loud by nature; a defender has several ways to see it.

  • Rate: thousands of near-identical requests from one IP in seconds. A web application firewall or reverse proxy can alert on request rate per client, independent of any single request looking malicious.
  • Shape: a long run of 404s broken by a handful of 2xx or 3xx hits is the signature of directory brute forcing, not normal browsing. Log analysis that groups by response size catches this even when status codes are deliberately uniform.
  • Default vhost leakage: Step 8 worked because the default site and the hidden vhosts returned different sizes for the same request. Configure the web server's default (catch-all) vhost to return one fixed, generic response for any unrecognised Host header, so Host-header fuzzing has no size signal to filter on.
  • Parameter and field names: logging every parameter and field name seen, even unexpected ones, lets a defender spot admin=true arriving on an endpoint that never documented it — before anyone decides whether to also use it.

Check Your Work

Show these three results from your own ffuf output:

  1. A directory or file not linked from the home page (admin/ or admin/config.php.bak).
  2. The one parameter name /api/profile accepts on GET, and the response size that revealed it.
  3. The admin.corp.local vhost, found by Host-header fuzzing, not by guessing.

Save the three ffuf commands you ran and the matching output line for each.

Clean-up

  1. Remove the corp.local lines you added to /etc/hosts in Step 8.
  2. Delete any saved scan output on your own machine: rm -f ffuf-*.json.
  3. If you work in a virtual machine, roll it back to the snapshot that you took before Step 1, or rebuild the container.

Lab complete. You can now fuzz paths, parameters and vhosts with ffuf, and filter the noise out of what you find. Next: HTTP Misconfiguration Abuse — exploit and then lock down the backup file and the admin vhost this lab found.

Sign in to track progress and send feedback.

Related