Web Tool - WFuzz

Naucz się hakować AWS od zera do bohatera z htARTE (HackTricks AWS Red Team Expert)!

Inne sposoby wsparcia HackTricks:

Narzędzie do FUZZowania aplikacji internetowych w dowolnym miejscu.

Wfuzz został stworzony w celu ułatwienia zadania w ocenie aplikacji internetowych i opiera się na prostym konceptcie: zastępuje każde wystąpienie słowa kluczowego FUZZ wartością określonego ładunku.

Instalacja

Zainstalowane w Kali

Github: https://github.com/xmendez/wfuzz

pip install wfuzz

Opcje filtrowania

Code (-c)

This option allows you to filter the response based on the HTTP status code. You can specify a single code or a range of codes using the syntax start-end. For example, -c 200 will only show responses with a status code of 200, while -c 200-299 will show responses with status codes ranging from 200 to 299.

Size (-s)

With this option, you can filter the response based on its size. You can specify a single size or a range of sizes using the syntax start-end. For example, -s 100 will only show responses with a size of 100 bytes, while -s 100-200 will show responses with sizes ranging from 100 to 200 bytes.

Words (-w)

This option allows you to filter the response based on the presence or absence of specific words. You can specify one or multiple words separated by commas. For example, -w admin,login will only show responses that contain either the word "admin" or the word "login".

Regex (-r)

With this option, you can filter the response based on a regular expression pattern. You can specify a single pattern or multiple patterns separated by commas. For example, -r ^[0-9]{3}$ will only show responses that match the pattern of three digits.

Follow Redirects (-F)

By default, wfuzz does not follow redirects. However, you can use this option to enable redirect following. This can be useful when testing for open redirects or when you want to see the response of the final redirected URL.

Hide Output (-H)

This option allows you to hide the output of the response. It can be useful when you only want to see the summary of the requests without cluttering the output with the actual response content.

Filter by Length (-L)

With this option, you can filter the response based on the length of a specific part of the response. You need to specify the part of the response to filter (e.g., H for headers, B for body) and the length or range of lengths to filter. For example, -L H,100 will only show responses with header lengths of 100 characters.

Filter by Time (-T)

This option allows you to filter the response based on the time it took to receive the response. You can specify a single time or a range of times using the syntax start-end. For example, -T 0.5 will only show responses that took 0.5 seconds to receive, while -T 0.5-1 will show responses that took between 0.5 and 1 second to receive.

--hs/ss "regex" #Hide/Show
#Simple example, match a string: "Invalid username"
#Regex example: "Invalid *"

--hc/sc CODE #Hide/Show by code in response
--hl/sl NUM #Hide/Show by number of lines in response
--hw/sw NUM #Hide/Show by number of words in response
--hh/sh NUM #Hide/Show by number of chars in response
--hc/sc NUM #Hide/Show by response code

Opcje wyjścia

Wfuzz provides several options for displaying the output of its scans. These options can be used to customize the format and level of detail in the output. The available output options are:

  • Quiet mode (-q): This option suppresses all output except for the final results. It is useful when you only want to see the final summary of the scan.

  • Verbose mode (-v): This option increases the level of detail in the output. It displays additional information about each request and response, including headers and status codes.

  • Colorized output (-c): This option adds color to the output, making it easier to read and interpret. Different colors are used to highlight different types of information, such as successful requests, errors, and redirects.

  • Output to a file (-o): This option allows you to save the output to a file instead of displaying it on the screen. You can specify the filename and path for the output file.

  • Output format (-f): This option allows you to specify the format of the output. Wfuzz supports various output formats, including HTML, XML, JSON, and CSV. You can choose the format that best suits your needs.

  • Output filtering (-x): This option allows you to filter the output based on specific criteria. You can use regular expressions to define the filtering rules and only display the relevant information.

By using these output options effectively, you can customize the way Wfuzz presents the results of your scans and make it easier to analyze and interpret the findings.

wfuzz -e printers #Prints the available output formats
-f /tmp/output,csv #Saves the output in that location in csv format

Opcje enkoderów

There are several encoding techniques that can be used during a penetration test to bypass security measures or obfuscate payloads. These techniques can help in evading detection and executing successful attacks. Here are some commonly used encoder options:

Base64 Encoding

Base64 encoding is a simple encoding technique that converts binary data into ASCII characters. It is commonly used to encode sensitive information such as credentials or command payloads. To use Base64 encoding with wfuzz, you can use the --encoding base64 option.

URL Encoding

