24 Jul 2024
Fuzzing a Web application’s endpoints using ffuf.
I will be grading labs on a best-six-out-of-seven basis, so you can treat this lab as optional.
Preparation
None
Procedure
Note
|
Within the lab, you can view this procedure at http://10.0.0.1. You will also be using http://10.0.0.1 as a fuzz target. |
FFuF usage
FFuF (Fuzz Faster U Fool) is a fast web fuzzing tool created in Go.
It is mainly used for web enumeration, fuzzing, and directory brute-forcing.
Read its manual page or help (-h
) output and answer the following questions:
-
How do you save FFuF’s output to a markdown file such as
ffuf.md
? -
What option would you use to follow redirects?
-
How do you print complete URLs and redirect locations?
-
How do you enable colourized output?
-
How can you match only URLs with HTTP status 200 (OK)?
-
How can you filter out URLs with HTTP status code 403 (Forbidden)?
URL discovery
The FFuF tool always requires at least two option:
-u
-
Target URL to fuzz. This should contain the literal value
FUZZ
, which will be replaced with words in a wordlist. -w
-
Wordlist file. We can use wordlists from
/usr/share/seclists
in our Kali installation, or we can supply custom wordlists at the command line by using-w -
(stdin).
Using these arguments:
-
"Fuzz" the site http://10.0.0.1 with a single-word wordlist. What is the HTTP status code, file size and word count of the resulting file?
-
Use the
Discovery/Web-Content/common.txt
wordlist to discover some files and directories that are present on http://10.0.0.1. -
Try again with the
Discovery/Web-Content/raft-large-files.txt
wordlist. What difference do you see? -
Use the
-e
option in conjunction with theraft-medium-words-lowercase.txt
wordlist to discover more files with common endings (e.g.,.txt
and.php
). -
Find as many files and directories as you can within the
/vulnerabilities
directory (e.g.,/vulnerabilities/brute/index.php
).
Parameter fuzzing
FFuF can fuzz things besides URLs!
-
Using a very short wordlist (e.g., one word), fuzz http://10.0.0.1/sqli-labs/Less-1/index.php?FUZZ=1. How many words are in the HTML you receive as a result?
-
Use
Discovery/Web-Content/burp-parameter-names.txt
to fuzz the space of parameters to/sqli-labs/Less-1
by filtering on the number of words in the HTTP response.
Password fuzzing
We can also use ffuf for wordlist-based brute-force attacks, for example, trying passwords on an authentication page.
-
Use the cURL command to inspect the login page at http://10.0.0.1/sqli-labs/Less-11/index.php. What do you observe about the HTML form?
-
Use the
-X POST
argument to cURL to make a POST request to/sqli-labs/Less-11/
, using the-d
argument to pass HTML form data attempting to log in with the usernamebatman
and the passworddark knight
. For example, if you wanted to submit an HTML form with a fielda
having the valuefoo
andb
having the value42
, you would passa=foo&b=42
to-d
. -
Use FFuF with the same
-X
and-d
arguments to fuzz the password of theDummy
user. Try using thePasswords/Leaked-Databases/phpbb.txt
wordlist. You will also need to set the HTTP headerContent-Type: application/x-www-form-urlencoded
, since FFuF doesn’t set it automatically like cURL. -
Confirm that you have successfully found the
Dummy
user’s password. -
Use
curl
anddiff
to compare the HTML of/sqli-labs/Less-11
under the following conditions. What do you observe?-
no username or password supplied
-
incorrect username or password supplied
-
correct username and password supplied
-
username
Dummy
, passwordphpbbin'
(note: the URL encoding of the single quote'
character is%27
)
-