Afuzz:一款功能强大的自动化Web路径模糊测试工具

关于Afuzz

Afuzz是一款功能强大的自动化Web路径模糊测试工具,该工具专为Web安全专家和漏洞奖励Hunter设计,可以帮助我们以自动化的形式扫描和收集目标Web应用程序中的页面、语言和相关统计分析等数据。

功能介绍

1、Afuzz可以通过自动化的形式检测目标Web应用程序所使用的开发语言;

2、使用黑名单过滤无效页面;

3、使用白名单寻找漏洞奖励Hunter感兴趣的页面内容;

4、过滤页面中的随机内容;

5、以多种方式判断404错误页面;

6、扫描完成后执行统计数据分析,并生成最终的结果;

7、支持HTTP2;

工具安装

由于该工具基于Python开发,因此我们首先需要在本地设备上安装并配置好Python环境。接下来,广大研究人员可以直接使用下列命令将该项目源码克隆至本地:

代码语言:javascript
复制
git clone https://github.com/rapiddns/Afuzz.git

然后切换到项目目录中,使用pip工具和项目提供的requirements.txt文件安装该工具所需的其他依赖组件:

代码语言:javascript
复制
cd Afuzz

pip install -r requirements.txt

依赖组件安装完成后,执行下列安装脚本即可:

代码语言:javascript
复制
python setup.py install

除此之外,我们还可以直接使用pip工具安装Afuzz:

代码语言:javascript
复制
pip install afuzz

工具选项

参数解释

代码语言:javascript
复制
-h, --help             显示工具帮助信息和退出

-u URL, --url URL 设置目标URL

-o OUTPUT, --output OUTPUT

                    输出文件路径

-e EXTENSIONS, --extensions EXTENSIONS

                    扩展列表,逗号分隔 (例如: php,aspx,jsp)

-t THREAD, --thread THREAD

                    线程数量

-d DEPTH, --depth DEPTH

                    最大递归深度

-w WORDLIST, --wordlist WORDLIST

                    字典文件路径

-f, --fullpath 完整路径

