> For the complete documentation index, see [llms.txt](https://insecurecodes.gitbook.io/redbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://insecurecodes.gitbook.io/redbook/stages-of-ethical-hacking/enumeration/ftp.md).

# FTP

The File Transfer Protocol is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architect

{% hint style="info" %}
Default port: **21**
{% endhint %}

### Enum

```bash
nmap $IP -p 21 -sV -O
```

### Bruteforce with Hydra

{% code overflow="wrap" %}

```shell
hydra -L /usr/share/metasploit-framework/data/wordlists/unix_users.txt -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt $IP ftp
```

{% endcode %}

<figure><img src="https://2268752337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOfuDbXsIPnAIHFsZ9Bvf%2Fuploads%2Fudx231EGZvD9hXT4gEsB%2Fimage.png?alt=media&amp;token=d389e468-1c84-4d0c-b823-a52972a41333" alt=""><figcaption></figcaption></figure>

### Bruteforce with Nmap

{% code overflow="wrap" %}

```shell
nmap $IP --script ftp-brute --script-args userdb=/path/to/users -p 21
```

{% endcode %}

## Anonymous Login

```bash
nmap $IP --script ftp-anon
```

<figure><img src="https://2268752337-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOfuDbXsIPnAIHFsZ9Bvf%2Fuploads%2FCmSk9u4ulIy0PpZeoiJf%2Fimage.png?alt=media&amp;token=9fa367a1-cdd7-420e-a1cd-6c598bb72f92" alt=""><figcaption></figcaption></figure>
