How to use Wfuzz. Bruteforcing tool. Learn cyber security.

How to use WFUZZ? Bruteforce Tool

Wfuzz is a python based tool built for bruteforcing Web Applications. The tool is commonly used to find resources that are not directly linked such as directories, servlets, or scripts. Also, Wfuzz can bruteforce GET and POST parameters to check for different kind of injections (e.g., SQL, XSS, LDAP), bruteforce Forms parameters (e.g., User/Password), or fuzzing.

Wfuzz is a very flexible tool with many options. The fundamental note you should rememeber when using wfuzz is that anywhere you place the keyword ‘FUZZ’ in your query, it will try and bruteforce that parameter. The basic architecture of the Wfuzz Bruteforce program is as follows. It contains the elements listed below:

How to use Wfuzz for bruteforcing. Learn cyber security.
Wfuzz Architecture. How it works.

– payloads: the generated list of data to be sent to the web server (e.g., file, list, stdin, range, hexrand, names, hexrange, permutation).

– encoders: used to encode the payload in several ways, which is useful if the value in some parameter needs to be URL encoded, base64 encoded, or if the value should hold Unicode data, etc. There are also hash functions like md5 and sha1, which can also be used to generate the hash representation of the payload. A useful feature is a multiple encoding of the same payload, which can be great if some data is the first base64 encoded and then only the md5 hash is needed or something like that.

– iterators: used to iterate over all payloads. The iteration process can be done in several ways, but Wfuzz supports the three iterators: product, zip and chain. We need to remember that in our request URI we need to include the words FUZZ, FUZ2Z, FUZ3Z, …, FUZNZ, which will be replaced by the selected payloads in each iteration. The payload for each FUZZ element is selected by each z option we’re passing the wfuzz command. We can also use the -V option to fuzz all variables in a request, in which case we don’t need the FUZZ keyword.

– plugins: used to extend the features of the wfuzz program.w

– printers: used to output the results in certain formats. Supported formats are the magic tree, HTML.