URL encoding, also known as percent encoding, is used to encode special characters in a URL. This encoding replaces special characters with a '%' sign followed by two hexadecimal digits. To use URL encoding with wfuzz, you can use the --encoding url option.

HTML Encoding

HTML encoding is used to encode special characters in HTML documents. This encoding replaces special characters with their corresponding HTML entities. To use HTML encoding with wfuzz, you can use the --encoding html option.

Hex Encoding

Hex encoding, also known as hexadecimal encoding, converts binary data into a hexadecimal representation. Each byte is represented by two hexadecimal digits. To use hex encoding with wfuzz, you can use the --encoding hex option.

Unicode Encoding

Unicode encoding is used to represent characters that are not present in the ASCII character set. It allows the representation of characters from various languages and scripts. To use Unicode encoding with wfuzz, you can use the --encoding unicode option.

Double URL Encoding

Double URL encoding is a technique used to bypass security filters that decode URL-encoded data before processing it. It involves encoding the URL-encoded data again. To use double URL encoding with wfuzz, you can use the --encoding double-url option.

These encoding options can be used with wfuzz to test the effectiveness of security measures and identify vulnerabilities in web applications.

wfuzz -e encoders #Prints the available encoders
#Examples: urlencode, md5, base64, hexlify, uri_hex, doble urlencode

Aby użyć enkodera, musisz go wskazać w opcji "-w" lub "-z".

Przykłady:

-z file,/path/to/file,md5 #Will use a list inside the file, and will transform each value into its md5 hash before sending it
-w /path/to/file,base64 #Will use a list, and transform to base64
-z list,each-element-here,hexlify #Inline list and to hex before sending values

CheetSheet

Bruteforce formularza logowania

POST, Jedna lista, filtrowanie ciągu znaków (ukryte)

wfuzz -c -w users.txt --hs "Login name" -d "name=FUZZ&password=FUZZ&autologin=1&enter=Sign+in" http://zipper.htb/zabbix/index.php
#Here we have filtered by line

POST, 2 listy, kod filtrujący (pokaż)

wfuzz.py -c -z file,users.txt -z file,pass.txt --sc 200 -d "name=FUZZ&password=FUZ2Z&autologin=1&enter=Sign+in" http://zipper.htb/zabbix/index.php
#Here we have filtered by code

GET, 2 listy, filtrowanie ciągu znaków (pokaż), proxy, ciasteczka


Wfuzz is a web application brute forcer that allows you to perform complex brute force attacks by combining different HTTP parameters. It can be used to discover hidden files and directories, identify vulnerabilities, and test the security of web applications.

Wfuzz supports various features that can enhance your brute force attacks. In this section, we will explore some of these features:

  1. GET Requests: Wfuzz allows you to send GET requests to the target web application. This is useful for testing the functionality of different endpoints and parameters.

  2. 2 Lists: Wfuzz allows you to use two lists simultaneously. This can be helpful when you want to test multiple parameters or values at the same time.

  3. Filter String (Show): Wfuzz provides the ability to filter the response based on a specific string. This can be useful for identifying successful brute force attempts or finding specific content in the response.

  4. Proxy: Wfuzz supports proxy functionality, allowing you to route your requests through a proxy server. This can help you hide your identity or bypass certain restrictions.

  5. Cookies: Wfuzz allows you to include cookies in your requests. This can be useful for testing web applications that rely on session cookies or authentication mechanisms.

By leveraging these features, you can customize your brute force attacks and increase your chances of finding vulnerabilities in web applications.

wfuzz -c -w users.txt -w pass.txt --ss "Welcome " -p 127.0.0.1:8080:HTTP -b "PHPSESSIONID=1234567890abcdef;customcookie=hey" "http://example.com/index.php?username=FUZZ&password=FUZ2Z&action=sign+in"

Bruteforce katalogu/Bruteforce RESTful

Arjun lista słów kluczowych

wfuzz -c -w /tmp/tmp/params.txt --hc 404 https://domain.com/api/FUZZ

Przegląd

Atak Brute Force na parametry ścieżki (Path Parameters Brute Force) polega na próbie odgadnięcia wartości parametrów ścieżki w celu odkrycia ukrytych zasobów lub wykonania nieautoryzowanych operacji. W tym ataku, narzędzie WFuzz jest używane do automatycznego testowania różnych wartości parametrów ścieżki w celu znalezienia tych, które prowadzą do pożądanych rezultatów.

Sposób użycia narzędzia WFuzz

