用 Go 寫的快速網路模糊器。
從發布頁面下載預先建置的二進位文件,解壓縮並運行!
或者
如果您使用的是自製軟體 macOS,則可以使用以下命令安裝 ffuf: brew install ffuf
或者
如果您最近安裝了 go 編譯器: go install github.com/ffuf/ffuf/v2@latest
(相同的指令適用於更新)
或者
git clone https://github.com/ffuf/ffuf ; cd ffuf ; go get ; go build
FFuf 依賴 Go 1.16 或更高版本。
下面的用法範例僅顯示了使用ffuf
可以完成的最簡單的任務。
ffuf wiki 中提供了更詳細的文檔,其中包含許多功能和範例,網址為:https://github.com/ffuf/ffuf/wiki
如需更詳細的文件以及現實生活中的使用範例和提示,請務必查看精彩指南:Michael Skelton (@codingo) 撰寫的「關於 FFUF 您需要了解的一切」。
您也可以透過不同的課程和用例在本地使用 docker 容器 https://github.com/adamtlangley/ffufme 或針對 http://ffuf.me 建立的即時託管版本練習 ffuf 掃描。 adamtlangley。
透過在 URL 末尾使用 FUZZ 關鍵字 ( -u
):
ffuf -w /path/to/wordlist -u https://target/FUZZ
假設預設的虛擬主機回應大小為 4242 字節,我們可以在模糊 Host - 標頭時過濾掉該大小的所有回應( -fs 4242
):
ffuf -w /path/to/vhost/wordlist -u https://target -H "Host: FUZZ" -fs 4242
GET 參數名稱模糊測試與目錄發現非常相似,透過將FUZZ
關鍵字定義為 URL 的一部分來運作。這也假設無效 GET 參數名稱的回應大小為 4242 位元組。
ffuf -w /path/to/paramnames.txt -u https://target/script.php?FUZZ=test_value -fs 4242
如果參數名稱已知,則可以以相同的方式對值進行模糊測試。此範例假設錯誤的參數值回傳 HTTP 回應代碼 401。
ffuf -w /path/to/values.txt -u https://target/script.php?valid_name=FUZZ -fc 401
這是一個非常簡單的操作,再次使用FUZZ
關鍵字。此範例僅模糊 POST 請求的一部分。我們再次過濾掉 401 響應。
ffuf -w /path/to/postdata.txt -X POST -d "username=admin&password=FUZZ" -u https://target/login.php -fc 401
如果您不希望 ffuf 無限期地運行,可以使用-maxtime
。這將在給定時間(以秒為單位)後停止整個過程。
ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime 60
使用遞歸時,您可以使用-maxtime-job
控制每個作業的最大時間。這將在給定時間(以秒為單位)後停止當前作業並繼續下一個作業。當遞歸功能偵測到子目錄時,就會建立新作業。
ffuf -w /path/to/wordlist -u https://target/FUZZ -maxtime-job 60 -recursion -recursion-depth 2
也可以組合兩個標誌來限制每個作業的最大執行時間以及總體執行時間。如果不使用遞歸,則兩個標誌的行為相同。
在此範例中,我們將對透過 POST 發送的 JSON 資料進行模糊測試。 Radamsa 被用作突變子。
當使用--input-cmd
時,ffuf 將顯示匹配項作為其位置。相同的位置值將作為環境變數$FFUF_NUM
可供被呼叫者使用。我們將使用這個位置值作為變異器的種子。檔案 example1.txt 和 example2.txt 包含有效的 JSON 負載。我們匹配所有回應,但過濾掉回應代碼400 - Bad request
:
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
當然,為每個有效負載呼叫 mutator 的效率不是很高,因此我們也可以預先產生有效負載,仍然以 Radamsa 為例:
# Generate 1000 example payloads
radamsa -n 1000 -o %n.txt example1.txt example2.txt
# This results into files 1.txt ... 1000.txt
# Now we can just read the payload data in a loop from file for ffuf
ffuf --input-cmd 'cat $FFUF_NUM.txt' -H "Content-Type: application/json" -X POST -u https://ffuf.io.fi/ -mc all -fc 400
執行 ffuf 時,它首先檢查預設設定檔是否存在。 ffufrc
檔案的預設路徑是$XDG_CONFIG_HOME/ffuf/ffufrc
。您可以在此文件中配置一個或多個選項,它們將套用於後續的每個 ffuf 作業。 ffufrc 檔案的範例可以在此處找到。
有關設定檔位置的更詳細描述可以在 wiki 中找到:https://github.com/ffuf/ffuf/wiki/Configuration
命令列上提供的設定選項會覆蓋從預設ffufrc
檔案載入的設定選項。注意:這不適用於可以多次提供的 CLI 標誌。這樣的例子之一是-H
(標頭)標誌。在這種情況下,命令列上提供的-H
值將附加到設定檔中的值。
此外,如果您希望針對不同的用例使用一堆配置文件,您可以透過使用-config
命令列標誌定義設定檔路徑來實現此目的,該標誌將設定檔的檔案路徑作為其參數。
若要定義 ffuf 的測試案例,請在 URL ( -u
)、標頭 ( -H
) 或 POST 資料 ( -d
) 中的任意位置使用關鍵字FUZZ
。
Fuzz Faster U Fool - v2.1.0
HTTP OPTIONS:
-H Header `"Name: Value"`, separated by colon. Multiple -H flags are accepted.
-X HTTP method to use
-b Cookie data `"NAME1=VALUE1; NAME2=VALUE2"` for copy as curl functionality.
-cc Client cert for authentication. Client key needs to be defined as well for this to work
-ck Client key for authentication. Client certificate needs to be defined as well for this to work
-d POST data
-http2 Use HTTP2 protocol (default: false)
-ignore-body Do not fetch the response content. (default: false)
-r Follow redirects (default: false)
-raw Do not encode URI (default: false)
-recursion Scan recursively. Only FUZZ keyword is supported, and URL (-u) has to end in it. (default: false)
-recursion-depth Maximum recursion depth. (default: 0)
-recursion-strategy Recursion strategy: "default" for a redirect based, and "greedy" to recurse on all matches (default: default)
-replay-proxy Replay matched requests using this proxy.
-sni Target TLS SNI, does not support FUZZ keyword
-timeout HTTP request timeout in seconds. (default: 10)
-u Target URL
-x Proxy URL (SOCKS5 or HTTP). For example: http://127.0.0.1:8080 or socks5://127.0.0.1:8080
GENERAL OPTIONS:
-V Show version information. (default: false)
-ac Automatically calibrate filtering options (default: false)
-acc Custom auto-calibration string. Can be used multiple times. Implies -ac
-ach Per host autocalibration (default: false)
-ack Autocalibration keyword (default: FUZZ)
-acs Custom auto-calibration strategies. Can be used multiple times. Implies -ac
-c Colorize output. (default: false)
-config Load configuration from a file
-json JSON output, printing newline-delimited JSON records (default: false)
-maxtime Maximum running time in seconds for entire process. (default: 0)
-maxtime-job Maximum running time in seconds per job. (default: 0)
-noninteractive Disable the interactive console functionality (default: false)
-p Seconds of `delay` between requests, or a range of random delay. For example "0.1" or "0.1-2.0"
-rate Rate of requests per second (default: 0)
-s Do not print additional information (silent mode) (default: false)
-sa Stop on all error cases. Implies -sf and -se. (default: false)
-scraperfile Custom scraper file path
-scrapers Active scraper groups (default: all)
-se Stop on spurious errors (default: false)
-search Search for a FFUFHASH payload from ffuf history
-sf Stop when > 95% of responses return 403 Forbidden (default: false)
-t Number of concurrent threads. (default: 40)
-v Verbose output, printing full URL and redirect location (if any) with the results. (default: false)
MATCHER OPTIONS:
-mc Match HTTP status codes, or "all" for everything. (default: 200-299,301,302,307,401,403,405,500)
-ml Match amount of lines in response
-mmode Matcher set operator. Either of: and, or (default: or)
-mr Match regexp
-ms Match HTTP response size
-mt Match how many milliseconds to the first response byte, either greater or less than. EG: >100 or <100
-mw Match amount of words in response
FILTER OPTIONS:
-fc Filter HTTP status codes from response. Comma separated list of codes and ranges
-fl Filter by amount of lines in response. Comma separated list of line counts and ranges
-fmode Filter set operator. Either of: and, or (default: or)
-fr Filter regexp
-fs Filter HTTP response size. Comma separated list of sizes and ranges
-ft Filter by number of milliseconds to the first response byte, either greater or less than. EG: >100 or <100
-fw Filter by amount of words in response. Comma separated list of word counts and ranges
INPUT OPTIONS:
-D DirSearch wordlist compatibility mode. Used in conjunction with -e flag. (default: false)
-e Comma separated list of extensions. Extends FUZZ keyword.
-enc Encoders for keywords, eg. 'FUZZ:urlencode b64encode'
-ic Ignore wordlist comments (default: false)
-input-cmd Command producing the input. --input-num is required when using this input method. Overrides -w.
-input-num Number of inputs to test. Used in conjunction with --input-cmd. (default: 100)
-input-shell Shell to be used for running command
-mode Multi-wordlist operation mode. Available modes: clusterbomb, pitchfork, sniper (default: clusterbomb)
-request File containing the raw http request
-request-proto Protocol to use along with raw request (default: https)
-w Wordlist file path and (optional) keyword separated by colon. eg. '/path/to/wordlist:KEYWORD'
OUTPUT OPTIONS:
-debug-log Write all of the internal logging to the specified file.
-o Write output to file
-od Directory path to store matched results to.
-of Output file format. Available formats: json, ejson, html, md, csv, ecsv (or, 'all' for all formats) (default: json)
-or Don't create the output file if we don't have results (default: false)
EXAMPLE USAGE:
Fuzz file paths from wordlist.txt, match all responses but filter out those with content-size 42.
Colored, verbose output.
ffuf -w wordlist.txt -u https://example.org/FUZZ -mc all -fs 42 -c -v
Fuzz Host-header, match HTTP 200 responses.
ffuf -w hosts.txt -u https://example.org/ -H "Host: FUZZ" -mc 200
Fuzz POST JSON data. Match all responses not containing text "error".
ffuf -w entries.txt -u https://example.org/ -X POST -H "Content-Type: application/json"
-d '{"name": "FUZZ", "anotherkey": "anothervalue"}' -fr "error"
Fuzz multiple locations. Match only responses reflecting the value of "VAL" keyword. Colored.
ffuf -w params.txt:PARAM -w values.txt:VAL -u https://example.org/?PARAM=VAL -mr "VAL" -c
More information and examples: https://github.com/ffuf/ffuf
在 ffuf 執行期間按下ENTER
,進程將暫停,使用者將進入類似 shell 的交互模式:
entering interactive mode
type "help" for a list of commands, or ENTER to resume.
> help
available commands:
afc [value] - append to status code filter
fc [value] - (re)configure status code filter
afl [value] - append to line count filter
fl [value] - (re)configure line count filter
afw [value] - append to word count filter
fw [value] - (re)configure word count filter
afs [value] - append to size filter
fs [value] - (re)configure size filter
aft [value] - append to time filter
ft [value] - (re)configure time filter
rate [value] - adjust rate of requests per second (active: 0)
queueshow - show job queue
queuedel [number] - delete a job in the queue
queueskip - advance to the next queued job
restart - restart and resume the current ffuf job
resume - resume current ffuf job (or: ENTER)
show - show results for the current job
savejson [filename] - save current matches to a file
help - you are looking at it
>
在此模式下,可以重新配置過濾器、管理佇列並將目前狀態儲存到磁碟。
當(重新)配置過濾器時,它們會在死後套用,並且記憶體中本應被新添加的過濾器過濾掉的所有誤報匹配都將被刪除。
可以使用指令show
列印出匹配的新狀態,該指令將列印出所有匹配,就像ffuf
找到它們一樣。
由於「負」匹配不會儲存到記憶體中,因此放鬆過濾器無法不幸地找回遺失的匹配。對於這種情況,使用者可以使用命令restart
,該命令重置狀態並從頭開始當前作業。
ffuf 是根據 MIT 許可發布的。請參閱許可證。