# FTP \[21]

<details>

<summary>Introduction</summary>

1. On of the oldest protocols
2. Operates on the application layer of the OSI model, alongside http and pop
3. TFTP - Trivial File Transfer Protoco l
   1. Less secure than FTP as it does not feature authentication
4. FTP can be vulnerable as it transmit data in cleartext and can probably be sniffed&#x20;

</details>

## VsftPD - Default Linux FTP Server

<details>

<summary>Default FTP on Linux (vsftpd)</summary>

One of the most used FTP servers on Linux-based distributions is [vsFTPd](https://security.appspot.com/vsftpd.html). The default configuration of vsFTPd can be found in `/etc/vsftpd.conf`

1. You can install it on Linux with the following&#x20;

```bash
z3tssu@htb[/htb]$ sudo apt install vsftpd 
```

</details>

<details>

<summary>Configuration File</summary>

```bash
z3tssu@htb[/htb]$ cat /etc/vsftpd.conf | grep -v "#"
```

![](https://3367244783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK3YP1U2Fck03eUZ2XijJ%2Fuploads%2FovImnkqWTCTcIK20YVbL%2Fimage.png?alt=media\&token=f8095432-1352-4ef2-a5e6-dc46992114c6)

</details>

<details>

<summary>FTP Users </summary>

```bash
z3tssu@htb[/htb]$ cat /etc/ftpusers

guest
john
kevin
```

&#x20;In addition, there is a file called `/etc/ftpusers` that we also need to pay attention to, as this file is used to deny certain users access to the FTP service. In the following example, the users `guest`, `john`, and `kevin` are not permitted to log in to the FTP service, even if they exist on the Linux system

</details>

<details>

<summary>Dangerous Settings</summary>

There are many different security-related settings we can make on each FTP server. These can have various purposes, such as testing connections through the firewalls, testing routes, and authentication mechanisms. One of these authentication mechanisms is the `anonymous` user. This is often used to allow everyone on the internal network to share files and data without accessing each other's computers. With vsFTPd, the [optional settings](http://vsftpd.beasts.org/vsftpd_conf.html) that can be added to the configuration file for the anonymous login look like this:

![](https://3367244783-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK3YP1U2Fck03eUZ2XijJ%2Fuploads%2F5IrvUlkgfDpe5K6sUxKF%2Fimage.png?alt=media\&token=ff13c146-fd18-4f2a-9ab9-da5a824fc69e)

</details>