Narzędzie WFuzz jest wykorzystywane do przeprowadzania ataków Brute Force na parametry ścieżki. Poniżej przedstawiono przykładową komendę używaną do tego celu:

wfuzz -c -z file,/path/to/wordlist.txt http://example.com/FUZZ

W powyższym poleceniu:

  • -c oznacza, że narzędzie WFuzz ma kontynuować, nawet jeśli otrzyma błąd HTTP 404 (Not Found).

  • -z file,/path/to/wordlist.txt wskazuje, że narzędzie WFuzz ma używać pliku wordlist.txt jako źródła wartości do testowania.

  • http://example.com/FUZZ określa adres URL, w którym parametr ścieżki jest oznaczony jako FUZZ. Narzędzie WFuzz automatycznie zastąpi FUZZ różnymi wartościami z pliku wordlist.txt.

Przykład użycia

Przykład użycia narzędzia WFuzz do ataku Brute Force na parametry ścieżki może wyglądać następująco:

wfuzz -c -z file,/path/to/wordlist.txt http://example.com/api/users/FUZZ

W powyższym przykładzie, narzędzie WFuzz automatycznie zastąpi FUZZ różnymi wartościami z pliku wordlist.txt i przetestuje każdą wartość w celu znalezienia ukrytych zasobów lub wykonania nieautoryzowanych operacji na ścieżce /api/users/.

wfuzz -c -w ~/git/Arjun/db/params.txt --hw 11 'http://example.com/path%3BFUZZ=FUZZ'

Podstawowa autoryzacja, 2 listy, filtrowanie ciągu znaków (pokaż), proxy

W przypadku ataków na autoryzację nagłówka, możemy użyć narzędzia wfuzz do przetestowania różnych kombinacji nazw użytkowników i haseł. Możemy również użyć dwóch list: jednej z nazwami użytkowników i drugiej z hasłami.

Aby filtrować wyniki, możemy użyć opcji --filter wraz z ciągiem znaków, które chcemy wyświetlić. Na przykład, jeśli chcemy wyświetlić tylko te wyniki, które zawierają słowo "sukces", możemy użyć --filter "success".

Jeśli chcemy przeprowadzić atak przez proxy, możemy użyć opcji --proxy wraz z adresem proxy. Na przykład, --proxy http://proxy.example.com:8080.

wfuzz -c -w users.txt -w pass.txt -p 127.0.0.1:8080:HTTP --ss "Welcome" --basic FUZZ:FUZ2Z "http://example.com/index.php"

NTLM, 2 listy, filtruj ciąg (pokaż), proxy

wfuzz -c -w users.txt -w pass.txt -p 127.0.0.1:8080:HTTP --ss "Welcome" --ntlm 'domain\FUZZ:FUZ2Z' "http://example.com/index.php"
wfuzz -c -w users.txt -p 127.0.0.1:8080:HTTP --ss "Welcome " -H "Cookie:id=1312321&user=FUZZ"  "http://example.com/index.php"

User-Agent, filtruj kod (ukryj), proxy

W przypadku testowania aplikacji internetowych, często konieczne jest zmienienie wartości nagłówka User-Agent, aby symulować różne przeglądarki lub urządzenia. Wfuzz umożliwia to za pomocą opcji --ua lub --user-agent. Można podać dowolną wartość User-Agent, która zostanie wysłana w żądaniach.

Przykład użycia:

wfuzz -c -z file,/usr/share/wfuzz/wordlist/general/user-agents.txt --ua FUZZ http://example.com

W powyższym przykładzie, --ua FUZZ oznacza, że Wfuzz będzie używał wartości z pliku user-agents.txt jako User-Agent w żądaniach.

Można również filtrować odpowiedzi serwera, aby ukryć niechciane treści. Wfuzz umożliwia to za pomocą opcji --filter. Można podać dowolne wyrażenie regularne, które zostanie zastosowane do odpowiedzi serwera. Wszystkie odpowiedzi, które nie pasują do wyrażenia regularnego, zostaną ukryte.

Przykład użycia:

wfuzz -c --filter "200 OK" http://example.com/FUZZ

W powyższym przykładzie, --filter "200 OK" oznacza, że Wfuzz będzie ukrywał wszystkie odpowiedzi, które nie zawierają frazy "200 OK".

Wfuzz obsługuje również użycie proxy. Można to zrobić za pomocą opcji --proxy. Można podać adres IP i port proxy, który zostanie użyty do wysyłania żądań.

Przykład użycia:

wfuzz -c --proxy 127.0.0.1:8080 http://example.com/FUZZ

