hacktricks/pentesting-web/web-tool-wfuzz.md

147 lines
4 KiB
Markdown
Raw Normal View History

# Web Tool - WFuzz
A tool to FUZZ web applications anywhere.
> Wfuzz has been created to facilitate the task in web applications assessments and it is based on a simple concept: it replaces any reference to the FUZZ keyword by the value of a given payload.
## Installation
Installed in Kali
Github: [https://github.com/xmendez/wfuzz](https://github.com/xmendez/wfuzz)
```text
pip install wfuzz
```
## Filtering options
```bash
--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 #ide/Show by number of lines in response
--hw/sw NUM #ide/Show by number of words in response
--hc/sc NUM #ide/Show by number of chars in response
```
## Output options
```bash
wfuzz -e printers #Prints the available output formats
-f /tmp/output,csv #Saves the output in that location in csv format
```
### Encoders options
```bash
wfuzz -e encoders #Prints the available encoders
#Examples: urlencode, md5, base64, hexlify, uri_hex, doble urlencode
```
In order to use a encoder, you have to indicate it in the **"-w"** or **"-z"** option.
Examples:
2020-12-01 15:32:24 +00:00
```bash
-z file,/path/to/file,md5 #Will use a list inside the file, and will trnasform each value into its md5 hash before sending it
-w /path/to/file,base64 #Will use a list, and transforms to base64
-z list,each-element-here,hexlify #Inline list and to hex before sending values
```
## CheetSheet
### Login Form bruteforce
#### **POST, Single list, filter string \(hide\)**
```bash
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 lists, filder code \(show\)**
```bash
wfuzz.py -c -z file,users.txt -z file,pass.txt --sc 200 h"name=FUZZ&password=FUZ2Z&autologin=1&enter=Sign+in" http://zipper.htb/zabbix/index.php
#Here we have filtered by code
```
#### **GET, 2 lists, filter string \(show\), proxy, cookies**
```text
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 Dicrectory/RESTful bruteforce
[Arjun parameters wordlist](https://raw.githubusercontent.com/s0md3v/Arjun/master/db/params.txt)
```text
wfuzz -c -w /tmp/tmp/params.txt --hc 404 https://domain.com/api/FUZZ
```
### Header Authentication
#### **Basic, 2 lists, filter string \(show\), proxy**
```text
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 lists, filter string \(show\), proxy**
```text
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"
```
### Cookie/Header bruteforce \(vhost brute\)
#### **Cookie, filter code \(show\), proxy**
```text
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, filter code \(hide\), proxy**
```text
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**
```text
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
```
### HTTP Verbs \(methods\) bruteforce
#### **Using file**
```text
wfuzz -c -w methods.txt -p 127.0.0.1:8080:HTTP --sc 200 -X FUZZ "http://example.com/index.php"
```
#### **Using inline list**
```text
$ wfuzz -z list,GET-HEAD-POST-TRACE-OPTIONS -X FUZZ http://testphp.vulnweb.com/
```
### Directory & Files Bruteforce
```text
#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
```
## Tool to bypass Webs
[https://github.com/carlospolop/fuzzhttpbypass](https://github.com/carlospolop/fuzzhttpbypass)