Debian Codegraph @

README.md

raw symbols SCIP
1 ![ffuf mascot](_img/ffuf_run_logo_600.png)
2 # ffuf - Fuzz Faster U Fool
3
4 A fast web fuzzer written in Go.
5
6 - [Installation](https://github.com/ffuf/ffuf#installation)
7 - [Example usage](https://github.com/ffuf/ffuf#example-usage)
8 - [Content discovery](https://github.com/ffuf/ffuf#typical-directory-discovery)
9 - [Vhost discovery](https://github.com/ffuf/ffuf#virtual-host-discovery-without-dns-records)
10 - [Parameter fuzzing](https://github.com/ffuf/ffuf#get-parameter-fuzzing)
11 - [POST data fuzzing](https://github.com/ffuf/ffuf#post-data-fuzzing)
12 - [Using external mutator](https://github.com/ffuf/ffuf#using-external-mutator-to-produce-test-cases)
13 - [Configuration files](https://github.com/ffuf/ffuf#configuration-files)
14 - [Help](https://github.com/ffuf/ffuf#usage)
15 - [Interactive mode](https://github.com/ffuf/ffuf#interactive-mode)
16
17
18 ## Installation
19
20 - [Download](https://github.com/ffuf/ffuf/releases/latest) a prebuilt binary from [releases page](https://github.com/ffuf/ffuf/releases/latest), unpack and run!
21
22 _or_
23 - If you are on macOS with [homebrew](https://brew.sh), ffuf can be installed with: `brew install ffuf`
24
25 _or_
26 - If you have recent go compiler installed: `go install github.com/ffuf/ffuf/v2@latest` (the same command works for updating)
27
28 _or_
29 - `git clone https://github.com/ffuf/ffuf ; cd ffuf ; go get ; go build`
30
31 Ffuf depends on Go 1.16 or greater.
32
33 ## Example usage
34
35 The usage examples below show just the simplest tasks you can accomplish using `ffuf`.
36
37 More elaborate documentation that goes through many features with a lot of examples is
38 available in the ffuf wiki at [https://github.com/ffuf/ffuf/wiki](https://github.com/ffuf/ffuf/wiki)
39
40 For more extensive documentation, with real life usage examples and tips, be sure to check out the awesome guide:
41 "[Everything you need to know about FFUF](https://codingo.io/tools/ffuf/bounty/2020/09/17/everything-you-need-to-know-about-ffuf.html)" by
42 Michael Skelton ([@codingo](https://github.com/codingo)).
43
44 You can also practise your ffuf scans against a live host with different lessons and use cases either locally by using the docker container https://github.com/adamtlangley/ffufme or against the live hosted version at http://ffuf.me created by Adam Langley [@adamtlangley](https://twitter.com/adamtlangley).
45
46 ### Typical directory discovery
47
48 [![asciicast](https://asciinema.org/a/211350.png)](https://asciinema.org/a/211350)
49
50 By using the FUZZ keyword at the end of URL (`-u`):
51
52 ```
53 ffuf -w /path/to/wordlist -u https://target/FUZZ
54 ```
55
56 ### Virtual host discovery (without DNS records)
57
58 [![asciicast](https://asciinema.org/a/211360.png)](https://asciinema.org/a/211360)
59
60 Assuming that the default virtualhost response size is 4242 bytes, we can filter out all the responses of that size (`-fs 4242`)while fuzzing the Host - header:
61
62 ```
63 ffuf -w /path/to/vhost/wordlist -u https://target -H "Host: FUZZ" -fs 4242
64 ```
65
66 ### GET parameter fuzzing
67
68 GET parameter name fuzzing is very similar to directory discovery, and works by defining the `FUZZ` keyword as a part of the URL. This also assumes a response size of 4242 bytes for invalid GET parameter name.
69
70 ```
71 ffuf -w /path/to/paramnames.txt -u https://target/script.php?FUZZ=test_value -fs 4242
72 ```
73
74 If the parameter name is known, the values can be fuzzed the same way. This example assumes a wrong parameter value returning HTTP response code 401.
75
76 ```
77 ffuf -w /path/to/values.txt -u https://target/script.php?valid_name=FUZZ -fc 401
78 ```
79
80 ### POST data fuzzing
81
82 This is a very straightforward operation, again by using the `FUZZ` keyword. This example is fuzzing only part of the POST request. We're again filtering out the 401 responses.
83
84 ```
85 ffuf -w /path/to/postdata.txt -X POST -d "username=admin\&password=FUZZ" -u https://target/login.php -fc 401
86 ```
87
88 ### Maximum execution time
89
90 If you don't want ffuf to run indefinitely, you can use the `-maxtime`. This stops __the entire__ process after a given time (in seconds).
91
92 ```
93 ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime 60
94 ```
95
96 When working with recursion, you can control the maxtime __per job__ using `-maxtime-job`. This will stop the current job after a given time (in seconds) and continue with the next one. New jobs are created when the recursion functionality detects a subdirectory.
97
98 ```
99 ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime-job 60 -recursion -recursion-depth 2
100 ```
101
102 It is also possible to combine both flags limiting the per job maximum execution time as well as the overall execution time. If you do not use recursion then both flags behave equally.
103
104 ### Using external mutator to produce test cases
105
106 For this example, we'll fuzz JSON data that's sent over POST. [Radamsa](https://gitlab.com/akihe/radamsa) is used as the mutator.
107
108 When `--input-cmd` is used, ffuf will display matches as their position. This same position value will be available for the callee as an environment variable `$FFUF_NUM`. We'll use this position value as the seed for the mutator. Files example1.txt and example2.txt contain valid JSON payloads. We are matching all the responses, but filtering out response code `400 - Bad request`:
109
110 ```
111 ffuf --input-cmd 'radamsa --seed $FFUF_NUM example1.txt example2.txt' -H "Content-Type: application/json" -X POST -u https://ffuf.io.fi/FUZZ -mc all -fc 400
112 ```
113
114 It of course isn't very efficient to call the mutator for each payload, so we can also pre-generate the payloads, still using [Radamsa](https://gitlab.com/akihe/radamsa) as an example:
115
116 ```
117 # Generate 1000 example payloads
118 radamsa -n 1000 -o %n.txt example1.txt example2.txt
119
120 # This results into files 1.txt ... 1000.txt
121 # Now we can just read the payload data in a loop from file for ffuf
122
123 ffuf --input-cmd 'cat $FFUF_NUM.txt' -H "Content-Type: application/json" -X POST -u https://ffuf.io.fi/ -mc all -fc 400
124 ```
125
126 ### Configuration files
127
128 When running ffuf, it first checks if a default configuration file exists. Default path for a `ffufrc` file is
129 `$XDG_CONFIG_HOME/ffuf/ffufrc`. You can configure one or multiple options in this file, and they will be applied on
130 every subsequent ffuf job. An example of ffufrc file can be found
131 [here](https://github.com/ffuf/ffuf/blob/master/ffufrc.example).
132
133 A more detailed description about configuration file locations can be found in the wiki:
134 [https://github.com/ffuf/ffuf/wiki/Configuration](https://github.com/ffuf/ffuf/wiki/Configuration)
135
136 The configuration options provided on the command line override the ones loaded from the default `ffufrc` file.
137 Note: this does not apply for CLI flags that can be provided more than once. One of such examples is `-H` (header) flag.
138 In this case, the `-H` values provided on the command line will be _appended_ to the ones from the config file instead.
139
140 Additionally, in case you wish to use bunch of configuration files for different use cases, you can do this by defining
141 the configuration file path using `-config` command line flag that takes the file path to the configuration file as its
142 parameter.
143
144 <p align="center">
145 <img width="250" src="_img/ffuf_juggling_250.png">
146 </p>
147
148 ## Usage
149
150 To define the test case for ffuf, use the keyword `FUZZ` anywhere in the URL (`-u`), headers (`-H`), or POST data (`-d`).
151
152 ```
153 Fuzz Faster U Fool - v2.1.0
154
155 HTTP OPTIONS:
156 -H Header `"Name: Value"`, separated by colon. Multiple -H flags are accepted.
157 -X HTTP method to use
158 -b Cookie data `"NAME1=VALUE1; NAME2=VALUE2"` for copy as curl functionality.
159 -cc Client cert for authentication. Client key needs to be defined as well for this to work
160 -ck Client key for authentication. Client certificate needs to be defined as well for this to work
161 -d POST data
162 -http2 Use HTTP2 protocol (default: false)
163 -ignore-body Do not fetch the response content. (default: false)
164 -r Follow redirects (default: false)
165 -raw Do not encode URI (default: false)
166 -recursion Scan recursively. Only FUZZ keyword is supported, and URL (-u) has to end in it. (default: false)
167 -recursion-depth Maximum recursion depth. (default: 0)
168 -recursion-strategy Recursion strategy: "default" for a redirect based, and "greedy" to recurse on all matches (default: default)
169 -replay-proxy Replay matched requests using this proxy.
170 -sni Target TLS SNI, does not support FUZZ keyword
171 -timeout HTTP request timeout in seconds. (default: 10)
172 -u Target URL
173 -x Proxy URL (SOCKS5 or HTTP). For example: http://127.0.0.1:8080 or socks5://127.0.0.1:8080
174
175 GENERAL OPTIONS:
176 -V Show version information. (default: false)
177 -ac Automatically calibrate filtering options (default: false)
178 -acc Custom auto-calibration string. Can be used multiple times. Implies -ac
179 -ach Per host autocalibration (default: false)
180 -ack Autocalibration keyword (default: FUZZ)
181 -acs Custom auto-calibration strategies. Can be used multiple times. Implies -ac
182 -c Colorize output. (default: false)
183 -config Load configuration from a file
184 -json JSON output, printing newline-delimited JSON records (default: false)
185 -maxtime Maximum running time in seconds for entire process. (default: 0)
186 -maxtime-job Maximum running time in seconds per job. (default: 0)
187 -noninteractive Disable the interactive console functionality (default: false)
188 -p Seconds of `delay` between requests, or a range of random delay. For example "0.1" or "0.1-2.0"
189 -rate Rate of requests per second (default: 0)
190 -s Do not print additional information (silent mode) (default: false)
191 -sa Stop on all error cases. Implies -sf and -se. (default: false)
192 -scraperfile Custom scraper file path
193 -scrapers Active scraper groups (default: all)
194 -se Stop on spurious errors (default: false)
195 -search Search for a FFUFHASH payload from ffuf history
196 -sf Stop when > 95% of responses return 403 Forbidden (default: false)
197 -t Number of concurrent threads. (default: 40)
198 -v Verbose output, printing full URL and redirect location (if any) with the results. (default: false)
199
200 MATCHER OPTIONS:
201 -mc Match HTTP status codes, or "all" for everything. (default: 200-299,301,302,307,401,403,405,500)
202 -ml Match amount of lines in response
203 -mmode Matcher set operator. Either of: and, or (default: or)
204 -mr Match regexp
205 -ms Match HTTP response size
206 -mt Match how many milliseconds to the first response byte, either greater or less than. EG: >100 or <100
207 -mw Match amount of words in response
208
209 FILTER OPTIONS:
210 -fc Filter HTTP status codes from response. Comma separated list of codes and ranges
211 -fl Filter by amount of lines in response. Comma separated list of line counts and ranges
212 -fmode Filter set operator. Either of: and, or (default: or)
213 -fr Filter regexp
214 -fs Filter HTTP response size. Comma separated list of sizes and ranges
215 -ft Filter by number of milliseconds to the first response byte, either greater or less than. EG: >100 or <100
216 -fw Filter by amount of words in response. Comma separated list of word counts and ranges
217
218 INPUT OPTIONS:
219 -D DirSearch wordlist compatibility mode. Used in conjunction with -e flag. (default: false)
220 -e Comma separated list of extensions. Extends FUZZ keyword.
221 -enc Encoders for keywords, eg. 'FUZZ:urlencode b64encode'
222 -ic Ignore wordlist comments (default: false)
223 -input-cmd Command producing the input. --input-num is required when using this input method. Overrides -w.
224 -input-num Number of inputs to test. Used in conjunction with --input-cmd. (default: 100)
225 -input-shell Shell to be used for running command
226 -mode Multi-wordlist operation mode. Available modes: clusterbomb, pitchfork, sniper (default: clusterbomb)
227 -request File containing the raw http request
228 -request-proto Protocol to use along with raw request (default: https)
229 -w Wordlist file path and (optional) keyword separated by colon. eg. '/path/to/wordlist:KEYWORD'
230
231 OUTPUT OPTIONS:
232 -debug-log Write all of the internal logging to the specified file.
233 -o Write output to file
234 -od Directory path to store matched results to.
235 -of Output file format. Available formats: json, ejson, html, md, csv, ecsv (or, 'all' for all formats) (default: json)
236 -or Don't create the output file if we don't have results (default: false)
237
238 EXAMPLE USAGE:
239 Fuzz file paths from wordlist.txt, match all responses but filter out those with content-size 42.
240 Colored, verbose output.
241 ffuf -w wordlist.txt -u https://example.org/FUZZ -mc all -fs 42 -c -v
242
243 Fuzz Host-header, match HTTP 200 responses.
244 ffuf -w hosts.txt -u https://example.org/ -H "Host: FUZZ" -mc 200
245
246 Fuzz POST JSON data. Match all responses not containing text "error".
247 ffuf -w entries.txt -u https://example.org/ -X POST -H "Content-Type: application/json" \
248 -d '{"name": "FUZZ", "anotherkey": "anothervalue"}' -fr "error"
249
250 Fuzz multiple locations. Match only responses reflecting the value of "VAL" keyword. Colored.
251 ffuf -w params.txt:PARAM -w values.txt:VAL -u https://example.org/?PARAM=VAL -mr "VAL" -c
252
253 More information and examples: https://github.com/ffuf/ffuf
254 ```
255
256 ### Interactive mode
257
258 By pressing `ENTER` during ffuf execution, the process is paused and user is dropped to a shell-like interactive mode:
259 ```
260 entering interactive mode
261 type "help" for a list of commands, or ENTER to resume.
262 > help
263
264 available commands:
265 afc [value] - append to status code filter
266 fc [value] - (re)configure status code filter
267 afl [value] - append to line count filter
268 fl [value] - (re)configure line count filter
269 afw [value] - append to word count filter
270 fw [value] - (re)configure word count filter
271 afs [value] - append to size filter
272 fs [value] - (re)configure size filter
273 aft [value] - append to time filter
274 ft [value] - (re)configure time filter
275 rate [value] - adjust rate of requests per second (active: 0)
276 queueshow - show job queue
277 queuedel [number] - delete a job in the queue
278 queueskip - advance to the next queued job
279 restart - restart and resume the current ffuf job
280 resume - resume current ffuf job (or: ENTER)
281 show - show results for the current job
282 savejson [filename] - save current matches to a file
283 help - you are looking at it
284 >
285 ```
286
287 in this mode, filters can be reconfigured, queue managed and the current state saved to disk.
288
289 When (re)configuring the filters, they get applied posthumously and all the false positive matches from memory that
290 would have been filtered out by the newly added filters get deleted.
291
292 The new state of matches can be printed out with a command `show` that will print out all the matches as like they
293 would have been found by `ffuf`.
294
295 As "negative" matches are not stored to memory, relaxing the filters cannot unfortunately bring back the lost matches.
296 For this kind of scenario, the user is able to use the command `restart`, which resets the state and starts the current
297 job from the beginning.
298
299 <p align="center">
300 <img width="250" src="_img/ffuf_waving_250.png">
301 </p>
302
303 ## License
304
305 ffuf is released under MIT license. See [LICENSE](https://github.com/ffuf/ffuf/blob/master/LICENSE).