W powyższym przykładzie, --proxy 127.0.0.1:8080 oznacza, że Wfuzz będzie używał proxy o adresie IP 127.0.0.1 i porcie 8080 do wysyłania żądań.

wfuzz -c -w user-agents.txt -p 127.0.0.1:8080:HTTP --ss "Welcome " -H "User-Agent: FUZZ"  "http://example.com/index.php"

Host

wfuzz -c -w /usr/share/wordlists/SecLists/Discovery/DNS/subdomains-
top1million-20000.txt --hc 400,404,403 -H "Host: FUZZ.example.com" -u
http://example.com -t 100

Używanie pliku

W przypadku ataku bruteforce na metody HTTP można użyć pliku, który zawiera listę możliwych metod. W tym celu można skorzystać z narzędzia wfuzz. Poniżej przedstawiono przykład użycia tego narzędzia:

wfuzz -c -z file,methods.txt http://example.com/FUZZ

W powyższym przykładzie methods.txt to plik zawierający listę metod HTTP, które zostaną przetestowane w ataku bruteforce. FUZZ jest zmienną, która zostanie zastąpiona przez każdą metodę z listy podczas wykonywania ataku.

wfuzz -c -w methods.txt -p 127.0.0.1:8080:HTTP --sc 200 -X FUZZ "http://example.com/index.php"

Używanie listy w linii

Sometimes, when fuzzing a web application, you may want to use a list of values as payloads for a specific parameter. Instead of specifying each value individually, you can use the @ symbol followed by the path to a file containing the list of values.

Czasami, podczas fuzzowania aplikacji internetowej, możesz chcieć użyć listy wartości jako payloadów dla określonego parametru. Zamiast podawać każdą wartość indywidualnie, możesz użyć symbolu @, a następnie ścieżki do pliku zawierającego listę wartości.

For example, let's say you have a parameter called username and you want to fuzz it with a list of common usernames. You can create a file called usernames.txt with the following content:

Na przykład, załóżmy, że masz parametr o nazwie username i chcesz go fuzzować za pomocą listy powszechnych nazw użytkowników. Możesz utworzyć plik o nazwie usernames.txt o następującej zawartości:

admin
root
user
test

Then, you can use the @ symbol followed by the path to the file as the payload for the username parameter:

Następnie możesz użyć symbolu @, a następnie ścieżki do pliku jako payload dla parametru username:

wfuzz -u http://example.com/login.php?username=FUZZ -w usernames.txt

This will fuzz the username parameter with each value from the usernames.txt file.

To spowoduje fuzzowanie parametru username za pomocą każdej wartości z pliku usernames.txt.

$ wfuzz -z list,GET-HEAD-POST-TRACE-OPTIONS -X FUZZ http://testphp.vulnweb.com/

Bruteforce katalogów i plików

Wfuzz jest narzędziem do bruteforce'owania katalogów i plików na stronach internetowych. Pozwala na przetestowanie wielu kombinacji nazw plików i katalogów w celu znalezienia ukrytych zasobów.

Składnia

wfuzz -c -z file,<wordlist> --hc <response_code> <target_url>/<FUZZ>

Wyjaśnienie składni

  • -c - opcja sprawia, że wfuzz zatrzymuje się na pierwszym trafieniu

  • -z file,<wordlist> - opcja określająca, że używamy pliku z listą słów do bruteforce'owania

  • --hc <response_code> - opcja określająca kod odpowiedzi, który oznacza, że trafiliśmy na istniejący zasób

  • <target_url> - adres URL docelowej strony internetowej

  • <FUZZ> - zmienna, która będzie zastąpiona przez słowa z listy słów

Przykład użycia

wfuzz -c -z file,wordlist.txt --hc 200 https://example.com/FUZZ

W powyższym przykładzie, wfuzz będzie próbował znaleźć istniejące pliki lub katalogi na stronie https://example.com, zastępując <FUZZ> słowami z pliku wordlist.txt. Jeśli trafimy na zasób z kodem odpowiedzi 200, wfuzz zatrzyma się.

#Filter by whitelisting codes
wfuzz -c -z file,/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt --sc 200,202,204,301,302,307,403 http://example.com/uploads/FUZZ

Narzędzie do omijania stron internetowych

https://github.com/carlospolop/fuzzhttpbypass

Naucz się hakować AWS od zera do bohatera z htARTE (HackTricks AWS Red Team Expert)!

Inne sposoby wsparcia HackTricks:

Last updated