# Crawling/Spidering & Fuzzing

## Crawling/Spidering

**Crawling/Spidering** is the automatic process of exploring a website (navigating the different links on each page) to list all the resources encountered along the way and create a map of them.

`/robots.txt`, `/sitemap.xml`

<table><thead><tr><th width="160">Tools</th><th>Details</th></tr></thead><tbody><tr><td><a href="https://github.com/projectdiscovery/katana">katana</a></td><td>Crawling and Spidering<br><code>katana -u &#x3C;SITE1>,&#x3C;SITE2>,...</code></td></tr><tr><td><a href="https://academy.hackthebox.com/storage/modules/279/ReconSpider.zip">ReconSpider</a></td><td>HTB's Custom Scrapy Spider<br><code>pip3 install scrapy</code><br><code>python3 ReconSpider.py &#x3C;SITE></code>  <em>(results.json)</em></td></tr></tbody></table>

## Fuzzing

**Fuzzing** attempts to locate, through brute force, vhosts, subdomains, files, and hidden paths that are not directly accessible from the site.

### [ffuf](https://github.com/ffuf/ffuf)

{% tabs %}
{% tab title="Directory" %}
{% code overflow="wrap" %}

```bash
ffuf -ic -w <WORDLIST>:X -u <URL>/X
```

{% endcode %}

{% code overflow="wrap" %}

```bash
ffuf -ic -v -recursion -recursion-depth <N> -w <WORDLIST> -u <URL>/FUZZ
```

{% endcode %}
{% endtab %}

{% tab title="Extensions" %}
*Try on files like* `index` *based on Technology Stack.*

{% code overflow="wrap" %}

```bash
ffuf -ic -w <WORDLIST_EXTENSIONS>:FUZZ -u <URL>/indexFUZZ
```

{% endcode %}
{% endtab %}

{% tab title="Files" %}
*Try with extensions found.*

{% code overflow="wrap" %}

```bash
ffuf -ic -e <.EXT> -v -recursion -recursion-depth <N> -w <W> -u <URL>/FUZZ
```

{% endcode %}
{% endtab %}

{% tab title="GET/POST Param/Value" %}
{% code overflow="wrap" %}

```bash
ffuf -ic -w <WORDLIST>:X -u <URL>/?X=value
```

{% endcode %}

{% code overflow="wrap" %}

```bash
ffuf -ic -w <WORDLIST>:X -u <URL> -X POST -d ‘X=value’
```

{% endcode %}
{% endtab %}

{% tab title="API" %}
{% code overflow="wrap" %}

```bash
ffuf -ic -w <WORDLIST>:X -u <URL>/api/X
```

{% endcode %}

```bash
ffuf -ic -w <WORDLIST>:X -u <URL>/X/v1
ffuf -ic -w <WORDLIST>:X -u <URL>/X/v2
```

{% endtab %}
{% endtabs %}

With `-recursion` you cannot specify wordlist name, you have to use `FUZZ`.

### Other

<table><thead><tr><th width="165">Tools</th><th>Details</th></tr></thead><tbody><tr><td><a href="https://github.com/maurosoria/dirsearch">dirsearch</a></td><td><code>dirsearch -u &#x3C;SITE></code></td></tr><tr><td><a href="https://github.com/OJ/gobuster">gobuster</a></td><td><code>gobuster [dir/dns/fuzz/vhost/...] -h</code></td></tr><tr><td><a href="https://github.com/epi052/feroxbuster">feroxbuster</a></td><td><code>feroxbuster -u &#x3C;SITE></code></td></tr><tr><td><a href="https://github.com/irsdl/IIS-ShortName-Scanner">IIS-ShortName-Scanner</a></td><td><p>Scanners for IIS short filename (8.3) disclosure vulnerability (<a href="https://ubuntuhandbook.org/index.php/2022/03/install-jdk-18-ubuntu/">Install Oracle Java</a>). Short filename consisting in eight characters for the file name, a period, and three characters for the extension.</p><details><summary>ex</summary><p>In <code>SecretDocuments/</code> there are <code>somefile.txt</code> and <code>somefile1.txt</code><br><code>/secret~1/somefi~1.txt</code> for <code>somefile.txt</code> <br><code>/secret~1/somefi~2.txt</code> for <code>somefile1.txt</code></p></details><p><code>java -jar iis_shortname_scanner.jar 0 5 http://&#x3C;TARGET>/</code> <br>If does not permit <code>GET</code> access, brute-forcing of the remaining filename.<br><code>egrep -r ^&#x3C;START_STRING> /usr/share/wordlists/* | sed 's/^[^:]*://' > /tmp/list.txt</code> <br><code>gobuster dir -u http://&#x3C;TARGET>/ -w /tmp/list.txt -x .aspx,.asp</code></p></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ivalexev.gitbook.io/rednote/pentesting-process/web-attacks/crawling-spidering-and-fuzzing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