-p PROXY, --proxy PROXY

                    代理, (例如:http://127.0.0.1:8080)</code></pre></div></div><h3 id="b83no" name="%EF%BC%88%E5%8F%B3%E6%BB%91%E6%9F%A5%E7%9C%8B%E6%9B%B4%E5%A4%9A%EF%BC%89">(右滑查看更多)</h3><p><strong>工具运行</strong></p><h4 id="ea1j7" name="%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4"><u><strong>使用命令</strong></u></h4><div class="rno-markdown-code"><div class="rno-markdown-code-toolbar"><div class="rno-markdown-code-toolbar-info"><div class="rno-markdown-code-toolbar-item is-type"><span class="is-m-hidden">代码语言:</span>javascript</div></div><div class="rno-markdown-code-toolbar-opt"><div class="rno-markdown-code-toolbar-copy"><i class="icon-copy"></i><span class="is-m-hidden">复制</span></div></div></div><div class="developer-code-block"><pre class="prism-token token line-numbers language-javascript"><code class="language-javascript" style="margin-left:0">afuzz -u https://target

afuzz -e php,html,js,json -u https://target
afuzz -e php,html,js -u https://target -d 3

多线程使用

代码语言:javascript
复制
afuzz -e aspx,jsp,php,htm,js,bak,zip,txt,xml -u https://target -t 50

工具运行样例

代码语言:javascript
复制
afuzz -u http://testphp.vulnweb.com -t 30

扫描结果

数据表

代码语言:javascript
复制
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

|                                                                                    http://testphp.vulnweb.com/                                                                                    |

+-----------------------------+---------------------+--------+-----------------------------------+-----------------------+--------+--------------------------+-------+-------+-----------+----------+

|            target           |         path        | status |              redirect             |         title         | length |       content-type       | lines | words |    type   |   mark   |

+-----------------------------+---------------------+--------+-----------------------------------+-----------------------+--------+--------------------------+-------+-------+-----------+----------+

| http://testphp.vulnweb.com/ | .idea/workspace.xml |  200   |                                   |                       | 12437  |         text/xml         |  217  |  774  |   check   |          |

| http://testphp.vulnweb.com/ |        admin        |  301   | http://testphp.vulnweb.com/admin/ | 301 Moved Permanently |  169   |        text/html         |   8   |   11  |   folder  |   30x    |

| http://testphp.vulnweb.com/ |      login.php      |  200   |                                   |       login page      |  5009  |        text/html         |  120  |  432  |   check   |          |

| http://testphp.vulnweb.com/ |     .idea/.name     |  200   |                                   |                       |   6    | application/octet-stream |   1   |   1   |   check   |          |

| http://testphp.vulnweb.com/ |    .idea/vcs.xml    |  200   |                                   |                       |  173   |         text/xml         |   8   |   13  |   check   |          |

| http://testphp.vulnweb.com/ |        .idea/       |  200   |                                   |    Index of /.idea/   |  937   |        text/html         |   14  |   46  | whitelist | index of |

| http://testphp.vulnweb.com/ |       cgi-bin/      |  403   |                                   |     403 Forbidden     |  276   |        text/html         |   10  |   28  |   folder  |   403    |

| http://testphp.vulnweb.com/ | .idea/encodings.xml |  200   |                                   |                       |  171   |         text/xml         |   6   |   11  |   check   |          |

| http://testphp.vulnweb.com/ |      search.php     |  200   |                                   |         search        |  4218  |        text/html         |  104  |  364  |   check   |          |

| http://testphp.vulnweb.com/ |     product.php     |  200   |                                   |    picture details    |  4576  |        text/html         |  111  |  377  |   check   |          |

| http://testphp.vulnweb.com/ |        admin/       |  200   |                                   |    Index of /admin/   |  248   |        text/html         |   8   |   16  | whitelist | index of |

| http://testphp.vulnweb.com/ |        .idea        |  301   | http://testphp.vulnweb.com/.idea/ | 301 Moved Permanently |  169   |        text/html         |   8   |   11  |   folder  |   30x    |

+-----------------------------+---------------------+--------+-----------------------------------+-----------------------+--------+--------------------------+-------+-------+-----------+----------+```

(右滑查看更多)

JSON格式数据

代码语言:javascript
复制
{
&#34;result&#34;: [

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea/workspace.xml&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;&#34;,

        &#34;length&#34;: 12437,

        &#34;content_type&#34;: &#34;text/xml&#34;,

        &#34;lines&#34;: 217,

        &#34;words&#34;: 774,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea/workspace.xml&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;admin&#34;,

        &#34;status&#34;: 301,

        &#34;redirect&#34;: &#34;http://testphp.vulnweb.com/admin/&#34;,

        &#34;title&#34;: &#34;301 Moved Permanently&#34;,

        &#34;length&#34;: 169,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 8,

        &#34;words&#34;: 11,

        &#34;type&#34;: &#34;folder&#34;,

        &#34;mark&#34;: &#34;30x&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/admin&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;login.php&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;login page&#34;,

        &#34;length&#34;: 5009,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 120,

        &#34;words&#34;: 432,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/login.php&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea/.name&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;&#34;,

        &#34;length&#34;: 6,

        &#34;content_type&#34;: &#34;application/octet-stream&#34;,

        &#34;lines&#34;: 1,

        &#34;words&#34;: 1,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea/.name&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea/vcs.xml&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;&#34;,

        &#34;length&#34;: 173,

        &#34;content_type&#34;: &#34;text/xml&#34;,

        &#34;lines&#34;: 8,

        &#34;words&#34;: 13,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea/vcs.xml&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea/&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;Index of /.idea/&#34;,

        &#34;length&#34;: 937,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 14,

        &#34;words&#34;: 46,

        &#34;type&#34;: &#34;whitelist&#34;,

        &#34;mark&#34;: &#34;index of&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea/&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;cgi-bin/&#34;,

        &#34;status&#34;: 403,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;403 Forbidden&#34;,

        &#34;length&#34;: 276,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 10,

        &#34;words&#34;: 28,

        &#34;type&#34;: &#34;folder&#34;,

        &#34;mark&#34;: &#34;403&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/cgi-bin/&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea/encodings.xml&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;&#34;,

        &#34;length&#34;: 171,

        &#34;content_type&#34;: &#34;text/xml&#34;,

        &#34;lines&#34;: 6,

        &#34;words&#34;: 11,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea/encodings.xml&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;search.php&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;search&#34;,

        &#34;length&#34;: 4218,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 104,

        &#34;words&#34;: 364,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/search.php&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;product.php&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;picture details&#34;,

        &#34;length&#34;: 4576,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 111,

        &#34;words&#34;: 377,

        &#34;type&#34;: &#34;check&#34;,

        &#34;mark&#34;: &#34;&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/product.php&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;admin/&#34;,

        &#34;status&#34;: 200,

        &#34;redirect&#34;: &#34;&#34;,

        &#34;title&#34;: &#34;Index of /admin/&#34;,

        &#34;length&#34;: 248,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 8,

        &#34;words&#34;: 16,

        &#34;type&#34;: &#34;whitelist&#34;,

        &#34;mark&#34;: &#34;index of&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/admin/&#34;

    },

    {

        &#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;,

        &#34;path&#34;: &#34;.idea&#34;,

        &#34;status&#34;: 301,

        &#34;redirect&#34;: &#34;http://testphp.vulnweb.com/.idea/&#34;,

        &#34;title&#34;: &#34;301 Moved Permanently&#34;,

        &#34;length&#34;: 169,

        &#34;content_type&#34;: &#34;text/html&#34;,

        &#34;lines&#34;: 8,

        &#34;words&#34;: 11,

        &#34;type&#34;: &#34;folder&#34;,

        &#34;mark&#34;: &#34;30x&#34;,

        &#34;subdomain&#34;: &#34;testphp.vulnweb.com&#34;,

        &#34;depth&#34;: 0,

        &#34;url&#34;: &#34;http://testphp.vulnweb.com/.idea&#34;

    }

],

&#34;total&#34;: 12,

&#34;target&#34;: &#34;http://testphp.vulnweb.com/&#34;

}

(右滑查看更多)

字典(重要)

  1. Afuzz所使用的字典是一个text文本文件,每一个路径单独每一行;
  2. 关于后缀,Afuzz会使用-e参数提供的后缀替换%EXT%关键词,如果没设置-e的话,则使用默认值;
  3. 我们可以基于域名来生成字典,Afuzz可以使用主机替换%subdomain%,使用根域名替换%rootdomain%,使用子域名替换%sub%,使用域名替换%domain%;

使用样例

普通后缀:

代码语言:javascript
复制
index.%EXT%

设置asp和aspx后缀将生成下列字典:

代码语言:javascript
复制
index

index.asp

index.aspx

主机:

代码语言:javascript
复制
%subdomain%.%ext%

%sub%.bak

%domain%.zip

%rootdomain%.zip

传递https://test-www.hackerone.com和php后缀将生成下列字典:

代码语言:javascript
复制
test-www.hackerone.com.php

test-www.zip

test.zip

www.zip

testwww.zip

hackerone.zip

hackerone.com.zip

项目地址

Afuzz:

https://github.com/RapidDNS/Afuz

https://github.com/xmendez/wfuzz
https://github.com/s0md3v/Arjun