模糊测试fuff工具
模糊测试是把各种类型的输入发送到某个web页面,研究页面的反应。常见的模糊测试例如对SQL注入漏洞进行测试,对缓冲区溢出测试等等。
什么是模糊测试(Fuzzing)?
把各种类型的输入发送到某个web页面,研究页面的反应。常见的模糊测试例如对SQL注入漏洞进行测试,对缓冲区溢出测试等等。
目的是测试出有效的页面内容。
模糊测试需要准备什么?
1. 单词列表(WordList):包括web目录和页面常用单词。GitHub SecLists
常见的几个单词列表
| /opt/useful/SecLists/Discovery/Web-Content/directory-list-2.3-small.txt | web目录和页面 |
| /opt/useful/SecLists/Discovery/Web-Content/web-extensions.txt | web扩展名/后缀 |
|/opt/useful/SecLists/Discovery/DNS/subdomains-top1million-5000.txt|子域名|
|/opt/useful/SecLists/Discovery/Web-Content/burp-parameter-names.txt|web传递参数|
|/opt/useful/SecLists/Usernames/xato-net-10-million-usernames.txt|用户名|
2. DNS查询记录
直接访问IP,浏览器直接访问IP
域名,优先查找本地/etc/hosts文件;无则向公共DNS询问(例如Google的DNS8.8.8.8)。若不是公共网站则无法连接。
添加DNS记录到本地文件
sudo sh -c 'echo "IP DOMAIN" >> /etc/hosts'
Fuff如何使用?
安装
apt install ffuf -y
帮助
ffuf -h
设置线程(不建议,线程过高可能导致拒绝服务,甚至关闭连接)
ffuf -t 200
筛选错误返回包大小
ffuf -fs 900
扩展名模糊测试(extension fuzzing)
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/web-extensions.txt:FUZZ -u http://IP:PORT/目录/indexFUZZ
递归模糊测试(recursive fuzzing)/目录模糊测试(directory fuzzing)和页面模糊测试(page fuzzing)
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u http://IP:PORT/FUZZ -recursion -recursion-depth 1 -e .php -v
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u http://IP:PORT/FUZZ
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/directory-list-2.3-small.txt:FUZZ -u http://IP:PORT/目录/FUZZ.后缀名
子域模糊测试(sub-domain fuzzing)/虚拟主机模糊测试(Vhost fuzzing)
ffuf -w /opt/useful/SecLists/Discovery/DNS/subdomains-top1million-5000.txt:FUZZ -u http://FUZZ.DOMAIN:PORT
vhost是同一台服务器上提供服务并且具有相同IP的子域名
ffuf -w /opt/useful/SecLists/Discovery/DNS/subdomains-top1million-5000.txt:FUZZ -u http://DOMAIN:PORT -H 'Host:FUZZ.DOMAIN'
参数模糊测试(parameter fuzzing-GET)
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -w http://DOMAIN:PORT/目录/文件名.后缀名?FUZZ=KEY -fs 900
参数模糊测试(parameter fuzzing-POST)
ffuf -w /opt/useful/SecLists/Discovery/Web-Content/burp-parameter-names.txt:FUZZ -w http://DOMAIN:PORT/目录/文件名.后缀名 -X POST -d 'FUZZ=KEY' -H 'Content-Type: application/x-www-form-urlencoded' -fs 900
注意:获取POST页面内容
curl http://DOMAIN:PORT/目录/文件名.后缀名 -X POST -d 'id=key' -H 'Content-Type: application/x-www-form-urlencoded'
值模糊测试(value fuzzing)
ffuf -w /opt/useful/SecLists/Usernames/xato-net-10-million-usernames.txt:FUZZ -u http://DOMIAN:PORT/目录/文件名.后缀名 -X POST -d 'id=FUZZ' -H 'Content-Type: application/x-www-form-urlencoded' -fs 900