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.
On this page 14 sections
- ·Prerequisites
- ·Lab Setup
- ·Build the target
- 1Set a baseline before you fuzz
- 2Confirm ffuf and pick a wordlist
- 3Discover directories and files
- 4Filter the noise
- 5Recurse and add extensions
- 6Mine a hidden GET parameter
- 7Mine a hidden POST field
- 8Enumerate virtual hosts
- ·Defence and Detection
- ·Check Your Work
- ·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:
- HTTP Misconfiguration Abuse — exposed config and backup files.
- Attacking Authentication Mechanisms and Broken Authentication & Sessions — hidden admin paths and login logic.
- API & Web Service Attacks and Attacking GraphQL — hidden parameters on an API.
- Insecure Deserialization and NoSQL Injection — what a mined parameter lets you send.
- Server-Side Request Forgery & Attacks and Modern Web Exploitation — parameters that accept a URL.
- White-Box Web Exploitation: Auth Bypass to RCE and JavaScript Deobfuscation — reading the code behind a found file.
- WordPress Exploitation — fuzzing a specific CMS.
- The Bug Bounty Hunting workbook — treats fuzzing as the first move on a real scope.
Lab Setup
Tools:
ffuf, version 2.x. ffuf ships as its own Kali package. Install it directly:sudo apt install ffuf. Runffuf -hfor the exact flags on your installed version.- SecLists wordlists at
/usr/share/seclists/. If the folder is empty, runsudo 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
imagesfolder and alogin.phppage, none of them secret. - A hidden folder
admin/with no link from the home page, holdinglogin.phpand a backup fileconfig.php.bak(a few lines of fake configuration text). - A JSON endpoint
/api/profilethat, with no parameter, returns a 41-byte "missing parameter" error; withuser_id=<n>as a GET parameter, returns a 612-byte profile; and, onPOSTwithuser_id=1, returns a 918-byte profile when the body also hasadmin=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 theadmin/site), andapi.corp.local(the/api/profileendpoint, 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
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-39xk2Example output:
status=404 size=1287Every 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
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 raftFor 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
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 50Example 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
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
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 \
-acExample 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
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 41Example 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
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 612Example 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
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 5312Example 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
Hostheader, 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=truearriving 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:
- A directory or file not linked from the home page (
admin/oradmin/config.php.bak). - The one parameter name
/api/profileaccepts on GET, and the response size that revealed it. - The
admin.corp.localvhost, found by Host-header fuzzing, not by guessing.
Save the three ffuf commands you ran and the matching output line for each.
Clean-up
- Remove the
corp.locallines you added to/etc/hostsin Step 8. - Delete any saved scan output on your own machine:
rm -f ffuf-*.json. - 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.