Additional features include:

  • Multiple Injection points capability with multiple dictionaries
  • Recursion (When doing directory bruteforce)
  • Post, headers and authentication data brute forcing
  • Output to HTML
  • Colored output
  • Hide results by return code, word numbers, line numbers, regex.
  • Cookies fuzzing
  • Multi threading
  • Proxy support
  • SOCK support
  • Time delays between requests
  • Authentication support (NTLM, Basic)
  • All parameters bruteforcing (POST and GET)
  • Multiple encoders per payload
  • Payload combinations with iterators
  • Baseline request (to filter results against)
  • Brute force HTTP methods
  • Multiple proxy support (each request through a different proxy)
  • HEAD scan (faster for resource discovery)
  • Dictionaries tailored for known applications (Weblogic, Iplanet, Tomcat, Domino, Oracle 9i,
    Vignette, Coldfusion and many more.i
    (Many dictionaries are from Darkraver’s Dirb, www.open-labs.org)

Wfuzz Payloads Explained

Payloads are the generated list of data to be sent to the web server. Wfuzz is based on a simple concept: it replaces any reference (string) to the keyword ‘FUZZ’ by the value of a given payload. Essentially, a payload in Wfuzz is a source of input data. Wfuzz supports various payloads such as file, list, hexrand, range, names, and hexrange. The payload option is activated using the -z option.

  • file: read entries from a file: an example is file, wordlist/general/commons.txt, which specifies all the entries that are contained in the chosen file.
  • stdin: read entries from standard input
  • list: generate entries from a list of objects: an example is a list,a-b-c, which specifies the three entries, the letters ‘a’, ‘b’ and ‘c’.
  • hexrand: generate hexadecimal random objects
  • range: generate a range of numbers: an example is a range,0-2, which specifies the three entries, the numbers 0,1,2.
  • names: generates all possible combinations used in account naming patterns.
  • hexrange: generate hexadecimal random objects
  • permutation: performs a permutation of the given parameter
  • To view all payloads that can be used, use “$ wfuzz -e payloads”

Wfuzz file Option

file: read entries from a file: an example is file, test_file.txt, which specifies all the entries that are contained in the chosen file. In the example below, we set ‘test_file.txt’ as the file source for wfuzz to use. The simple word lists contains only 9 strings and if you see below, one came back with status code 200, indicating the request was successful finding a directory with the ‘#’ string.

$ wfuzz -z file,test_file.txt http://192.168.1.1/FUZZ.php
Wfuzz -z file option. Learn cyber security.

Wfuzz stdin Option

stdin: reads the entries from standard input. The stdin payload could be used when using a external wordlist generator. In this example, we will be using the crunch command. Crunch is a wordlist generator where you can specify a standard character set or any set of characters to be used in generating the wordlists.

$ crunch 3 3 abc | wfuzz -z stdin http://192.168.1.1/FUZZ
Wfuzz -z stdin option. Learn cyber security.

Wfuzz list Option

list: generate entries from a list of objects: an example is a ‘list,a-b-c’, which specifies the three entries, the letters ‘a’, ‘b’ and ‘c’. In the example below, we know from the above file scan that the directory ‘#’ exist. For proof of theory with the list option, we will feed the command four words and one of them will include the ‘#’ character to show that the directory can also be found using the list option to verify. As you see in the example below, the words are separated using the dash ‘-‘ character.

$ wfuzz -z list,login-about-#-home http://192.168.1.1/FUZZ
Wfuzz -z list option. Learn cyber security.

Wfuzz hexrand Option

hexrand: generates a hexadecimal random object for each query. An example is hexrand,0-50, which query random hexadecimal random objects.

$ wfuzz -z hexrand,0-50 http://192.168.1.1/FUZZ
Wfuzz -z hexrand option. Learn cyber security.

Wfuzz range Option

range: generate a range of numbers: an example is a range,0-5, which specifies the six entries, the numbers 0,1,2,3,4,5, and 6.

$ wfuzz -z range,0-5 http://192.168.1.1/FUZZ
Wfuzz -z range option. Learn cyber security.

Wfuzz Encoders Explained

Encoders are used to encode the payload in several ways, which is useful if the value in some parameter needs to be URL encoded, base64 encoded, or if the value should hold Unicode data, etc. Essentially, encoders convert information from one format to another. There are also hash functions like md5 and sha1, which can also be used to generate the hash representation of the payload. A useful feature is a multiple encoding of the same payload, which can be great if some data is the first base64 encoded and then only the md5 hash is needed or something like that.

Wfuzz encoder example. Learn cyber security.

To use an encoder, you need to place the selected encoder text in the third slot after the -z option in the query. The following example fuzzes the sha1 input, which accepts the sha1 of the user’s password in an insecure web application. We’re using the file passwords_file.txt as a payload, where the sha1 of each password (a password is specified in its own line) is computed and fed into the sha1 parameter.

$ wfuzz -z list,passwords_file.txt,sha1 <a href="http://192.168.1.1/index.php?d=FUZZ">http://192.168.1.1/index.php?sha1=FUZZ</a>

Wfuzz Available Encoders

CategoryNameSummary
hashesbase64Encodes the given string using base64.
urldoble_nibble_hexReplaces ALL characters in string using the %%dd%dd escape.
url_safe, urldouble_urlencodeApplies a double encode to special characters in string using the %25xx escape. Letters, digits, and the characters ‘_.-‘ are never quoted.
urlfirst_nibble_hexReplaces ALL characters in string using the %%dd? escape.
defaulthexlifyEvery byte of data is converted into the corresponding 2-digit hex representation.
htmlhtml_decimalReplaces ALL characters in string using the &#dd; escape.
htmlhtml_escapeConvert the characters &<>” in string to HTML-safe sequences.
htmlhtml_hexadecimalReplaces ALL characters in string using the &#xx; escape.
hashesmd5Applies a md5 hash to the given string.
dbmssql_charConverts ALL characters to MsSQL’s char(xx)
dbmysql_charConverts ALL characters to MySQL’s char(xx)
defaultnoneReturns string without changes.
dboracle_charConverts ALL characters to Oracle’s char(xx)
defaultrandom_upperReplaces random characters in string with its capitals letters.
urlsecond_nibble_hexReplaces ALL characters in string using the %?%dd escape.
hashessha1Applies a sha1 hash to the given string.
hashessha256Applies a sha256 hash to the given string.
hashessha512Applies a sha512 hash to the given string.
urluri_double_hexEncodes ALL characters using the %25xx escape.
urluri_hexEncodes ALL characters using the %xx escape.
urluri_triple_hexEncodes ALL characters using the %25%xx%xx escape.
urluri_unicodeReplaces ALL characters in string using the %u00xx escape.
url_safe, urlurlencodeReplaces special characters in string using the %xx escape. Letters, digits, and the characters ‘_.-‘ are never quoted.
urlutf8Replaces ALL characters in string using the \u00xx escape.
urlutf8_binaryReplaces ALL characters in string using the \uxx escape.
Wfuzz available encoders. Learn cyber security.

Wfuzz Iterators Explained

Wfuzz supports three iterator methods that can be used to iterate over payloads. To specify an iterator for combining payloads, you use the -m option in your command. The default for -m is product, which means if you do not specify zip or chain, it will automatically default to product.

Wfuzz available iterators. Product, zip, and chain. Learn cyber security.

Product Iterator

product (default): combines the first and second payload lists to construct all possible combinations.

wfuzz -z list,a-b-c -z list,1-2-3 http://192.168.1.1/FUZZ/FUZ2Z
Wfuzz product iterator with two payloads. Learn cyber security.

Zip Iterator

zip: takes the first value from the first payload list and combines it with a corresponding value in the second payload list.

wfuzz -z list,a-b-c -z list,1-2-3 -m zip http://192.168.1.1/FUZZ/FUZ2Z
Wfuzz zip iterator with two payloads. Learn cyber security.

Chain Iterator

chain: combines the first and second payload list to make a new bigger payload list.

wfuzz -z list,a-b-c -z list,1-2-3 -m chain http://192.168.1.1/FUZZ
Wfuzz chain iterator with two payloads. Learn cyber security.

Wfuzz Plugins Explained

Wfuzz’s web application vulnerability scanner is supported by various plugins. A list of scanning plugins can be obtained using the following command:

Wfuzz plugin scripts cheat sheet. Learn cyber security.
$ wfuzz -e scripts

There are categories of scripts which include:

  • passive: Passive scripts analyze existing requests and responses without performing new requests.
  • active: Active scripts perform new requests to the application to probe it for vulnerabilities.
  • discovery: Discovery plugins help crawling a website by automatically enqueuing discovered content to wfuzz request’s pool.
CategoryNameSummary
fuzzer, activebackupsLooks for known backup filenames.
info, passive, defaultcookiesLooks for new cookies.
active, discoverycvs_extractorParses CVS/Entries file.
default, passive, infoerrorsLooks for error messages.
toolsgrepHTTP response grep.
info, passive, defaultheadersLooks for HTTP headers.
active, discoverylinksParses HTML looking for new content.
default, passivelistingLooks for directory listing vulnerabilities.
infonpm_depsLooks for npm dependencies definition in js code.
active, discoveryrobotsParses robots.txt looking for new content.
tools, activescreenshotPerforms a screen capture using linux cutycapt tool.
active, discoverysitemapParses sitemap.xml file
active, discoverysvn_extractorParses .svn/entries file.
info, passivevtitleParses HTML page title.
active, discoverywc_extractorParses subversion’s wc.db file.

Wfuzz Script Example

$ wfuzz --script=robots -z list,robots_list.txt http://192.168.1.1/FUZZ

Wfuzz Printers Explained

Wfuzz supports writing the results that it outputs to a file in a various format. This is performed by plugins called “printers”. To print the available printers, use:

$ wfuzz -e printers

Wfuzz Available Printers

Wfuzz printer cheat sheet. Learn cyber security.
NameSummary
csvCSV printer ftw.
fieldRaw output format only showing the specified field expression. No header or footer.
htmlPrints results in html format.
jsonResults in json format.
magictreePrints results in magictree format.
rawRaw output format.

If you want to show the results in a specific format, you have to use the -o option followed by one of the available printers as shown below:

$ wfuzz -o json list,common_passwords.txt http://192.168.1.1/FUZZ
Wfuzz printer options with JSON output. Learn cyber security.

Wfuzz Cheat Sheet

OptionsDescription
-hThis helps.
–helpHelp menu with all options.
–filter-helpFilter language specification.
–versionDisplays version number installed.
-e <type>List of the available encoders/payloads/iterators/printers/scripts
–recipe <filename>Reads options from a recipe (pre-complied commands). Repeat for various recipes.
–dump-recipe <filename>Prints current options as a recipe.
–oF <filename>Saves fuzz results to a file. These can be consumed later using the wfuzz payload.
-cOutput with colors.
-vVerbose information.
-f filename, printerStore results in the output file using the specified printer (raw printer if omitted)
-o printerShow results using the specified printer.
–interactIf selected, all key presses are captured. This allows you to interact with the program.
–dry-runPrint the results of applying the requests without actually making any HTTP requests.
–prevPrint the previous HTTP requests (only when using payloads generating fuzzresults).
efield <expr>Show the specified language expression together with the current payload. Repeat for various fields.
field <expr>Do not show the payload but only the specified language expression. Repeat for various fields.
-p addrUse Proxy in format ip:port:type. Repeat option for using various proxies. Where type could be SOCKS4, SOCKS5 or HTTP if ommited.
-t NSpecify the number of concurrent connections (10 is default)
-s NSpecify time delay between requests (0 is default)
-R depthRecursive path discovery being depth the maximum recursion level.
-D depthMaximum link depth level.
-L, –followFollow HTTO redirections.
–ip host:portSpecify an IP to connect to instead of the URL’s host in the format ip:port.
-ZScan mode (connection errors will be ignored).
–req-delay NSets the maximum time in seconds the requests is allowed to allowed to take (CURLOPT_TIMEOUT). Default 90.
–conn-delay NSets the maximum time in seconds the connection phase to the server to take (CURLOPT_CONNECTTIMEOUT). DEFAULT 90.
-A, –AA, –AAAAlias for -v -c and –script=default,verbose,discover respectively.
–no-cacheDisable plugins cache. Every request will be scanned.
–script=Equivalent to –script=default
–script=<plugin>Runs script’s scan. <plugin> is a comma separated list of plugin-files or plugin-categories.
–script-help=<plugins>Show help about scripts.
–script-args n1=v1,…Provides arguments to scripts. ie. –script-args grep.regex=”<A href=\”(.*?)\”>”
-u <url>Specify a URL for the request.
-m <iterator>Specify an iterator for combining payloads (product by default).
-z <payload>Specify a payload for each FUZZ keyword used in the form of name[,parameter][,encoder]. A list of encoders can be used, ie. md5 or sha1. Encoders can be chained, ie. md5@sha1. Encoders category can be used. ie. url. Use help as a payload to show payload plugin’s details (you can filer using –slice)
–zP <params>Arguments for the specified payload (it must be preceded by -z or -w).
–zD <default>Default parameter for the specified payload (it must be proceeded by -z or -w).
–zE <encoder>Encoder for the specified payload (it must be proceeded by -z or -w).
–slice <filter>Filter payload’s elements using the specified expression. It must be preceded by -z.
-w wordlistSpecify a wordlist file (alias for -z file, wordlist.txt).
-V alltypeAll parameters bruteforcing (allvars and allpost). No need for FUZZ keyword.
-X methodSpecify an HTTP method for the request , ie. HEAD or FUZZ.
-b cookieSpecify a cookie for the requests. Repeat option for various cookies.
-d postdataUse post data (ex: “id=FUZZ&catalogue=1”).
-H headerUse header (ex:”Cookie:id=12345&user=FUZZ”). Repeat option for various headers.
–basic/ntlm/digest authIn format “user:pass” or “FUZZ:FUZZ” or “domain\FUZ2Z:FUZZ”
–hc/hl/hw/hh N[,N]+Hide responses with the specified code/lines/words/chars (Use BBB for taking values from baseline).
–sc/sl/sw/sh N[,N]+Show responses with the specified codes with the specified code/lines/words/chars (Use BBB for taking values from baseline).
–ss/hs regexShow/hide responses with the specified regex within the content.
–filter <filter>Show/hide reponses using the specified filter expression (Use BBB for taking values from baseline).
–prefilter <filter>Filter items before fuzzing using the specified expression. Repeat for concatenating filters.

Wfuzz –help

The wfuzz help menu with all the advanced options can be found by using the –help option.

$ wfuzz --help
Wfuzz --help option. Learn cyber security.

Wfuzz –version

The wfuzz version number can be displayed with the –version option.

$ wfuzz --version
Wfuzz --version option. Learn cyber security.

More command examples will be updated.

Wfuzz Pycurl is not compiled against Openssl?

UserWarning: Pycurl is not compiled against Openssl. Wfuzz might not work correctly when fuzzing SSL sites. Check Wfuzz's documentation for more information.

Solution

Pycurl comes preinstalled with the system but it is not preinstalled with OpenSSL.

Step 1: Uninstall python3-pycurl. (for Debian based systems)

sudo apt --purge remove python3-pycurl
Uninstall pyhton3-pycurl.

Step 2: Install the required SSL dependencies for pycurl. If you are getting an error where the packages cannot be found, make sure you run sudo apt-get update first:

sudo apt-get update
sudo apt install libcurl4-openssl-dev libssl-dev
Install pyhton3-pycurl SSL dependencies.

Step 3: Reinstall pycurl

sudo pip3 install pycurl wfuzz
Install wfuzz pycurl.

Step 4: Reinstall wfuzz.

sudo apt install wfuzz
Install wfuzz

Similar Posts